OSDN Git Service

iio: light: bh1780: simplify getting the adapter of a client
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Sat, 8 Jun 2019 10:55:42 +0000 (12:55 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 17 Jun 2019 20:06:43 +0000 (21:06 +0100)
We have a dedicated pointer for that, so use it. Much easier to read and
less computation involved.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/light/bh1780.c

index 036f3bb..4f823e9 100644 (file)
@@ -145,7 +145,7 @@ static int bh1780_probe(struct i2c_client *client,
 {
        int ret;
        struct bh1780_data *bh1780;
-       struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
+       struct i2c_adapter *adapter = client->adapter;
        struct iio_dev *indio_dev;
 
        if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE))