iio: light: bh1780: 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: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
3c23e9e808
commit
aa70932992
|
@ -145,7 +145,7 @@ static int bh1780_probe(struct i2c_client *client,
|
|||
{
|
||||
int ret;
|
||||
struct bh1780_data *bh1780;
|
||||
struct i2c_adapter *adapter = to_i2c_adapter(client->dev.parent);
|
||||
struct i2c_adapter *adapter = client->adapter;
|
||||
struct iio_dev *indio_dev;
|
||||
|
||||
if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE))
|
||||
|
|
Loading…
Reference in New Issue