diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-07-30 12:13:06 +0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2013-08-12 09:10:39 +0400 |
commit | a8b3a3a53f9a814e9938ea9cc179086ff5c0a387 (patch) | |
tree | 6905bf9311520248db9cdd63b8d7e1a1840b10b8 /drivers/hwmon/mcp3021.c | |
parent | f58876ac8c73f91c28f7825dee37ad64092eccf7 (diff) | |
download | linux-a8b3a3a53f9a814e9938ea9cc179086ff5c0a387.tar.xz |
hwmon: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/mcp3021.c')
-rw-r--r-- | drivers/hwmon/mcp3021.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/hwmon/mcp3021.c b/drivers/hwmon/mcp3021.c index eedb32292d6d..d219c06a857b 100644 --- a/drivers/hwmon/mcp3021.c +++ b/drivers/hwmon/mcp3021.c @@ -143,12 +143,13 @@ static int mcp3021_probe(struct i2c_client *client, break; } - if (client->dev.platform_data) { - data->vdd = *(u32 *)client->dev.platform_data; + if (dev_get_platdata(&client->dev)) { + data->vdd = *(u32 *)dev_get_platdata(&client->dev); if (data->vdd > MCP3021_VDD_MAX || data->vdd < MCP3021_VDD_MIN) return -EINVAL; - } else + } else { data->vdd = MCP3021_VDD_REF; + } err = sysfs_create_file(&client->dev.kobj, &dev_attr_in0_input.attr); if (err) |