Skip to content

Commit

Permalink
HID: hid-sensor-hub: fix duplicate sysfs entry error
Browse files Browse the repository at this point in the history
Fix kernel warning and failure to register sensor hub devices with MFD.  Now
many devices has in-built sensor hubs. So by default this HID hub, is properly
parsed and register individual sensors as platform device using MFD framework.
But if a second sensor hub is attached via USB, which has same sensors, it will
result in kernel warning and failure to register MFD cell as the platform
device sysfs file name will be same as created by in-built sensor hubs. This
patch sets MFD cell id to PLATFORM_DEVID_AUTO. In this way there will never be
duplicate sysfs file names.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Srinivas Pandruvada authored and Jiri Kosina committed Dec 9, 2013
1 parent 0a5f99c commit d81cae8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/hid/hid-sensor-hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,8 @@ static int sensor_hub_probe(struct hid_device *hdev,
ret = -ENOMEM;
goto err_free_names;
}
sd->hid_sensor_hub_client_devs[
sd->hid_sensor_client_cnt].id = PLATFORM_DEVID_AUTO;
sd->hid_sensor_hub_client_devs[
sd->hid_sensor_client_cnt].name = name;
sd->hid_sensor_hub_client_devs[
Expand Down

0 comments on commit d81cae8

Please sign in to comment.