diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2013-05-21 11:49:22 -0400 |
---|---|---|
committer | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2013-06-12 12:36:31 -0400 |
commit | 0ead4fb22a5f1b31fee966117604e3be9cdeb2fb (patch) | |
tree | 7f7cd61ca8f1b918a62dcdc1e32219faff9084cb /drivers/iio | |
parent | 6f39ac4e20c6211c98e8d9da2d8c51100a77d1df (diff) |
iio: ti_am335x_adc: remove platform_data support
This patch removes access to platform data mfd_tscadc_board because the
platform is DT only.
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/adc/ti_am335x_adc.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c index b24402cb5432..2868c0c1b7e0 100644 --- a/drivers/iio/adc/ti_am335x_adc.c +++ b/drivers/iio/adc/ti_am335x_adc.c | |||
@@ -26,7 +26,6 @@ | |||
26 | #include <linux/of_device.h> | 26 | #include <linux/of_device.h> |
27 | 27 | ||
28 | #include <linux/mfd/ti_am335x_tscadc.h> | 28 | #include <linux/mfd/ti_am335x_tscadc.h> |
29 | #include <linux/platform_data/ti_am335x_adc.h> | ||
30 | 29 | ||
31 | struct tiadc_device { | 30 | struct tiadc_device { |
32 | struct ti_tscadc_dev *mfd_tscadc; | 31 | struct ti_tscadc_dev *mfd_tscadc; |
@@ -153,14 +152,12 @@ static int tiadc_probe(struct platform_device *pdev) | |||
153 | { | 152 | { |
154 | struct iio_dev *indio_dev; | 153 | struct iio_dev *indio_dev; |
155 | struct tiadc_device *adc_dev; | 154 | struct tiadc_device *adc_dev; |
156 | struct ti_tscadc_dev *tscadc_dev = ti_tscadc_dev_get(pdev); | ||
157 | struct mfd_tscadc_board *pdata = tscadc_dev->dev->platform_data; | ||
158 | struct device_node *node = pdev->dev.of_node; | 155 | struct device_node *node = pdev->dev.of_node; |
159 | int err; | 156 | int err; |
160 | u32 val32; | 157 | u32 val32; |
161 | 158 | ||
162 | if (!pdata && !node) { | 159 | if (!node) { |
163 | dev_err(&pdev->dev, "Could not find platform data\n"); | 160 | dev_err(&pdev->dev, "Could not find valid DT data.\n"); |
164 | return -EINVAL; | 161 | return -EINVAL; |
165 | } | 162 | } |
166 | 163 | ||
@@ -174,15 +171,11 @@ static int tiadc_probe(struct platform_device *pdev) | |||
174 | 171 | ||
175 | adc_dev->mfd_tscadc = ti_tscadc_dev_get(pdev); | 172 | adc_dev->mfd_tscadc = ti_tscadc_dev_get(pdev); |
176 | 173 | ||
177 | if (pdata) | 174 | err = of_property_read_u32(node, |
178 | adc_dev->channels = pdata->adc_init->adc_channels; | 175 | "ti,adc-channels", &val32); |
179 | else { | 176 | if (err < 0) |
180 | err = of_property_read_u32(node, | 177 | goto err_free_device; |
181 | "ti,adc-channels", &val32); | 178 | adc_dev->channels = val32; |
182 | if (err < 0) | ||
183 | goto err_free_device; | ||
184 | adc_dev->channels = val32; | ||
185 | } | ||
186 | 179 | ||
187 | indio_dev->dev.parent = &pdev->dev; | 180 | indio_dev->dev.parent = &pdev->dev; |
188 | indio_dev->name = dev_name(&pdev->dev); | 181 | indio_dev->name = dev_name(&pdev->dev); |