forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/drivers/iio/pressure/hp03.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (c) 2016 Marek Vasut <marex@denx.de>
34 *
45 * 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.
96 */
107
118 #define pr_fmt(fmt) "hp03: " fmt
....@@ -227,7 +224,6 @@
227224 priv->client = client;
228225 mutex_init(&priv->lock);
229226
230
- indio_dev->dev.parent = dev;
231227 indio_dev->name = id->name;
232228 indio_dev->channels = hp03_channels;
233229 indio_dev->num_channels = ARRAY_SIZE(hp03_channels);
....@@ -246,10 +242,10 @@
246242 * which has it's dedicated I2C address and contains
247243 * the calibration constants for the sensor.
248244 */
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)) {
251247 dev_err(dev, "New EEPROM I2C device failed\n");
252
- return -ENODEV;
248
+ return PTR_ERR(priv->eeprom_client);
253249 }
254250
255251 priv->eeprom_regmap = regmap_init_i2c(priv->eeprom_client,