| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * veml6070.c - Support for Vishay VEML6070 UV A light sensor |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * 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. |
|---|
| 9 | 6 | * |
|---|
| 10 | 7 | * IIO driver for VEML6070 (7-bit I2C slave addresses 0x38 and 0x39) |
|---|
| 11 | 8 | * |
|---|
| .. | .. |
|---|
| 154 | 151 | data->client1 = client; |
|---|
| 155 | 152 | mutex_init(&data->lock); |
|---|
| 156 | 153 | |
|---|
| 157 | | - indio_dev->dev.parent = &client->dev; |
|---|
| 158 | 154 | indio_dev->info = &veml6070_info; |
|---|
| 159 | 155 | indio_dev->channels = veml6070_channels; |
|---|
| 160 | 156 | indio_dev->num_channels = ARRAY_SIZE(veml6070_channels); |
|---|
| 161 | 157 | indio_dev->name = VEML6070_DRV_NAME; |
|---|
| 162 | 158 | indio_dev->modes = INDIO_DIRECT_MODE; |
|---|
| 163 | 159 | |
|---|
| 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)) { |
|---|
| 166 | 162 | dev_err(&client->dev, "i2c device for second chip address failed\n"); |
|---|
| 167 | | - return -ENODEV; |
|---|
| 163 | + return PTR_ERR(data->client2); |
|---|
| 168 | 164 | } |
|---|
| 169 | 165 | |
|---|
| 170 | 166 | data->config = VEML6070_IT_10 | VEML6070_COMMAND_RSRVD | |
|---|