mtd: pismo: Simplify getting the adapter of a client
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Mon, 22 Jul 2019 18:15:49 +0000 (20:15 +0200)
committerRichard Weinberger <richard@nod.at>
Sun, 15 Sep 2019 21:50:39 +0000 (23:50 +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>
Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/maps/pismo.c

index 788d499..946ba80 100644 (file)
@@ -211,13 +211,12 @@ static int pismo_remove(struct i2c_client *client)
 static int pismo_probe(struct i2c_client *client,
                       const struct i2c_device_id *id)
 {
-       struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
        struct pismo_pdata *pdata = client->dev.platform_data;
        struct pismo_eeprom eeprom;
        struct pismo_data *pismo;
        int ret, i;
 
-       if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) {
+       if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
                dev_err(&client->dev, "functionality mismatch\n");
                return -EIO;
        }