mtd: pismo: Simplify getting the adapter of a client

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>
This commit is contained in:
Wolfram Sang 2019-07-22 20:15:49 +02:00 коммит произвёл Richard Weinberger
Родитель f3d45ac21e
Коммит 752031210c
1 изменённых файлов: 1 добавлений и 2 удалений

Просмотреть файл

@ -211,13 +211,12 @@ static int pismo_remove(struct i2c_client *client)
static int pismo_probe(struct i2c_client *client, static int pismo_probe(struct i2c_client *client,
const struct i2c_device_id *id) 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_pdata *pdata = client->dev.platform_data;
struct pismo_eeprom eeprom; struct pismo_eeprom eeprom;
struct pismo_data *pismo; struct pismo_data *pismo;
int ret, i; 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"); dev_err(&client->dev, "functionality mismatch\n");
return -EIO; return -EIO;
} }