On Thu, Feb 22, 2007 at 01:29:19PM -0800, Jim Radford wrote: > On Thu, Feb 22, 2007 at 11:40:33AM -0800, Greg KH wrote: > > On Wed, Feb 21, 2007 at 03:28:51PM -0800, Jim Radford wrote: > > > Allow usb-serial driver's attach callback to create sysfs attributes, > > > by calling device_register, before calling ->attach().
> > No, if you want to do this kind of "attach" you can do it today in the > > port_probe() function that you will be called with the proper structure. > I see. Creating the attrs during device_register is clearly the way > to go. I had missed that there where bus callbacks that happen then. > > Care to rework your patch series because of this? > No problem. Here it is against 2.6.21-rc1. > Fix access to the ftdi_sio sysfs attributes like latency_timer by > moving them from the usb_device to the usb_serial_port. This allow > access to the data required and is a more appropriate place for them > at the same time. As a side effect, their creation is moved to the > ->port_probe() bus callback which happens during device_register > instead of after. One problem with this is that ->shutdown(), which cleans up my pointer, is called before device_unregister(). So now we have: ->attach() dev_set_drvdata(priv) device_register() ->port_probe(priv) ->shutdown() dev_set_drvdata(NULL) device_unregister() ->port_remove(NULL) // BOOM! which is asymmetric. I think one pair should be reversed. I'm guessing the latter since you didn't like my patch to reverse the former. :) I don't have enough context to decide, so let me know and I'll work up a patch. -Jim ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel