diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2018-08-10 16:52:31 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-06-23 02:55:49 -0400 |
commit | 8624dfd10a3bb3ea3d8a959e17f8951f1b03d68d (patch) | |
tree | d461159bb29327bc4945e2f6019ff29577c1d0f8 | |
parent | 2178db65cd9c81c790cbf7504e90650750c3b467 (diff) |
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>
-rw-r--r-- | drivers/input/joystick/iforce/iforce-serio.c | 7 | ||||
-rw-r--r-- | drivers/input/joystick/iforce/iforce-usb.c | 7 |
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: | |||
204 | static int iforce_serio_connect(struct serio *serio, struct serio_driver *drv) | 204 | static int iforce_serio_connect(struct serio *serio, struct serio_driver *drv) |
205 | { | 205 | { |
206 | struct iforce_serio *iforce_serio; | 206 | struct iforce_serio *iforce_serio; |
207 | struct iforce *iforce; | ||
208 | int err; | 207 | int err; |
209 | 208 | ||
210 | iforce_serio = kzalloc(sizeof(*iforce_serio), GFP_KERNEL); | 209 | iforce_serio = kzalloc(sizeof(*iforce_serio), GFP_KERNEL); |
211 | if (!iforce_serio) | 210 | if (!iforce_serio) |
212 | return -ENOMEM; | 211 | return -ENOMEM; |
213 | 212 | ||
214 | iforce = &iforce_serio->iforce; | 213 | iforce_serio->iforce.xport_ops = &iforce_serio_xport_ops; |
215 | |||
216 | iforce->xport_ops = &iforce_serio_xport_ops; | ||
217 | 214 | ||
218 | iforce_serio->serio = serio; | 215 | iforce_serio->serio = serio; |
219 | serio_set_drvdata(serio, iforce_serio); | 216 | serio_set_drvdata(serio, iforce_serio); |
@@ -222,7 +219,7 @@ static int iforce_serio_connect(struct serio *serio, struct serio_driver *drv) | |||
222 | if (err) | 219 | if (err) |
223 | goto fail1; | 220 | goto fail1; |
224 | 221 | ||
225 | err = iforce_init_device(&serio->dev, BUS_RS232, iforce); | 222 | err = iforce_init_device(&serio->dev, BUS_RS232, &iforce_serio->iforce); |
226 | if (err) | 223 | if (err) |
227 | goto fail2; | 224 | goto fail2; |
228 | 225 | ||
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, | |||
208 | struct usb_host_interface *interface; | 208 | struct usb_host_interface *interface; |
209 | struct usb_endpoint_descriptor *epirq, *epout; | 209 | struct usb_endpoint_descriptor *epirq, *epout; |
210 | struct iforce_usb *iforce_usb; | 210 | struct iforce_usb *iforce_usb; |
211 | struct iforce *iforce; | ||
212 | int err = -ENOMEM; | 211 | int err = -ENOMEM; |
213 | 212 | ||
214 | interface = intf->cur_altsetting; | 213 | interface = intf->cur_altsetting; |
@@ -231,9 +230,7 @@ static int iforce_usb_probe(struct usb_interface *intf, | |||
231 | if (!iforce_usb->out) | 230 | if (!iforce_usb->out) |
232 | goto fail; | 231 | goto fail; |
233 | 232 | ||
234 | iforce = &iforce_usb->iforce; | 233 | iforce_usb->iforce.xport_ops = &iforce_usb_xport_ops; |
235 | |||
236 | iforce->xport_ops = &iforce_usb_xport_ops; | ||
237 | 234 | ||
238 | iforce_usb->usbdev = dev; | 235 | iforce_usb->usbdev = dev; |
239 | iforce_usb->intf = intf; | 236 | iforce_usb->intf = intf; |
@@ -248,7 +245,7 @@ static int iforce_usb_probe(struct usb_interface *intf, | |||
248 | iforce_usb->data_out, sizeof(iforce_usb->data_out), | 245 | iforce_usb->data_out, sizeof(iforce_usb->data_out), |
249 | iforce_usb_out, iforce_usb, epout->bInterval); | 246 | iforce_usb_out, iforce_usb, epout->bInterval); |
250 | 247 | ||
251 | err = iforce_init_device(&intf->dev, BUS_USB, iforce); | 248 | err = iforce_init_device(&intf->dev, BUS_USB, &iforce_usb->iforce); |
252 | if (err) | 249 | if (err) |
253 | goto fail; | 250 | goto fail; |
254 | 251 | ||