forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/iio/adc/ina2xx-adc.c
....@@ -255,6 +255,7 @@
255255 *val2 = chip->shunt_resistor_uohm;
256256 return IIO_VAL_FRACTIONAL;
257257 }
258
+ return -EINVAL;
258259
259260 case IIO_CHAN_INFO_HARDWAREGAIN:
260261 switch (chan->address) {
....@@ -267,6 +268,7 @@
267268 *val = chip->range_vbus == 32 ? 1 : 2;
268269 return IIO_VAL_INT;
269270 }
271
+ return -EINVAL;
270272 }
271273
272274 return -EINVAL;
....@@ -276,7 +278,7 @@
276278 * Available averaging rates for ina226. The indices correspond with
277279 * the bit values expected by the chip (according to the ina226 datasheet,
278280 * table 3 AVG bit settings, found at
279
- * http://www.ti.com/lit/ds/symlink/ina226.pdf.
281
+ * https://www.ti.com/lit/ds/symlink/ina226.pdf.
280282 */
281283 static const int ina226_avg_tab[] = { 1, 4, 16, 64, 128, 256, 512, 1024 };
282284
....@@ -1016,8 +1018,6 @@
10161018 }
10171019
10181020 indio_dev->modes = INDIO_DIRECT_MODE | INDIO_BUFFER_SOFTWARE;
1019
- indio_dev->dev.parent = &client->dev;
1020
- indio_dev->dev.of_node = client->dev.of_node;
10211021 if (id->driver_data == ina226) {
10221022 indio_dev->channels = ina226_channels;
10231023 indio_dev->num_channels = ARRAY_SIZE(ina226_channels);