Re: [PATCH 07/12] usb: phy-mxs: Add implementation of set_wakeup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Oct 12, 2013 at 11:44:59AM +0200, Marek Vasut wrote:
> 
> > +static int mxs_phy_set_wakeup(struct usb_phy *x, bool enabled)
> > +{
> > +	struct mxs_phy *mxs_phy = to_mxs_phy(x);
> > +	u32 value = BM_USBPHY_CTRL_ENVBUSCHG_WKUP |
> > +			BM_USBPHY_CTRL_ENDPDMCHG_WKUP |
> > +				BM_USBPHY_CTRL_ENIDCHG_WKUP;
> 
> Does this stuff pass checkpatch at all? I mean, this alignment seems a bit 
> strange.

Yes, it passed.

	u32 value = BM_USBPHY_CTRL_ENVBUSCHG_WKUP |
			BM_USBPHY_CTRL_ENDPDMCHG_WKUP | /* two tabs for last line */
				BM_USBPHY_CTRL_ENIDCHG_WKUP; /* one tab for last line */

Any better suggestions?

> 
> > +	if (enabled) {
> > +		mxs_phy_disconnect_line(mxs_phy, true);
> > +		writel_relaxed(value, x->io_priv + HW_USBPHY_CTRL_SET);
> > +	} else {
> > +		writel_relaxed(value, x->io_priv + HW_USBPHY_CTRL_CLR);
> > +		mxs_phy_disconnect_line(mxs_phy, false);
> > +	}
> > +
> > +	return 0;
> > +}
> > +
> >  static int mxs_phy_on_connect(struct usb_phy *phy,
> >  		enum usb_device_speed speed)
> >  {
> > @@ -315,6 +390,10 @@ static int mxs_phy_probe(struct platform_device *pdev)
> >  		}
> >  	}
> > 
> > +	if (of_find_property(np, "disconnect_line_without_vbus", NULL) &&
> > +			mxs_phy->regmap_anatop)
> 
> You might want to introduce a variable here to make the condition shorter:
> 
> var = of_find....
> if (var && mxs_phy->...)

I will change.


-- 

Best Regards,
Peter Chen

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux