leds: leds-tca6507: simplify getting the adapter of a client
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Sat, 8 Jun 2019 10:55:44 +0000 (12:55 +0200)
committerJacek Anaszewski <jacek.anaszewski@gmail.com>
Sun, 9 Jun 2019 11:11:44 +0000 (13:11 +0200)
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>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
drivers/leds/leds-tca6507.c

index 8f343afa4787027d54fa5484a581f0bbd56c37e0..0352265b3c79ef292270a96c625c90ecada5b84e 100644 (file)
@@ -757,7 +757,7 @@ static int tca6507_probe(struct i2c_client *client,
        int err;
        int i = 0;
 
-       adapter = to_i2c_adapter(client->dev.parent);
+       adapter = client->adapter;
        pdata = dev_get_platdata(&client->dev);
 
        if (!i2c_check_functionality(adapter, I2C_FUNC_I2C))