mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
Input: maple_keyb - set driver data before registering input device
Set maple driver data before calling input_register_device() to ensure that it is available if the device is opened immediately and the callback is triggered. Cc: stable@vger.kernel.org Assisted-by: Antigravity:gemini-3.5-flash Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
fe938ee497
commit
536394ec81
|
|
@ -166,6 +166,8 @@ static int probe_maple_kbd(struct device *dev)
|
|||
kbd->dev = idev;
|
||||
memcpy(kbd->keycode, dc_kbd_keycode, sizeof(kbd->keycode));
|
||||
|
||||
maple_set_drvdata(mdev, kbd);
|
||||
|
||||
idev->name = mdev->product_name;
|
||||
idev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
|
||||
idev->keycode = kbd->keycode;
|
||||
|
|
@ -190,8 +192,6 @@ static int probe_maple_kbd(struct device *dev)
|
|||
|
||||
mdev->driver = mdrv;
|
||||
|
||||
maple_set_drvdata(mdev, kbd);
|
||||
|
||||
return error;
|
||||
|
||||
fail_register:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user