Skip to contentSkip to conversation

HID: cp2112: use proper hidraw name with minor number

PATCH Superseded Jaejoong Kim 2 participants 3 messages Mar 2, 2017 – Mar 3, 2017 HID

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: cp2112: use proper hidraw name with minor number

The cp2112 driver is working on hidraw not hiddev. So we need to use proper hidraw name with hidraw's minor number.

---
 drivers/hid/hid-cp2112.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/hid/hid-cp2112.c +3 -1
index b22d0f8..078026f 100644
@@ -27,6 +27,7 @@
 #include <linux/gpio.h>
 #include <linux/gpio/driver.h>
 #include <linux/hid.h>
+#include <linux/hidraw.h>
 #include <linux/i2c.h>
 #include <linux/module.h>
 #include <linux/nls.h>
@@ -1297,7 +1298,8 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id)
 	dev->adap.algo_data	= dev;
 	dev->adap.dev.parent	= &hdev->dev;
 	snprintf(dev->adap.name, sizeof(dev->adap.name),
-		 "CP2112 SMBus Bridge on hiddev%d", hdev->minor);
+		 "CP2112 SMBus Bridge on hidraw%d",
+		 ((struct hidraw *)hdev->hidraw)->minor);
 	dev->hwversion = buf[2];
 	init_waitqueue_head(&dev->wait);
 
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Jaejoong Kim

The cp2112 driver is working on hidraw not hiddev. So we need to use proper hidraw name with hidraw's minor number.

---

Looks good to me:

However, this one should probably be sent in the series "[PATCH 0/2]
HID: hiddev: move hiddev's minor number and refactoring" as it is a requirement for this series.

I'd say resubmit this one in the v2 of the series (with my reviewed-by), so that the series is consistent and Jiri knows that this one needs to come before the rest of the series.

Cheers,
Benjamin

Quoted 28 lines
 drivers/hid/hid-cp2112.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/hid/hid-cp2112.c +3 -1
index b22d0f8..078026f 100644
@@ -27,6 +27,7 @@
 #include <linux/gpio.h>
 #include <linux/gpio/driver.h>
 #include <linux/hid.h>
+#include <linux/hidraw.h>
 #include <linux/i2c.h>
 #include <linux/module.h>
 #include <linux/nls.h>
@@ -1297,7 +1298,8 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id)
 	dev->adap.algo_data	= dev;
 	dev->adap.dev.parent	= &hdev->dev;
 	snprintf(dev->adap.name, sizeof(dev->adap.name),
-		 "CP2112 SMBus Bridge on hiddev%d", hdev->minor);
+		 "CP2112 SMBus Bridge on hidraw%d",
+		 ((struct hidraw *)hdev->hidraw)->minor);
 	dev->hwversion = buf[2];
 	init_waitqueue_head(&dev->wait);
 
Signature · 1 line
2.7.4
#2 lore raw

Hi Benjamin

2017-03-02 23:08 GMT+09:00 Benjamin Tissoires <[email protected]>:

Quoted 9 lines · Jaejoong Kim
Quoted 5 lines

The cp2112 driver is working on hidraw not hiddev. So we need to use proper hidraw name with hidraw's minor number.

---

Looks good to me:

Thanks for the review.

Quoted 8 lines

However, this one should probably be sent in the series "[PATCH 0/2]
HID: hiddev: move hiddev's minor number and refactoring" as it is a requirement for this series.

I'd say resubmit this one in the v2 of the series (with my reviewed-by), so that the series is consistent and Jiri knows that this one needs to come before the rest of the series.

OK, I will resend v2 patchset with cp2112

Thanks,
jaejoong

Quoted 34 lines

Cheers,
Benjamin

Quoted 28 lines
 drivers/hid/hid-cp2112.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/hid/hid-cp2112.c +3 -2
index b22d0f8..078026f 100644
@@ -27,6 +27,7 @@
 #include <linux/gpio.h>
 #include <linux/gpio/driver.h>
 #include <linux/hid.h>
+#include <linux/hidraw.h>
 #include <linux/i2c.h>
 #include <linux/module.h>
 #include <linux/nls.h>
@@ -1297,7 +1298,8 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id)
      dev->adap.algo_data     = dev;
      dev->adap.dev.parent    = &hdev->dev;
      snprintf(dev->adap.name, sizeof(dev->adap.name),
-              "CP2112 SMBus Bridge on hiddev%d", hdev->minor);
+              "CP2112 SMBus Bridge on hidraw%d",
+              ((struct hidraw *)hdev->hidraw)->minor);
      dev->hwversion = buf[2];
      init_waitqueue_head(&dev->wait);
 
--

2.7.4