Commit 7d9d60bd authored by Wolfram Sang's avatar Wolfram Sang Committed by Jacek Anaszewski

leds: is31fl319x: 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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarJacek Anaszewski <jacek.anaszewski@gmail.com>
parent 60439711
...@@ -333,12 +333,11 @@ static int is31fl319x_probe(struct i2c_client *client, ...@@ -333,12 +333,11 @@ static int is31fl319x_probe(struct i2c_client *client,
{ {
struct is31fl319x_chip *is31; struct is31fl319x_chip *is31;
struct device *dev = &client->dev; struct device *dev = &client->dev;
struct i2c_adapter *adapter = to_i2c_adapter(dev->parent);
int err; int err;
int i = 0; int i = 0;
u32 aggregated_led_microamp = IS31FL319X_CURRENT_MAX; u32 aggregated_led_microamp = IS31FL319X_CURRENT_MAX;
if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C))
return -EIO; return -EIO;
is31 = devm_kzalloc(&client->dev, sizeof(*is31), GFP_KERNEL); is31 = devm_kzalloc(&client->dev, sizeof(*is31), GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment