forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/drivers/iio/adc/twl6030-gpadc.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * TWL6030 GPADC module driver
34 *
....@@ -12,21 +13,6 @@
1213 * Based on twl4030-madc.c
1314 * Copyright (C) 2008 Nokia Corporation
1415 * Mikko Ylinen <mikko.k.ylinen@nokia.com>
15
- *
16
- * This program is free software; you can redistribute it and/or
17
- * modify it under the terms of the GNU General Public License
18
- * version 2 as published by the Free Software Foundation.
19
- *
20
- * This program is distributed in the hope that it will be useful, but
21
- * WITHOUT ANY WARRANTY; without even the implied warranty of
22
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23
- * General Public License for more details.
24
- *
25
- * You should have received a copy of the GNU General Public License
26
- * along with this program; if not, write to the Free Software
27
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
28
- * 02110-1301 USA
29
- *
3016 */
3117 #include <linux/interrupt.h>
3218 #include <linux/kernel.h>
....@@ -108,9 +94,9 @@
10894 * struct twl6030_gpadc_platform_data - platform specific data
10995 * @nchannels: number of GPADC channels
11096 * @iio_channels: iio channels
111
- * @twl6030_ideal: pointer to calibration parameters
97
+ * @ideal: pointer to calibration parameters
11298 * @start_conversion: pointer to ADC start conversion function
113
- * @channel_to_reg pointer to ADC function to convert channel to
99
+ * @channel_to_reg: pointer to ADC function to convert channel to
114100 * register address for reading conversion result
115101 * @calibrate: pointer to calibration function
116102 */
....@@ -919,14 +905,14 @@
919905 }
920906
921907 irq = platform_get_irq(pdev, 0);
922
- if (irq < 0) {
923
- dev_err(&pdev->dev, "failed to get irq\n");
908
+ if (irq < 0)
924909 return irq;
925
- }
926910
927911 ret = devm_request_threaded_irq(dev, irq, NULL,
928912 twl6030_gpadc_irq_handler,
929913 IRQF_ONESHOT, "twl6030_gpadc", indio_dev);
914
+ if (ret)
915
+ return ret;
930916
931917 ret = twl6030_gpadc_enable_irq(TWL6030_GPADC_RT_SW1_EOC_MASK);
932918 if (ret < 0) {
....@@ -942,7 +928,6 @@
942928 }
943929
944930 indio_dev->name = DRIVER_NAME;
945
- indio_dev->dev.parent = dev;
946931 indio_dev->info = &twl6030_gpadc_iio_info;
947932 indio_dev->modes = INDIO_DIRECT_MODE;
948933 indio_dev->channels = pdata->iio_channels;