hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/iio/adc/sun4i-gpadc-iio.c
....@@ -1,10 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /* ADC driver for sunxi platforms' (A10, A13 and A31) GPADC
23 *
34 * Copyright (c) 2016 Quentin Schulz <quentin.schulz@free-electrons.com>
4
- *
5
- * This program is free software; you can redistribute it and/or modify it under
6
- * the terms of the GNU General Public License version 2 as published by the
7
- * Free Software Foundation.
85 *
96 * The Allwinner SoCs all have an ADC that can also act as a touchscreen
107 * controller and a thermal sensor.
....@@ -463,10 +460,8 @@
463460 atomic_set(atomic, 1);
464461
465462 ret = platform_get_irq_byname(pdev, name);
466
- if (ret < 0) {
467
- dev_err(&pdev->dev, "no %s interrupt registered\n", name);
463
+ if (ret < 0)
468464 return ret;
469
- }
470465
471466 ret = regmap_irq_get_virq(mfd_dev->regmap_irqc, ret);
472467 if (ret < 0) {
....@@ -501,7 +496,6 @@
501496 struct iio_dev *indio_dev)
502497 {
503498 struct sun4i_gpadc_iio *info = iio_priv(indio_dev);
504
- struct resource *mem;
505499 void __iomem *base;
506500 int ret;
507501
....@@ -513,8 +507,7 @@
513507 indio_dev->num_channels = ARRAY_SIZE(sun8i_a33_gpadc_channels);
514508 indio_dev->channels = sun8i_a33_gpadc_channels;
515509
516
- mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
517
- base = devm_ioremap_resource(&pdev->dev, mem);
510
+ base = devm_platform_ioremap_resource(pdev, 0);
518511 if (IS_ERR(base))
519512 return PTR_ERR(base);
520513
....@@ -626,8 +619,6 @@
626619 info->indio_dev = indio_dev;
627620 init_completion(&info->completion);
628621 indio_dev->name = dev_name(&pdev->dev);
629
- indio_dev->dev.parent = &pdev->dev;
630
- indio_dev->dev.of_node = pdev->dev.of_node;
631622 indio_dev->info = &sun4i_gpadc_iio_info;
632623 indio_dev->modes = INDIO_DIRECT_MODE;
633624