| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2015 Mans Rullgard <mans@mansr.com> |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 5 | | - * under the terms of the GNU General Public License as published by the |
|---|
| 6 | | - * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 7 | | - * option) any later version. |
|---|
| 8 | 4 | */ |
|---|
| 9 | 5 | |
|---|
| 10 | 6 | #include <linux/input.h> |
|---|
| .. | .. |
|---|
| 161 | 157 | struct device *dev = &pdev->dev; |
|---|
| 162 | 158 | struct rc_dev *rc; |
|---|
| 163 | 159 | struct tango_ir *ir; |
|---|
| 164 | | - struct resource *rc5_res; |
|---|
| 165 | | - struct resource *rc6_res; |
|---|
| 166 | 160 | u64 clkrate, clkdiv; |
|---|
| 167 | 161 | int irq, err; |
|---|
| 168 | 162 | u32 val; |
|---|
| 169 | | - |
|---|
| 170 | | - rc5_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
|---|
| 171 | | - if (!rc5_res) |
|---|
| 172 | | - return -EINVAL; |
|---|
| 173 | | - |
|---|
| 174 | | - rc6_res = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
|---|
| 175 | | - if (!rc6_res) |
|---|
| 176 | | - return -EINVAL; |
|---|
| 177 | 163 | |
|---|
| 178 | 164 | irq = platform_get_irq(pdev, 0); |
|---|
| 179 | 165 | if (irq <= 0) |
|---|
| .. | .. |
|---|
| 183 | 169 | if (!ir) |
|---|
| 184 | 170 | return -ENOMEM; |
|---|
| 185 | 171 | |
|---|
| 186 | | - ir->rc5_base = devm_ioremap_resource(dev, rc5_res); |
|---|
| 172 | + ir->rc5_base = devm_platform_ioremap_resource(pdev, 0); |
|---|
| 187 | 173 | if (IS_ERR(ir->rc5_base)) |
|---|
| 188 | 174 | return PTR_ERR(ir->rc5_base); |
|---|
| 189 | 175 | |
|---|
| 190 | | - ir->rc6_base = devm_ioremap_resource(dev, rc6_res); |
|---|
| 176 | + ir->rc6_base = devm_platform_ioremap_resource(pdev, 1); |
|---|
| 191 | 177 | if (IS_ERR(ir->rc6_base)) |
|---|
| 192 | 178 | return PTR_ERR(ir->rc6_base); |
|---|
| 193 | 179 | |
|---|