]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
hwmon: (lm90) simplify getting the adapter of a client
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Mon, 10 Jun 2019 09:51:54 +0000 (11:51 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 24 Jun 2019 01:33:01 +0000 (18:33 -0700)
We have a dedicated pointer for that, so use it. Much easier to read and
less computation involved.

Reported-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/lm90.c

index e562a578f20e6f6decc5937a930541624851dc5d..2ebcab8b0a9b70ed13e1a24f589f0888c9202b29 100644 (file)
@@ -1718,7 +1718,7 @@ static int lm90_probe(struct i2c_client *client,
                      const struct i2c_device_id *id)
 {
        struct device *dev = &client->dev;
-       struct i2c_adapter *adapter = to_i2c_adapter(dev->parent);
+       struct i2c_adapter *adapter = client->adapter;
        struct hwmon_channel_info *info;
        struct regulator *regulator;
        struct device *hwmon_dev;