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/s3c-hsotg.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/s3c-hsotg.c')
-rw-r--r-- | drivers/usb/gadget/s3c-hsotg.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index a229744a8c7d..ef825c3baed9 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
@@ -2523,7 +2523,8 @@ static int s3c_hsotg_corereset(struct s3c_hsotg *hsotg) | |||
2523 | return 0; | 2523 | return 0; |
2524 | } | 2524 | } |
2525 | 2525 | ||
2526 | int usb_gadget_register_driver(struct usb_gadget_driver *driver) | 2526 | int usb_gadget_probe_driver(struct usb_gadget_driver *driver, |
2527 | int (*bind)(struct usb_gadget *)) | ||
2527 | { | 2528 | { |
2528 | struct s3c_hsotg *hsotg = our_hsotg; | 2529 | struct s3c_hsotg *hsotg = our_hsotg; |
2529 | int ret; | 2530 | int ret; |
@@ -2543,7 +2544,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) | |||
2543 | dev_err(hsotg->dev, "%s: bad speed\n", __func__); | 2544 | dev_err(hsotg->dev, "%s: bad speed\n", __func__); |
2544 | } | 2545 | } |
2545 | 2546 | ||
2546 | if (!driver->bind || !driver->setup) { | 2547 | if (!bind || !driver->setup) { |
2547 | dev_err(hsotg->dev, "%s: missing entry points\n", __func__); | 2548 | dev_err(hsotg->dev, "%s: missing entry points\n", __func__); |
2548 | return -EINVAL; | 2549 | return -EINVAL; |
2549 | } | 2550 | } |
@@ -2562,7 +2563,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) | |||
2562 | goto err; | 2563 | goto err; |
2563 | } | 2564 | } |
2564 | 2565 | ||
2565 | ret = driver->bind(&hsotg->gadget); | 2566 | ret = bind(&hsotg->gadget); |
2566 | if (ret) { | 2567 | if (ret) { |
2567 | dev_err(hsotg->dev, "failed bind %s\n", driver->driver.name); | 2568 | dev_err(hsotg->dev, "failed bind %s\n", driver->driver.name); |
2568 | 2569 | ||
@@ -2687,7 +2688,7 @@ err: | |||
2687 | hsotg->gadget.dev.driver = NULL; | 2688 | hsotg->gadget.dev.driver = NULL; |
2688 | return ret; | 2689 | return ret; |
2689 | } | 2690 | } |
2690 | EXPORT_SYMBOL(usb_gadget_register_driver); | 2691 | EXPORT_SYMBOL(usb_gadget_probe_driver); |
2691 | 2692 | ||
2692 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) | 2693 | int usb_gadget_unregister_driver(struct usb_gadget_driver *driver) |
2693 | { | 2694 | { |