forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/iio/light/lm3533-als.c
....@@ -1,14 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * lm3533-als.c -- LM3533 Ambient Light Sensor driver
34 *
45 * Copyright (C) 2011-2012 Texas Instruments
56 *
67 * Author: Johan Hovold <jhovold@gmail.com>
7
- *
8
- * This program is free software; you can redistribute it and/or modify it
9
- * under the terms of the GNU General Public License as published by the
10
- * Free Software Foundation; either version 2 of the License, or (at your
11
- * option) any later version.
128 */
139
1410 #include <linux/atomic.h>
....@@ -746,7 +742,7 @@
746742 if (val < LM3533_ALS_RESISTOR_MIN || val > LM3533_ALS_RESISTOR_MAX) {
747743 dev_err(&als->pdev->dev, "invalid resistor value\n");
748744 return -EINVAL;
749
- };
745
+ }
750746
751747 ret = lm3533_write(als->lm3533, LM3533_REG_ALS_RESISTOR_SELECT, val);
752748 if (ret) {
....@@ -856,7 +852,7 @@
856852 indio_dev->channels = lm3533_als_channels;
857853 indio_dev->num_channels = ARRAY_SIZE(lm3533_als_channels);
858854 indio_dev->name = dev_name(&pdev->dev);
859
- indio_dev->dev.parent = pdev->dev.parent;
855
+ iio_device_set_parent(indio_dev, pdev->dev.parent);
860856 indio_dev->modes = INDIO_DIRECT_MODE;
861857
862858 als = iio_priv(indio_dev);