Re: [RFC][PATCH 1/2 v2] usb: host: ehci-platform: add platform specific .power callback

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

 



On Fri, 3 Aug 2012, Alan Stern wrote:

> > +	void (*power)(struct device *dev, int in_pm, int enable);
> 
> I don't like having these two separate arguments.  Having multiple 
> function pointers would be better:
> 
> 	void (*power_off)(struct platform_device *pdev);
> 			/* Turn off all power and clocks */
> 	void (*power_suspend)(struct platform_device *pdev);
> 			/* Turn on only VBUS suspend power and hotplug
> 				detection, turn off everything else */
> 	void (*power_on)(struct platform_device *pdev);
> 			/* Turn on all power and clocks */

Come to think of it, it would be better for the power_on callback to
return an integer error code that you could test.  The other callbacks
might not matter so much.

Alan Stern

--
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