forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/iio/light/veml6070.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * veml6070.c - Support for Vishay VEML6070 UV A light sensor
34 *
45 * Copyright 2016 Peter Meerwald-Stadler <pmeerw@pmeerw.net>
5
- *
6
- * This file is subject to the terms and conditions of version 2 of
7
- * the GNU General Public License. See the file COPYING in the main
8
- * directory of this archive for more details.
96 *
107 * IIO driver for VEML6070 (7-bit I2C slave addresses 0x38 and 0x39)
118 *
....@@ -154,17 +151,16 @@
154151 data->client1 = client;
155152 mutex_init(&data->lock);
156153
157
- indio_dev->dev.parent = &client->dev;
158154 indio_dev->info = &veml6070_info;
159155 indio_dev->channels = veml6070_channels;
160156 indio_dev->num_channels = ARRAY_SIZE(veml6070_channels);
161157 indio_dev->name = VEML6070_DRV_NAME;
162158 indio_dev->modes = INDIO_DIRECT_MODE;
163159
164
- data->client2 = i2c_new_dummy(client->adapter, VEML6070_ADDR_DATA_LSB);
165
- if (!data->client2) {
160
+ data->client2 = i2c_new_dummy_device(client->adapter, VEML6070_ADDR_DATA_LSB);
161
+ if (IS_ERR(data->client2)) {
166162 dev_err(&client->dev, "i2c device for second chip address failed\n");
167
- return -ENODEV;
163
+ return PTR_ERR(data->client2);
168164 }
169165
170166 data->config = VEML6070_IT_10 | VEML6070_COMMAND_RSRVD |