From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oliver Neukum Subject: Re: [PATCHv2][RFC] smsc95xx: enable dynamic autosuspend Date: Fri, 14 Dec 2012 15:22:31 +0100 Message-ID: <4228102.c0z2lbILKD@linux-lqwf.site> References: <1355239561-2740-1-git-send-email-steve.glendinning@shawell.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: Ming Lei , Steve Glendinning , netdev , linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Greg Kroah-Hartman To: Steve Glendinning Return-path: In-Reply-To: Sender: linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org On Friday 14 December 2012 13:35:04 Steve Glendinning wrote: > Thanks Ming, I've updated this. Very good. Good catch Ming. > > IMO, it is better to keep smsc95xx_info.manage_power as NULL > > for devices without FEATURE_AUTOSUSPEND, so that fewer code > > and follow the current .mange_power usage(see its comment). > > > > Currently, if the function pointer of manage_power is set, it means that > > the device supports USB autosuspend, but your trick will make the manage_power() can return errors. So the assumption was always strictly speaking invalid. > > assumption not true for some smsc devices. > > Oliver? On second thought, I think that if a driver can do manage_power(), even only for a subset of devices, it should implement it. Doctoring the table of methods is very, very ugly, especially as this not protected by a lock. But this is not nice. We need a better way. Regards Oliver -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html