diff options
author | Javier Carrasco <javier.carrasco.cruz@gmail.com> | 2024-09-29 22:38:52 +0200 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2024-10-05 12:09:15 +0100 |
commit | fc04cc73c5964cc9ea55f9ebb99e935fc2878b5e (patch) | |
tree | e60f1cb37e83b6f733dbcf4ca0a116b604f736c3 | |
parent | 8a49c373218261258169d422a325e65cb6f57d8b (diff) |
iio: light: veml6070: use dev_err_probe in probe function
Drop the common 'dev_err() + return' combination in the probe function
and use 'return dev_err_probe()' instead.
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://patch.msgid.link/20240929-veml6070-cleanup-v1-7-a9350341a646@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
-rw-r--r-- | drivers/iio/light/veml6070.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/iio/light/veml6070.c b/drivers/iio/light/veml6070.c index 46eafaa9053d..898e285322d4 100644 --- a/drivers/iio/light/veml6070.c +++ b/drivers/iio/light/veml6070.c @@ -168,10 +168,9 @@ static int veml6070_probe(struct i2c_client *client) return ret; data->client2 = i2c_new_dummy_device(client->adapter, VEML6070_ADDR_DATA_LSB); - if (IS_ERR(data->client2)) { - dev_err(&client->dev, "i2c device for second chip address failed\n"); - return PTR_ERR(data->client2); - } + if (IS_ERR(data->client2)) + return dev_err_probe(&client->dev, PTR_ERR(data->client2), + "i2c device for second chip address failed\n"); data->config = VEML6070_IT_10 | VEML6070_COMMAND_RSRVD | VEML6070_COMMAND_SD; |