From: Andrzej Pietrasiewicz Date: Tue, 3 Mar 2015 09:52:21 +0000 (+0100) Subject: usb: gadget: printer: don't access file global usb_printer_gadget in function's code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8fe20f661f3cfbb6778368eb3c73f8a6438ac640;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 Signed-off-by: Felipe Balbi --- diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb/gadget/legacy/printer.c index 3206ebcdd7a6..806475c19934 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);