aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAndrzej Pietrasiewicz2015-03-03 10:52:10 +0100
committerFelipe Balbi2015-03-10 15:33:35 -0500
commit44eccced2b9aafd1eced9fb4821f26b6dff26a25 (patch)
tree0000d58a6aefa52fdaaaaab50601f409c17f496f /drivers
parent44b316525986252bb95d356419fc9e75f0532112 (diff)
usb: gadget: printer: eliminate pdev member of struct printer_dev
The pdev member of struct printer_dev is not used outside printer_bind_config(), so it can just as well be a local variable there. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/legacy/printer.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/usb/gadget/legacy/printer.c b/drivers/usb/gadget/legacy/printer.c
index bbcd6aa9abd1..a9c3e5782462 100644
--- a/drivers/usb/gadget/legacy/printer.c
+++ b/drivers/usb/gadget/legacy/printer.c
@@ -83,7 +83,6 @@ struct printer_dev {
u8 printer_status;
u8 reset_printer;
struct cdev printer_cdev;
- struct device *pdev;
u8 printer_cdev_open;
wait_queue_head_t wait;
struct usb_function function;
@@ -1175,6 +1174,7 @@ static int __init printer_bind_config(struct usb_configuration *c)
{
struct usb_gadget *gadget = c->cdev->gadget;
struct printer_dev *dev;
+ struct device *pdev;
int status = -ENOMEM;
size_t len;
u32 i;
@@ -1199,11 +1199,11 @@ static int __init printer_bind_config(struct usb_configuration *c)
return status;
/* Setup the sysfs files for the printer gadget. */
- dev->pdev = device_create(usb_gadget_class, NULL, g_printer_devno,
+ pdev = device_create(usb_gadget_class, NULL, g_printer_devno,
NULL, "g_printer");
- if (IS_ERR(dev->pdev)) {
+ if (IS_ERR(pdev)) {
ERROR(dev, "Failed to create device: g_printer\n");
- status = PTR_ERR(dev->pdev);
+ status = PTR_ERR(pdev);
goto fail;
}