linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: cp2112: use proper hidraw name with minor number
@ 2017-03-02 13:27 Jaejoong Kim
  2017-03-02 14:08 ` Benjamin Tissoires
  0 siblings, 1 reply; 3+ messages in thread
From: Jaejoong Kim @ 2017-03-02 13:27 UTC (permalink / raw)
  To: jikos, benjamin.tissoires; +Cc: linux-input, Jaejoong Kim

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

Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com>
---
 drivers/hid/hid-cp2112.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c
index b22d0f8..078026f 100644
--- a/drivers/hid/hid-cp2112.c
+++ b/drivers/hid/hid-cp2112.c
@@ -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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] HID: cp2112: use proper hidraw name with minor number
  2017-03-02 13:27 [PATCH] HID: cp2112: use proper hidraw name with minor number Jaejoong Kim
@ 2017-03-02 14:08 ` Benjamin Tissoires
  2017-03-03  6:57   ` Kim Jaejoong
  0 siblings, 1 reply; 3+ messages in thread
From: Benjamin Tissoires @ 2017-03-02 14:08 UTC (permalink / raw)
  To: Jaejoong Kim; +Cc: jikos, linux-input

On Mar 02 2017 or thereabouts, Jaejoong Kim wrote:
> The cp2112 driver is working on hidraw not hiddev. So we need to use proper
> hidraw name with hidraw's minor number.
> 
> Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com>
> ---

Looks good to me:
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

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



>  drivers/hid/hid-cp2112.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c
> index b22d0f8..078026f 100644
> --- a/drivers/hid/hid-cp2112.c
> +++ b/drivers/hid/hid-cp2112.c
> @@ -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
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] HID: cp2112: use proper hidraw name with minor number
  2017-03-02 14:08 ` Benjamin Tissoires
@ 2017-03-03  6:57   ` Kim Jaejoong
  0 siblings, 0 replies; 3+ messages in thread
From: Kim Jaejoong @ 2017-03-03  6:57 UTC (permalink / raw)
  To: Benjamin Tissoires; +Cc: jikos, linux-input

Hi Benjamin

2017-03-02 23:08 GMT+09:00 Benjamin Tissoires <benjamin.tissoires@redhat.com>:
> On Mar 02 2017 or thereabouts, Jaejoong Kim wrote:
>> The cp2112 driver is working on hidraw not hiddev. So we need to use proper
>> hidraw name with hidraw's minor number.
>>
>> Signed-off-by: Jaejoong Kim <climbbb.kim@gmail.com>
>> ---
>
> Looks good to me:
> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Thanks for the review.

>
> 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

>
> Cheers,
> Benjamin
>
>
>
>>  drivers/hid/hid-cp2112.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/hid/hid-cp2112.c b/drivers/hid/hid-cp2112.c
>> index b22d0f8..078026f 100644
>> --- a/drivers/hid/hid-cp2112.c
>> +++ b/drivers/hid/hid-cp2112.c
>> @@ -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
>>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-03  6:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-02 13:27 [PATCH] HID: cp2112: use proper hidraw name with minor number Jaejoong Kim
2017-03-02 14:08 ` Benjamin Tissoires
2017-03-03  6:57   ` Kim Jaejoong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).