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:
Родитель
f3d45ac21e
Коммит
752031210c
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче