aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/nokia.c
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz <andrzej.p@samsung.com>2013-05-23 04:51:10 -0400
committerFelipe Balbi <balbi@ti.com>2013-06-10 10:30:46 -0400
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 a69e8bfb3ecb..5650ece3e09c 100644
--- a/drivers/usb/gadget/nokia.c
+++ b/drivers/usb/gadget/nokia.c
@@ -106,6 +106,8 @@ static struct usb_function *f_obex2_cfg1;
106static struct usb_function *f_obex1_cfg2; 106static struct usb_function *f_obex1_cfg2;
107static struct usb_function *f_obex2_cfg2; 107static struct usb_function *f_obex2_cfg2;
108static struct eth_dev *the_dev; 108static struct eth_dev *the_dev;
109static struct net_device *phonet_dev;
110
109 111
110static struct usb_configuration nokia_config_500ma_driver = { 112static struct usb_configuration nokia_config_500ma_driver = {
111 .label = "Bus Powered", 113 .label = "Bus Powered",
@@ -136,7 +138,7 @@ static int __init nokia_bind_config(struct usb_configuration *c)
136 int obex1_stat = 0; 138 int obex1_stat = 0;
137 int obex2_stat = 0; 139 int obex2_stat = 0;
138 140
139 status = phonet_bind_config(c); 141 status = phonet_bind_config(c, phonet_dev);
140 if (status) 142 if (status)
141 pr_debug("could not bind phonet config\n"); 143 pr_debug("could not bind phonet config\n");
142 144
@@ -211,9 +213,11 @@ static int __init nokia_bind(struct usb_composite_dev *cdev)
211 struct usb_gadget *gadget = cdev->gadget; 213 struct usb_gadget *gadget = cdev->gadget;
212 int status; 214 int status;
213 215
214 status = gphonet_setup(cdev->gadget); 216 phonet_dev = gphonet_setup(cdev->gadget);
215 if (status < 0) 217 if (IS_ERR(phonet_dev)) {
218 status = PTR_ERR(phonet_dev);
216 goto err_phonet; 219 goto err_phonet;
220 }
217 221
218 the_dev = gether_setup(cdev->gadget, dev_addr, host_addr, host_mac, 222 the_dev = gether_setup(cdev->gadget, dev_addr, host_addr, host_mac,
219 qmult); 223 qmult);
@@ -278,7 +282,7 @@ err_obex2_inst:
278err_usb: 282err_usb:
279 gether_cleanup(the_dev); 283 gether_cleanup(the_dev);
280err_ether: 284err_ether:
281 gphonet_cleanup(); 285 gphonet_cleanup(phonet_dev);
282err_phonet: 286err_phonet:
283 return status; 287 return status;
284} 288}
@@ -300,7 +304,7 @@ static int __exit nokia_unbind(struct usb_composite_dev *cdev)
300 if (!IS_ERR(fi_obex2)) 304 if (!IS_ERR(fi_obex2))
301 usb_put_function_instance(fi_obex2); 305 usb_put_function_instance(fi_obex2);
302 usb_put_function_instance(fi_acm); 306 usb_put_function_instance(fi_acm);
303 gphonet_cleanup(); 307 gphonet_cleanup(phonet_dev);
304 308
305 gether_cleanup(the_dev); 309 gether_cleanup(the_dev);
306 310