Skip to contentSkip to conversation

HID: Don't access input_dev->private directly

PATCH In review Dmitry Torokhov 2 participants 2 messages Oct 31, 2007 HID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: Don't access input_dev->private directly

Hi Jiri,

I'd like for the patch below to go to Linus rather sooner than later because I want to commit patch removing input_dev->private...

..Or I could push it through my tree if you give me your Acked-by.

Signature · 34 lines
Dmitry


Subject: HID: Don't access input_dev->private directly
From: Dmitry Torokhov <[email protected]>

input_{get|set}_drvdata() helpers should be used instead.

Signed-off-by: Dmitry Torokhov <[email protected]>
---
 drivers/hid/hid-input.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux/drivers/hid/hid-input.c
===================================================================
--- linux.orig/drivers/hid/hid-input.c
+++ linux/drivers/hid/hid-input.c
@@ -297,7 +297,7 @@ static struct hid_usage *hidinput_find_k
 static int hidinput_getkeycode(struct input_dev *dev, int scancode,
 				int *keycode)
 {
-	struct hid_device *hid = dev->private;
+	struct hid_device *hid = input_get_drvdata(dev);
 	struct hid_usage *usage;
 
 	usage = hidinput_find_key(hid, scancode, 0);
@@ -311,7 +311,7 @@ static int hidinput_getkeycode(struct in
 static int hidinput_setkeycode(struct input_dev *dev, int scancode,
 				int keycode)
 {
-	struct hid_device *hid = dev->private;
+	struct hid_device *hid = input_get_drvdata(dev);
 	struct hid_usage *usage;
 	int old_keycode;
#1 lore raw
Quoted 3 lines · Dmitry Torokhov

I'd like for the patch below to go to Linus rather sooner than later because I want to commit patch removing input_dev->private... ..Or I could push it through my tree if you give me your Acked-by.

Hi Dmitry,

I am planning to push a few fixes to Linus probably today, so I'll take your patch through my tree together with other fixes.

Thanks!

Signature · 1 line
Jiri Kosina