usb: typec: tcpm: fusb302: simplify getting the adapter of a client
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Sat, 8 Jun 2019 10:56:13 +0000 (12:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 8 Jun 2019 13:40:19 +0000 (15:40 +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: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/fusb302.c

index 7302f7501ec9e14281a7bf2fcd97eface2f6c1fb..c524088246ee33c5b3d8c1b39d7ca64598819572 100644 (file)
@@ -1697,13 +1697,12 @@ static int fusb302_probe(struct i2c_client *client,
                         const struct i2c_device_id *id)
 {
        struct fusb302_chip *chip;
-       struct i2c_adapter *adapter;
+       struct i2c_adapter *adapter = client->adapter;
        struct device *dev = &client->dev;
        const char *name;
        int ret = 0;
        u32 v;
 
-       adapter = to_i2c_adapter(client->dev.parent);
        if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_I2C_BLOCK)) {
                dev_err(&client->dev,
                        "I2C/SMBus block functionality not supported!\n");