forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/iio/dac/lpc18xx_dac.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * IIO DAC driver for NXP LPC18xx DAC
34 *
45 * Copyright (C) 2016 Joachim Eastwood <manabian@gmail.com>
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 as
8
- * published by the Free Software Foundation.
96 *
107 * UNSUPPORTED hardware features:
118 * - Interrupts
....@@ -109,7 +106,6 @@
109106 {
110107 struct iio_dev *indio_dev;
111108 struct lpc18xx_dac *dac;
112
- struct resource *res;
113109 int ret;
114110
115111 indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*dac));
....@@ -120,8 +116,7 @@
120116 dac = iio_priv(indio_dev);
121117 mutex_init(&dac->lock);
122118
123
- res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
124
- dac->base = devm_ioremap_resource(&pdev->dev, res);
119
+ dac->base = devm_platform_ioremap_resource(pdev, 0);
125120 if (IS_ERR(dac->base))
126121 return PTR_ERR(dac->base);
127122
....@@ -138,7 +133,6 @@
138133 }
139134
140135 indio_dev->name = dev_name(&pdev->dev);
141
- indio_dev->dev.parent = &pdev->dev;
142136 indio_dev->info = &lpc18xx_dac_info;
143137 indio_dev->modes = INDIO_DIRECT_MODE;
144138 indio_dev->channels = lpc18xx_dac_iio_channels;