Browse Source

usb: gadget: printer: don't access file global usb_printer_gadget in function's code

The printer_dev can be recovered from printer_func_unbind() function's
parameters.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Andrzej Pietrasiewicz 10 years ago
parent
commit
8fe20f661f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/usb/gadget/legacy/printer.c

+ 1 - 1
drivers/usb/gadget/legacy/printer.c

@@ -1159,7 +1159,7 @@ static void printer_func_unbind(struct usb_configuration *c,
 	struct printer_dev	*dev;
 	struct usb_request	*req;
 
-	dev = &usb_printer_gadget;
+	dev = container_of(f, struct printer_dev, function);
 
 	device_destroy(usb_gadget_class, g_printer_devno);