| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Freescale MXS LRADC touchscreen driver |
|---|
| 3 | 4 | * |
|---|
| .. | .. |
|---|
| 7 | 8 | * Authors: |
|---|
| 8 | 9 | * Marek Vasut <marex@denx.de> |
|---|
| 9 | 10 | * Ksenija Stanojevic <ksenija.stanojevic@gmail.com> |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 12 | | - * it under the terms of the GNU General Public License as published by |
|---|
| 13 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 14 | | - * (at your option) any later version. |
|---|
| 15 | | - * |
|---|
| 16 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 17 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 18 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 19 | | - * GNU General Public License for more details. |
|---|
| 20 | 11 | */ |
|---|
| 21 | 12 | |
|---|
| 22 | 13 | #include <linux/device.h> |
|---|
| .. | .. |
|---|
| 615 | 606 | struct device_node *node = dev->parent->of_node; |
|---|
| 616 | 607 | struct mxs_lradc *lradc = dev_get_drvdata(dev->parent); |
|---|
| 617 | 608 | struct mxs_lradc_ts *ts; |
|---|
| 618 | | - struct resource *iores; |
|---|
| 619 | 609 | int ret, irq, virq, i; |
|---|
| 620 | 610 | u32 ts_wires = 0, adapt; |
|---|
| 621 | 611 | |
|---|
| .. | .. |
|---|
| 629 | 619 | ts->dev = dev; |
|---|
| 630 | 620 | spin_lock_init(&ts->lock); |
|---|
| 631 | 621 | |
|---|
| 632 | | - iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
|---|
| 633 | | - if (!iores) |
|---|
| 634 | | - return -EINVAL; |
|---|
| 635 | | - ts->base = devm_ioremap(dev, iores->start, resource_size(iores)); |
|---|
| 636 | | - if (!ts->base) |
|---|
| 637 | | - return -ENOMEM; |
|---|
| 622 | + ts->base = devm_platform_ioremap_resource(pdev, 0); |
|---|
| 623 | + if (IS_ERR(ts->base)) |
|---|
| 624 | + return PTR_ERR(ts->base); |
|---|
| 638 | 625 | |
|---|
| 639 | 626 | ret = of_property_read_u32(node, "fsl,lradc-touchscreen-wires", |
|---|
| 640 | 627 | &ts_wires); |
|---|