diff mbox

[2/2] HID: i2c-hid: Fill in physical device providing HID functionality

Message ID 1443442508-94971-2-git-send-email-mika.westerberg@linux.intel.com (mailing list archive)
State New, archived
Delegated to: Jiri Kosina
Headers show

Commit Message

Mika Westerberg Sept. 28, 2015, 12:15 p.m. UTC
Currently hid_connect() prints out following when I2C connected HID devices
is connected:

  hid-multitouch 0018:03EB:2136.0001: ... [ATML3432:00 03EB:2136] on

After "on " should read physical device name but it is left empty by the
driver.

Make it look better and fill in the physical device name.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/hid/i2c-hid/i2c-hid.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Daniel Martin Sept. 29, 2015, 6:40 a.m. UTC | #1
On 28 September 2015 at 14:15, Mika Westerberg
<mika.westerberg@linux.intel.com> wrote:
> Currently hid_connect() prints out following when I2C connected HID devices
> is connected:
>
>   hid-multitouch 0018:03EB:2136.0001: ... [ATML3432:00 03EB:2136] on
>
> After "on " should read physical device name but it is left empty by the
> driver.
>
> Make it look better and fill in the physical device name.
>
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> ---
>  drivers/hid/i2c-hid/i2c-hid.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
> index 2871f3c81a4c..10bd8e6e4c9c 100644
> --- a/drivers/hid/i2c-hid/i2c-hid.c
> +++ b/drivers/hid/i2c-hid/i2c-hid.c
> @@ -1028,6 +1028,7 @@ static int i2c_hid_probe(struct i2c_client *client,
>
>         snprintf(hid->name, sizeof(hid->name), "%s %04hX:%04hX",
>                  client->name, hid->vendor, hid->product);
> +       strlcpy(hid->phys, dev_name(&client->dev), sizeof(hid->phys));
>
>         ret = hid_add_device(hid);
>         if (ret) {
> --

Tested and
Reviewed-by: Daniel Martin <consume.noise@gmail.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Benjamin Tissoires Sept. 29, 2015, 9:06 a.m. UTC | #2
On Sep 28 2015 or thereabouts, Mika Westerberg wrote:
> Currently hid_connect() prints out following when I2C connected HID devices
> is connected:
> 
>   hid-multitouch 0018:03EB:2136.0001: ... [ATML3432:00 03EB:2136] on
> 
> After "on " should read physical device name but it is left empty by the
> driver.
> 
> Make it look better and fill in the physical device name.
> 
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> ---

Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>

Cheers,
Benjamin

>  drivers/hid/i2c-hid/i2c-hid.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
> index 2871f3c81a4c..10bd8e6e4c9c 100644
> --- a/drivers/hid/i2c-hid/i2c-hid.c
> +++ b/drivers/hid/i2c-hid/i2c-hid.c
> @@ -1028,6 +1028,7 @@ static int i2c_hid_probe(struct i2c_client *client,
>  
>  	snprintf(hid->name, sizeof(hid->name), "%s %04hX:%04hX",
>  		 client->name, hid->vendor, hid->product);
> +	strlcpy(hid->phys, dev_name(&client->dev), sizeof(hid->phys));
>  
>  	ret = hid_add_device(hid);
>  	if (ret) {
> -- 
> 2.5.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jiri Kosina Sept. 29, 2015, 10:07 a.m. UTC | #3
On Mon, 28 Sep 2015, Mika Westerberg wrote:

> Currently hid_connect() prints out following when I2C connected HID devices
> is connected:
> 
>   hid-multitouch 0018:03EB:2136.0001: ... [ATML3432:00 03EB:2136] on
> 
> After "on " should read physical device name but it is left empty by the
> driver.
> 
> Make it look better and fill in the physical device name.
> 
> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>

Applied to hid.git#for-4.4/i2c-hid.

Thanks,
diff mbox

Patch

diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index 2871f3c81a4c..10bd8e6e4c9c 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -1028,6 +1028,7 @@  static int i2c_hid_probe(struct i2c_client *client,
 
 	snprintf(hid->name, sizeof(hid->name), "%s %04hX:%04hX",
 		 client->name, hid->vendor, hid->product);
+	strlcpy(hid->phys, dev_name(&client->dev), sizeof(hid->phys));
 
 	ret = hid_add_device(hid);
 	if (ret) {