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

Signed-off-by: Andrzej Pietrasiewicz <andrze...@samsung.com>
---
 drivers/usb/gadget/legacy/printer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/legacy/printer.c 
b/drivers/usb/gadget/legacy/printer.c
index 3206ebc..806475c 100644
--- a/drivers/usb/gadget/legacy/printer.c
+++ b/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);
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to