diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2018-08-04 01:26:00 +0300 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-06-23 09:54:39 +0300 |
commit | 05ca38283afa5ad11de88395cf0b28c192766bc1 (patch) | |
tree | 8bcc5cc020f1bdba7cb932674b30ea26d541da8a /drivers/input/joystick/iforce/iforce-main.c | |
parent | 9381758466f9939d84f6f70097c8883da9639379 (diff) | |
download | linux-05ca38283afa5ad11de88395cf0b28c192766bc1.tar.xz |
Input: iforce - introduce start and stop io transport ops
Add start_io() and stop_io() transport methods so that core
does not have to know the details.
Tested-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/joystick/iforce/iforce-main.c')
-rw-r--r-- | drivers/input/joystick/iforce/iforce-main.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/drivers/input/joystick/iforce/iforce-main.c b/drivers/input/joystick/iforce/iforce-main.c index 58d5cfe46526..4401ca4a4c38 100644 --- a/drivers/input/joystick/iforce/iforce-main.c +++ b/drivers/input/joystick/iforce/iforce-main.c @@ -185,15 +185,7 @@ static int iforce_open(struct input_dev *dev) { struct iforce *iforce = input_get_drvdata(dev); - switch (iforce->bus) { -#ifdef CONFIG_JOYSTICK_IFORCE_USB - case IFORCE_USB: - iforce->irq->dev = iforce->usbdev; - if (usb_submit_urb(iforce->irq, GFP_KERNEL)) - return -EIO; - break; -#endif - } + iforce->xport_ops->start_io(iforce); if (test_bit(EV_FF, dev->evbit)) { /* Enable force feedback */ @@ -226,20 +218,7 @@ static void iforce_close(struct input_dev *dev) !test_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags)); } - switch (iforce->bus) { -#ifdef CONFIG_JOYSTICK_IFORCE_USB - case IFORCE_USB: - usb_kill_urb(iforce->irq); - usb_kill_urb(iforce->out); - usb_kill_urb(iforce->ctrl); - break; -#endif -#ifdef CONFIG_JOYSTICK_IFORCE_232 - case IFORCE_232: - //TODO: Wait for the last packets to be sent - break; -#endif - } + iforce->xport_ops->stop_io(iforce); } int iforce_init_device(struct iforce *iforce) |