forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/iio/adc/ti-adc0832.c
....@@ -1,16 +1,14 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * ADC0831/ADC0832/ADC0834/ADC0838 8-bit ADC driver
34 *
45 * Copyright (c) 2016 Akinobu Mita <akinobu.mita@gmail.com>
56 *
6
- * This file is subject to the terms and conditions of version 2 of
7
- * the GNU General Public License. See the file COPYING in the main
8
- * directory of this archive for more details.
9
- *
10
- * Datasheet: http://www.ti.com/lit/ds/symlink/adc0832-n.pdf
7
+ * Datasheet: https://www.ti.com/lit/ds/symlink/adc0832-n.pdf
118 */
129
1310 #include <linux/module.h>
11
+#include <linux/mod_devicetable.h>
1412 #include <linux/spi/spi.h>
1513 #include <linux/iio/iio.h>
1614 #include <linux/regulator/consumer.h>
....@@ -253,8 +251,6 @@
253251 mutex_init(&adc->lock);
254252
255253 indio_dev->name = spi_get_device_id(spi)->name;
256
- indio_dev->dev.parent = &spi->dev;
257
- indio_dev->dev.of_node = spi->dev.of_node;
258254 indio_dev->info = &adc0832_info;
259255 indio_dev->modes = INDIO_DIRECT_MODE;
260256
....@@ -323,8 +319,6 @@
323319 return 0;
324320 }
325321
326
-#ifdef CONFIG_OF
327
-
328322 static const struct of_device_id adc0832_dt_ids[] = {
329323 { .compatible = "ti,adc0831", },
330324 { .compatible = "ti,adc0832", },
....@@ -333,8 +327,6 @@
333327 {}
334328 };
335329 MODULE_DEVICE_TABLE(of, adc0832_dt_ids);
336
-
337
-#endif
338330
339331 static const struct spi_device_id adc0832_id[] = {
340332 { "adc0831", adc0831 },
....@@ -348,7 +340,7 @@
348340 static struct spi_driver adc0832_driver = {
349341 .driver = {
350342 .name = "adc0832",
351
- .of_match_table = of_match_ptr(adc0832_dt_ids),
343
+ .of_match_table = adc0832_dt_ids,
352344 },
353345 .probe = adc0832_probe,
354346 .remove = adc0832_remove,