diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-08-12 11:43:53 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-22 13:21:25 -0400 |
commit | b0fca50f5a94a268ed02cfddf44448051ed9343f (patch) | |
tree | bc398947bcf6355f05ec33e4fea6a0b1927384ac /drivers/usb/gadget/net2280.c | |
parent | e12995ec8f8d99f2a339541fc28998af2d60af0f (diff) |
usb gadget: don't save bind callback in struct usb_gadget_driver
To accomplish this the function to register a gadget driver takes the bind
function as a second argument. To make things clearer rename the function
to resemble platform_driver_probe.
This fixes many section mismatches like
WARNING: drivers/usb/gadget/g_printer.o(.data+0xc): Section mismatch in
reference from the variable printer_driver to the function
.init.text:printer_bind()
The variable printer_driver references
the function __init printer_bind()
All callers are fixed.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
[m.nazarewicz@samsung.com: added dbgp]
Signed-off-by: Michał Nazarewicz <m.nazarewicz@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/net2280.c')
-rw-r--r-- | drivers/usb/gadget/net2280.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/usb/gadget/net2280.c b/drivers/usb/gadget/net2280.c index 9498be87a724..d09155b25d73 100644 --- a/drivers/usb/gadget/net2280.c +++ b/drivers/usb/gadget/net2280.c | |||
@@ -1929,7 +1929,8 @@ static void ep0_start (struct net2280 *dev) | |||
1929 | * disconnect is reported. then a host may connect again, or | 1929 | * disconnect is reported. then a host may connect again, or |
1930 | * the driver might get unbound. | 1930 | * the driver might get unbound. |
1931 | */ | 1931 | */ |
1932 | int usb_gadget_register_driver (struct usb_gadget_driver *driver) | 1932 | int usb_gadget_probe_driver(struct usb_gadget_driver *driver, |
1933 | int (*bind)(struct usb_gadget *)) | ||
1933 | { | 1934 | { |
1934 | struct net2280 *dev = the_controller; | 1935 | struct net2280 *dev = the_controller; |
1935 | int retval; | 1936 | int retval; |
@@ -1941,8 +1942,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver) | |||
1941 | */ | 1942 | */ |
1942 | if (!driver | 1943 | if (!driver |
1943 | || driver->speed != USB_SPEED_HIGH | 1944 | || driver->speed != USB_SPEED_HIGH |
1944 | || !driver->bind | 1945 | || !bind || !driver->setup) |
1945 | || !driver->setup) | ||
1946 | return -EINVAL; | 1946 | return -EINVAL; |
1947 | if (!dev) | 1947 | if (!dev) |
1948 | return -ENODEV; | 1948 | return -ENODEV; |
@@ -1957,7 +1957,7 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver) | |||
1957 | driver->driver.bus = NULL; | 1957 | driver->driver.bus = NULL; |
1958 | dev->driver = driver; | 1958 | dev->driver = driver; |
1959 | dev->gadget.dev.driver = &driver->driver; | 1959 | dev->gadget.dev.driver = &driver->driver; |
1960 | retval = driver->bind (&dev->gadget); | 1960 | retval = bind(&dev->gadget); |
1961 | if (retval) { | 1961 | if (retval) { |
1962 | DEBUG (dev, "bind to driver %s --> %d\n", | 1962 | DEBUG (dev, "bind to driver %s --> %d\n", |
1963 | driver->driver.name, retval); | 1963 | driver->driver.name, retval); |
@@ -1993,7 +1993,7 @@ err_unbind: | |||
1993 | dev->driver = NULL; | 1993 | dev->driver = NULL; |
1994 | return retval; | 1994 | return retval; |
1995 | } | 1995 | } |
1996 | EXPORT_SYMBOL (usb_gadget_register_driver); | 1996 | EXPORT_SYMBOL(usb_gadget_probe_driver); |
1997 | 1997 | ||
1998 | static void | 1998 | static void |
1999 | stop_activity (struct net2280 *dev, struct usb_gadget_driver *driver) | 1999 | stop_activity (struct net2280 *dev, struct usb_gadget_driver *driver) |