summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/nokia.c
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2013-05-23 10:51:10 +0200
committerFelipe Balbi <balbi@ti.com>2013-06-10 17:30:46 +0300
commit0189e63ad8a06bcd9f74ca00490cf7aa7bae0cff (patch)
treec6d0b568a82731105f73f55044997aba4d3ed4af /drivers/usb/gadget/nokia.c
parent9b2252cace741e4843983d77ead80c3cf1d74e20 (diff)
usb: gadget: phonet: move global dev variable to its user
cleanup patch only in preparation for configfs. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/nokia.c')
-rw-r--r--drivers/usb/gadget/nokia.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/usb/gadget/nokia.c b/drivers/usb/gadget/nokia.c
index a69e8bfb3ec..5650ece3e09 100644
--- a/drivers/usb/gadget/nokia.c
+++ b/drivers/usb/gadget/nokia.c
@@ -106,6 +106,8 @@ static struct usb_function *f_obex2_cfg1;
static struct usb_function *f_obex1_cfg2;
static struct usb_function *f_obex2_cfg2;
static struct eth_dev *the_dev;
+static struct net_device *phonet_dev;
+
static struct usb_configuration nokia_config_500ma_driver = {
.label = "Bus Powered",
@@ -136,7 +138,7 @@ static int __init nokia_bind_config(struct usb_configuration *c)
int obex1_stat = 0;
int obex2_stat = 0;
- status = phonet_bind_config(c);
+ status = phonet_bind_config(c, phonet_dev);
if (status)
pr_debug("could not bind phonet config\n");
@@ -211,9 +213,11 @@ static int __init nokia_bind(struct usb_composite_dev *cdev)
struct usb_gadget *gadget = cdev->gadget;
int status;
- status = gphonet_setup(cdev->gadget);
- if (status < 0)
+ phonet_dev = gphonet_setup(cdev->gadget);
+ if (IS_ERR(phonet_dev)) {
+ status = PTR_ERR(phonet_dev);
goto err_phonet;
+ }
the_dev = gether_setup(cdev->gadget, dev_addr, host_addr, host_mac,
qmult);
@@ -278,7 +282,7 @@ err_obex2_inst:
err_usb:
gether_cleanup(the_dev);
err_ether:
- gphonet_cleanup();
+ gphonet_cleanup(phonet_dev);
err_phonet:
return status;
}
@@ -300,7 +304,7 @@ static int __exit nokia_unbind(struct usb_composite_dev *cdev)
if (!IS_ERR(fi_obex2))
usb_put_function_instance(fi_obex2);
usb_put_function_instance(fi_acm);
- gphonet_cleanup();
+ gphonet_cleanup(phonet_dev);
gether_cleanup(the_dev);