| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * ST SPEAr ADC driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright 2012 Stefan Roese <sr@denx.de> |
|---|
| 5 | | - * |
|---|
| 6 | | - * Licensed under the GPL-2. |
|---|
| 7 | 6 | */ |
|---|
| 8 | 7 | |
|---|
| 9 | 8 | #include <linux/module.h> |
|---|
| .. | .. |
|---|
| 261 | 260 | struct device_node *np = pdev->dev.of_node; |
|---|
| 262 | 261 | struct device *dev = &pdev->dev; |
|---|
| 263 | 262 | struct spear_adc_state *st; |
|---|
| 264 | | - struct resource *res; |
|---|
| 265 | 263 | struct iio_dev *indio_dev = NULL; |
|---|
| 266 | 264 | int ret = -ENODEV; |
|---|
| 267 | 265 | int irq; |
|---|
| .. | .. |
|---|
| 280 | 278 | * (e.g. SPEAr3xx). Let's provide two register base addresses |
|---|
| 281 | 279 | * to support multi-arch kernels. |
|---|
| 282 | 280 | */ |
|---|
| 283 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
|---|
| 284 | | - st->adc_base_spear6xx = devm_ioremap_resource(&pdev->dev, res); |
|---|
| 281 | + st->adc_base_spear6xx = devm_platform_ioremap_resource(pdev, 0); |
|---|
| 285 | 282 | if (IS_ERR(st->adc_base_spear6xx)) |
|---|
| 286 | 283 | return PTR_ERR(st->adc_base_spear6xx); |
|---|
| 287 | 284 | |
|---|
| .. | .. |
|---|
| 302 | 299 | |
|---|
| 303 | 300 | irq = platform_get_irq(pdev, 0); |
|---|
| 304 | 301 | if (irq <= 0) { |
|---|
| 305 | | - dev_err(dev, "failed getting interrupt resource\n"); |
|---|
| 306 | 302 | ret = -EINVAL; |
|---|
| 307 | 303 | goto errout2; |
|---|
| 308 | 304 | } |
|---|
| .. | .. |
|---|
| 340 | 336 | init_completion(&st->completion); |
|---|
| 341 | 337 | |
|---|
| 342 | 338 | indio_dev->name = SPEAR_ADC_MOD_NAME; |
|---|
| 343 | | - indio_dev->dev.parent = dev; |
|---|
| 344 | 339 | indio_dev->info = &spear_adc_info; |
|---|
| 345 | 340 | indio_dev->modes = INDIO_DIRECT_MODE; |
|---|
| 346 | 341 | indio_dev->channels = spear_adc_iio_channels; |
|---|