Re: [PATCH 07/15] usb: musb: Handle cable status better for 2430 glue layer

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

 



On Fri, May 13, 2016 at 03:21:55PM -0500, Bin Liu wrote:
> Hi,
> 
> On Fri, May 13, 2016 at 01:09:02PM -0700, Tony Lindgren wrote:
> > * Bin Liu <b-liu@xxxxxx> [160513 12:58]:
> > > On Wed, May 11, 2016 at 06:33:04PM -0700, Tony Lindgren wrote:
> > > > --- a/drivers/usb/musb/omap2430.c
> > > > +++ b/drivers/usb/musb/omap2430.c
> > > > @@ -49,6 +49,9 @@ struct omap2430_glue {
> > > >  	enum musb_vbus_id_status status;
> > > >  	struct work_struct	omap_musb_mailbox_work;
> > > >  	struct device		*control_otghs;
> > > > +	bool			cable_connected;
> > > > +	bool			enabled;
> > > > +	bool			powered;
> > > 
> > > This variable is only used within omap2430_set_power(), so it can be
> > > local within that function to save a few bytes.
> > 
> > Well it needs to be static as we keep things powered only if
> > glue is enabled and cable is connected.
> 
> I think it does not have to static in omap2430_glue, how about in the

I meant in omap2430_set_power().

> very beginning of omap2430_set_power(),
> 
> 	bool powered = glue->enabled && glue->cable_connected;
> 
> before changing glue->enabled and glue->cable_connected, then this
> local powered variable is equivalent to glue->powered.
> 
> > 
> > I'd rather not add any more static stuff that's not specific to the
> > glue instance.. Got any better ideas?
> 
> I didn't think hard enough for this, but I think your idea is acceptable
> ;).
> 
> Regards,
> -Bin.
> 
> > 
> > BTW, we still have also at least _glue remaining in the 2430 glue.
> > 
> > Regards,
> > 
> > Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux