summaryrefslogtreecommitdiff
path: root/drivers/input/joystick
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2018-08-10 23:52:31 +0300
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2019-06-23 09:55:49 +0300
commit8624dfd10a3bb3ea3d8a959e17f8951f1b03d68d (patch)
treed461159bb29327bc4945e2f6019ff29577c1d0f8 /drivers/input/joystick
parent2178db65cd9c81c790cbf7504e90650750c3b467 (diff)
downloadlinux-8624dfd10a3bb3ea3d8a959e17f8951f1b03d68d.tar.xz
Input: iforce - drop couple of temps from transport code
Transport initialization code now deals mostly with transport-specific data, so we can drop couple of temporary variables. Tested-by: Tim Schumacher <timschumi@gmx.de> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/joystick')
-rw-r--r--drivers/input/joystick/iforce/iforce-serio.c7
-rw-r--r--drivers/input/joystick/iforce/iforce-usb.c7
2 files changed, 4 insertions, 10 deletions
diff --git a/drivers/input/joystick/iforce/iforce-serio.c b/drivers/input/joystick/iforce/iforce-serio.c
index 277522d0f324..e7692a38591e 100644
--- a/drivers/input/joystick/iforce/iforce-serio.c
+++ b/drivers/input/joystick/iforce/iforce-serio.c
@@ -204,16 +204,13 @@ out:
static int iforce_serio_connect(struct serio *serio, struct serio_driver *drv)
{
struct iforce_serio *iforce_serio;
- struct iforce *iforce;
int err;
iforce_serio = kzalloc(sizeof(*iforce_serio), GFP_KERNEL);
if (!iforce_serio)
return -ENOMEM;
- iforce = &iforce_serio->iforce;
-
- iforce->xport_ops = &iforce_serio_xport_ops;
+ iforce_serio->iforce.xport_ops = &iforce_serio_xport_ops;
iforce_serio->serio = serio;
serio_set_drvdata(serio, iforce_serio);
@@ -222,7 +219,7 @@ static int iforce_serio_connect(struct serio *serio, struct serio_driver *drv)
if (err)
goto fail1;
- err = iforce_init_device(&serio->dev, BUS_RS232, iforce);
+ err = iforce_init_device(&serio->dev, BUS_RS232, &iforce_serio->iforce);
if (err)
goto fail2;
diff --git a/drivers/input/joystick/iforce/iforce-usb.c b/drivers/input/joystick/iforce/iforce-usb.c
index ae2dd5b5a416..a1e670781441 100644
--- a/drivers/input/joystick/iforce/iforce-usb.c
+++ b/drivers/input/joystick/iforce/iforce-usb.c
@@ -208,7 +208,6 @@ static int iforce_usb_probe(struct usb_interface *intf,
struct usb_host_interface *interface;
struct usb_endpoint_descriptor *epirq, *epout;
struct iforce_usb *iforce_usb;
- struct iforce *iforce;
int err = -ENOMEM;
interface = intf->cur_altsetting;
@@ -231,9 +230,7 @@ static int iforce_usb_probe(struct usb_interface *intf,
if (!iforce_usb->out)
goto fail;
- iforce = &iforce_usb->iforce;
-
- iforce->xport_ops = &iforce_usb_xport_ops;
+ iforce_usb->iforce.xport_ops = &iforce_usb_xport_ops;
iforce_usb->usbdev = dev;
iforce_usb->intf = intf;
@@ -248,7 +245,7 @@ static int iforce_usb_probe(struct usb_interface *intf,
iforce_usb->data_out, sizeof(iforce_usb->data_out),
iforce_usb_out, iforce_usb, epout->bInterval);
- err = iforce_init_device(&intf->dev, BUS_USB, iforce);
+ err = iforce_init_device(&intf->dev, BUS_USB, &iforce_usb->iforce);
if (err)
goto fail;