From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: jkosina@suse.cz
Cc: linux-input@vger.kernel.org,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Subject: [PATCH v1] HID: hid-sensor-hub: Fix kernel warning and failure
Date: Thu, 5 Dec 2013 16:34:25 -0800 [thread overview]
Message-ID: <1386290065-31813-2-git-send-email-srinivas.pandruvada@linux.intel.com> (raw)
In-Reply-To: <1386290065-31813-1-git-send-email-srinivas.pandruvada@linux.intel.com>
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>
---
drivers/hid/hid-sensor-hub.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
index a184e19..8af2d90 100644
--- a/drivers/hid/hid-sensor-hub.c
+++ b/drivers/hid/hid-sensor-hub.c
@@ -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 =
--
1.8.1.2
next prev parent reply other threads:[~2013-12-06 0:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-06 0:34 [PATCH v1] Fix kernel warning and failure Srinivas Pandruvada
2013-12-06 0:34 ` Srinivas Pandruvada [this message]
2013-12-09 14:46 ` [PATCH v1] HID: hid-sensor-hub: " Jiri Kosina
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1386290065-31813-2-git-send-email-srinivas.pandruvada@linux.intel.com \
--to=srinivas.pandruvada@linux.intel.com \
--cc=jkosina@suse.cz \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).