forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/iio/adc/ti-adc108s102.c
....@@ -1,17 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * TI ADC108S102 SPI ADC driver
34 *
45 * Copyright (c) 2013-2015 Intel Corporation.
56 * Copyright (c) 2017 Siemens AG
6
- *
7
- * This program is free software; you can redistribute it and/or modify it
8
- * under the terms and conditions of the GNU General Public License,
9
- * version 2, as published by the Free Software Foundation.
10
- *
11
- * This program is distributed in the hope it will be useful, but WITHOUT
12
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14
- * more details.
157 *
168 * This IIO device driver is designed to work with the following
179 * analog to digital converters from Texas Instruments:
....@@ -28,6 +20,7 @@
2820 #include <linux/iio/trigger_consumer.h>
2921 #include <linux/interrupt.h>
3022 #include <linux/module.h>
23
+#include <linux/mod_devicetable.h>
3124 #include <linux/property.h>
3225 #include <linux/regulator/consumer.h>
3326 #include <linux/spi/spi.h>
....@@ -260,7 +253,6 @@
260253 st->spi = spi;
261254
262255 indio_dev->name = spi->modalias;
263
- indio_dev->dev.parent = &spi->dev;
264256 indio_dev->modes = INDIO_DIRECT_MODE;
265257 indio_dev->channels = adc108s102_channels;
266258 indio_dev->num_channels = ARRAY_SIZE(adc108s102_channels);
....@@ -308,13 +300,11 @@
308300 return 0;
309301 }
310302
311
-#ifdef CONFIG_OF
312303 static const struct of_device_id adc108s102_of_match[] = {
313304 { .compatible = "ti,adc108s102" },
314305 { }
315306 };
316307 MODULE_DEVICE_TABLE(of, adc108s102_of_match);
317
-#endif
318308
319309 #ifdef CONFIG_ACPI
320310 static const struct acpi_device_id adc108s102_acpi_ids[] = {
....@@ -333,7 +323,7 @@
333323 static struct spi_driver adc108s102_driver = {
334324 .driver = {
335325 .name = "adc108s102",
336
- .of_match_table = of_match_ptr(adc108s102_of_match),
326
+ .of_match_table = adc108s102_of_match,
337327 .acpi_match_table = ACPI_PTR(adc108s102_acpi_ids),
338328 },
339329 .probe = adc108s102_probe,