summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/platform/x86/silead_dmi.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/platform/x86/silead_dmi.c b/drivers/platform/x86/silead_dmi.c
index 26b388db565a..7564cc6529e7 100644
--- a/drivers/platform/x86/silead_dmi.c
+++ b/drivers/platform/x86/silead_dmi.c
@@ -96,9 +96,9 @@ static const struct dmi_system_id silead_ts_dmi_table[] = {
{ },
};
-static void silead_ts_dmi_add_props(struct device *dev)
+static void silead_ts_dmi_add_props(struct i2c_client *client)
{
- struct i2c_client *client = to_i2c_client(dev);
+ struct device *dev = &client->dev;
const struct dmi_system_id *dmi_id;
const struct silead_ts_dmi_data *ts_data;
int error;
@@ -120,10 +120,13 @@ static int silead_ts_dmi_notifier_call(struct notifier_block *nb,
unsigned long action, void *data)
{
struct device *dev = data;
+ struct i2c_client *client;
switch (action) {
case BUS_NOTIFY_ADD_DEVICE:
- silead_ts_dmi_add_props(dev);
+ client = i2c_verify_client(dev);
+ if (client)
+ silead_ts_dmi_add_props(client);
break;
default: