.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (c) 2016 Marek Vasut <marex@denx.de> |
---|
3 | 4 | * |
---|
4 | 5 | * Driver for Hope RF HP03 digital temperature and pressure sensor. |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or modify |
---|
7 | | - * it under the terms of the GNU General Public License version 2 as |
---|
8 | | - * published by the Free Software Foundation. |
---|
9 | 6 | */ |
---|
10 | 7 | |
---|
11 | 8 | #define pr_fmt(fmt) "hp03: " fmt |
---|
.. | .. |
---|
227 | 224 | priv->client = client; |
---|
228 | 225 | mutex_init(&priv->lock); |
---|
229 | 226 | |
---|
230 | | - indio_dev->dev.parent = dev; |
---|
231 | 227 | indio_dev->name = id->name; |
---|
232 | 228 | indio_dev->channels = hp03_channels; |
---|
233 | 229 | indio_dev->num_channels = ARRAY_SIZE(hp03_channels); |
---|
.. | .. |
---|
246 | 242 | * which has it's dedicated I2C address and contains |
---|
247 | 243 | * the calibration constants for the sensor. |
---|
248 | 244 | */ |
---|
249 | | - priv->eeprom_client = i2c_new_dummy(client->adapter, HP03_EEPROM_ADDR); |
---|
250 | | - if (!priv->eeprom_client) { |
---|
| 245 | + priv->eeprom_client = i2c_new_dummy_device(client->adapter, HP03_EEPROM_ADDR); |
---|
| 246 | + if (IS_ERR(priv->eeprom_client)) { |
---|
251 | 247 | dev_err(dev, "New EEPROM I2C device failed\n"); |
---|
252 | | - return -ENODEV; |
---|
| 248 | + return PTR_ERR(priv->eeprom_client); |
---|
253 | 249 | } |
---|
254 | 250 | |
---|
255 | 251 | priv->eeprom_regmap = regmap_init_i2c(priv->eeprom_client, |
---|