From: Alan Stern Date: Thu, 23 Feb 2012 19:55:59 +0000 (-0500) Subject: usb-serial: new API for driver registration X-Git-Tag: v3.4-rc1~184^2~22^2~120 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=765e0ba62613fb90f09c1b5926750df0aa56f349;p=pandora-kernel.git usb-serial: new API for driver registration This patch (as1522) adds two new routines to the usb-serial core, for registering and unregistering serial drivers. Instead of registering the usb_driver and usb_serial_drivers separately, with error checking for each one, the drivers can all be registered and unregistered by a single function call. This reduces duplicated code. More importantly, the new core routines change the order in which the drivers are registered. Currently the usb-serial drivers are all registered first and the usb_driver is done last, which leaves a window for problems. A udev script may quickly add a new dynamic-ID for a usb-serial driver, causing the corresponding usb_driver to be probed. If the usb_driver hasn't been registered yet then an oops will occur. The new routine prevents such problems by registering the usb_driver first. To insure that it gets probed properly for already-attached serial devices, we call driver_attach() after all the usb-serial drivers have been registered. Along with adding the new routines, the patch modifies the "generic" serial driver to use them. Further patches will similarly modify all the other in-tree USB serial drivers. Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed