Skip to contentSkip to conversation

Fix kernel warning and failure

PATCH New Srinivas Pandruvada 2 participants 3 messages Dec 6, 2013 – Dec 9, 2013

Subsystems (2)
lore
Share & tools
lore

Srinivas Pandruvada

author maintainer
#0 lore raw

PATCH 1/1 Fix kernel warning and failure

v1:
Use platform driver capability to assign unique id. In this way it is just one line change.

v0:
Use idr to allocate unique cell id

Srinivas Pandruvada (1):
HID: hid-sensor-hub: Fix kernel warning and failure

 drivers/hid/hid-sensor-hub.c | 2 ++
 1 file changed, 2 insertions(+)
Signature · 1 line
1.8.1.2
author maintainer
#1 lore raw

PATCH 1/1 HID: hid-sensor-hub: Fix kernel warning and failure

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.

---
 drivers/hid/hid-sensor-hub.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/hid/hid-sensor-hub.c +2 -0
index a184e19..8af2d90 100644
@@ -573,6 +573,8 @@ static int sensor_hub_probe(struct hid_device *hdev,
 					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[
 				sd->hid_sensor_client_cnt].platform_data =
Signature · 1 line
1.8.1.2
Applied
#2 lore raw

Re: [PATCH v1] HID: hid-sensor-hub: Fix kernel warning and failure

Quoted 11 lines · Srinivas Pandruvada

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.

Applied, thanks Srinivas.

Signature · 2 lines
Jiri Kosina
SUSE Labs