diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2018-08-03 18:34:41 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2019-06-23 02:54:40 -0400 |
commit | 501025df2e774ea840276e08d2a0aead606ffa52 (patch) | |
tree | 766c3695e39dbf927a62292e7ac4fd119575c632 /drivers/input | |
parent | 05ca38283afa5ad11de88395cf0b28c192766bc1 (diff) |
Input: iforce - add bus type and parent arguments to iforce_init_device()
Note that the parent device for the USB-connected controllers is now
USB interface instead of USB device.
Tested-by: Tim Schumacher <timschumi@gmx.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/joystick/iforce/iforce-main.c | 19 | ||||
-rw-r--r-- | drivers/input/joystick/iforce/iforce-serio.c | 2 | ||||
-rw-r--r-- | drivers/input/joystick/iforce/iforce-usb.c | 2 | ||||
-rw-r--r-- | drivers/input/joystick/iforce/iforce.h | 3 |
4 files changed, 8 insertions, 18 deletions
diff --git a/drivers/input/joystick/iforce/iforce-main.c b/drivers/input/joystick/iforce/iforce-main.c index 4401ca4a4c38..894769d03df3 100644 --- a/drivers/input/joystick/iforce/iforce-main.c +++ b/drivers/input/joystick/iforce/iforce-main.c | |||
@@ -221,7 +221,8 @@ static void iforce_close(struct input_dev *dev) | |||
221 | iforce->xport_ops->stop_io(iforce); | 221 | iforce->xport_ops->stop_io(iforce); |
222 | } | 222 | } |
223 | 223 | ||
224 | int iforce_init_device(struct iforce *iforce) | 224 | int iforce_init_device(struct device *parent, u16 bustype, |
225 | struct iforce *iforce) | ||
225 | { | 226 | { |
226 | struct input_dev *input_dev; | 227 | struct input_dev *input_dev; |
227 | struct ff_device *ff; | 228 | struct ff_device *ff; |
@@ -243,20 +244,8 @@ int iforce_init_device(struct iforce *iforce) | |||
243 | * Input device fields. | 244 | * Input device fields. |
244 | */ | 245 | */ |
245 | 246 | ||
246 | switch (iforce->bus) { | 247 | input_dev->id.bustype = bustype; |
247 | #ifdef CONFIG_JOYSTICK_IFORCE_USB | 248 | input_dev->dev.parent = parent; |
248 | case IFORCE_USB: | ||
249 | input_dev->id.bustype = BUS_USB; | ||
250 | input_dev->dev.parent = &iforce->usbdev->dev; | ||
251 | break; | ||
252 | #endif | ||
253 | #ifdef CONFIG_JOYSTICK_IFORCE_232 | ||
254 | case IFORCE_232: | ||
255 | input_dev->id.bustype = BUS_RS232; | ||
256 | input_dev->dev.parent = &iforce->serio->dev; | ||
257 | break; | ||
258 | #endif | ||
259 | } | ||
260 | 249 | ||
261 | input_set_drvdata(input_dev, iforce); | 250 | input_set_drvdata(input_dev, iforce); |
262 | 251 | ||
diff --git a/drivers/input/joystick/iforce/iforce-serio.c b/drivers/input/joystick/iforce/iforce-serio.c index afc7521b430d..b5dea273f98e 100644 --- a/drivers/input/joystick/iforce/iforce-serio.c +++ b/drivers/input/joystick/iforce/iforce-serio.c | |||
@@ -183,7 +183,7 @@ static int iforce_serio_connect(struct serio *serio, struct serio_driver *drv) | |||
183 | if (err) | 183 | if (err) |
184 | goto fail1; | 184 | goto fail1; |
185 | 185 | ||
186 | err = iforce_init_device(iforce); | 186 | err = iforce_init_device(&serio->dev, BUS_RS232, iforce); |
187 | if (err) | 187 | if (err) |
188 | goto fail2; | 188 | goto fail2; |
189 | 189 | ||
diff --git a/drivers/input/joystick/iforce/iforce-usb.c b/drivers/input/joystick/iforce/iforce-usb.c index 10b583b5fc82..824df4273774 100644 --- a/drivers/input/joystick/iforce/iforce-usb.c +++ b/drivers/input/joystick/iforce/iforce-usb.c | |||
@@ -229,7 +229,7 @@ static int iforce_usb_probe(struct usb_interface *intf, | |||
229 | usb_fill_control_urb(iforce->ctrl, dev, usb_rcvctrlpipe(dev, 0), | 229 | usb_fill_control_urb(iforce->ctrl, dev, usb_rcvctrlpipe(dev, 0), |
230 | (void*) &iforce->cr, iforce->edata, 16, iforce_usb_ctrl, iforce); | 230 | (void*) &iforce->cr, iforce->edata, 16, iforce_usb_ctrl, iforce); |
231 | 231 | ||
232 | err = iforce_init_device(iforce); | 232 | err = iforce_init_device(&intf->dev, BUS_USB, iforce); |
233 | if (err) | 233 | if (err) |
234 | goto fail; | 234 | goto fail; |
235 | 235 | ||
diff --git a/drivers/input/joystick/iforce/iforce.h b/drivers/input/joystick/iforce/iforce.h index c020d61eccf2..3ee9245a415b 100644 --- a/drivers/input/joystick/iforce/iforce.h +++ b/drivers/input/joystick/iforce/iforce.h | |||
@@ -156,7 +156,8 @@ static inline int iforce_get_id_packet(struct iforce *iforce, u8* id) | |||
156 | 156 | ||
157 | /* Public functions */ | 157 | /* Public functions */ |
158 | /* iforce-main.c */ | 158 | /* iforce-main.c */ |
159 | int iforce_init_device(struct iforce *iforce); | 159 | int iforce_init_device(struct device *parent, u16 bustype, |
160 | struct iforce *iforce); | ||
160 | 161 | ||
161 | /* iforce-packets.c */ | 162 | /* iforce-packets.c */ |
162 | int iforce_control_playback(struct iforce*, u16 id, unsigned int); | 163 | int iforce_control_playback(struct iforce*, u16 id, unsigned int); |