Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>

authored by

Wolfram Sang and committed by
Jacek Anaszewski
7d9d60bd 60439711

+1 -2
+1 -2
drivers/leds/leds-is31fl319x.c
··· 333 333 { 334 334 struct is31fl319x_chip *is31; 335 335 struct device *dev = &client->dev; 336 - struct i2c_adapter *adapter = to_i2c_adapter(dev->parent); 337 336 int err; 338 337 int i = 0; 339 338 u32 aggregated_led_microamp = IS31FL319X_CURRENT_MAX; 340 339 341 - if (!i2c_check_functionality(adapter, I2C_FUNC_I2C)) 340 + if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) 342 341 return -EIO; 343 342 344 343 is31 = devm_kzalloc(&client->dev, sizeof(*is31), GFP_KERNEL);