power: supply: rt5033_battery: simplify getting the adapter of a client
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Sat, 8 Jun 2019 10:56:01 +0000 (12:56 +0200)
committerSebastian Reichel <sre@kernel.org>
Sun, 23 Jun 2019 16:03:11 +0000 (18:03 +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>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/rt5033_battery.c

index bcdd8304849291e6f1ddcbcfa0725cc4e05ce47e..508f825ff1907536eb6232be379ba0dae4571439 100644 (file)
@@ -118,7 +118,7 @@ static const struct power_supply_desc rt5033_battery_desc = {
 static int rt5033_battery_probe(struct i2c_client *client,
                const struct i2c_device_id *id)
 {
-       struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
+       struct i2c_adapter *adapter = client->adapter;
        struct power_supply_config psy_cfg = {};
        struct rt5033_battery *battery;
        u32 ret;