leds: leds-pca955x: simplify getting the adapter of a client
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Sat, 8 Jun 2019 10:55:43 +0000 (12:55 +0200)
committerJacek Anaszewski <jacek.anaszewski@gmail.com>
Sun, 9 Jun 2019 11:11:04 +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-pca955x.c

index a9f5dad55956711d198a2d0fdd80bcc5713e0f33..460626d81c6ac87c1a6d6c387c4bb3488fb33dbb 100644 (file)
@@ -432,7 +432,7 @@ static int pca955x_probe(struct i2c_client *client,
        int ngpios = 0;
 
        chip = &pca955x_chipdefs[id->driver_data];
-       adapter = to_i2c_adapter(client->dev.parent);
+       adapter = client->adapter;
        pdata = dev_get_platdata(&client->dev);
        if (!pdata) {
                pdata = pca955x_get_pdata(client, chip);