HID: i2c-hid: Fill in physical device providing HID functionality
authorMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 28 Sep 2015 12:15:08 +0000 (15:15 +0300)
committerJiri Kosina <jkosina@suse.cz>
Tue, 29 Sep 2015 10:04:28 +0000 (12:04 +0200)
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>
Reviewed-by: Daniel Martin <consume.noise@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/i2c-hid/i2c-hid.c

index 2871f3c81a4cceb521f4c26aac4da75466f5db6f..10bd8e6e4c9c814cbceb863bbff4a87f3d3a283a 100644 (file)
@@ -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) {