| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * CLPS711X GPIO driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2012,2013 Alexander Shiyan <shc_work@mail.ru> |
|---|
| 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 as published by |
|---|
| 8 | | - * the Free Software Foundation; either version 2 of the License, or |
|---|
| 9 | | - * (at your option) any later version. |
|---|
| 10 | 6 | */ |
|---|
| 11 | 7 | |
|---|
| 12 | 8 | #include <linux/err.h> |
|---|
| .. | .. |
|---|
| 19 | 15 | struct device_node *np = pdev->dev.of_node; |
|---|
| 20 | 16 | void __iomem *dat, *dir; |
|---|
| 21 | 17 | struct gpio_chip *gc; |
|---|
| 22 | | - struct resource *res; |
|---|
| 23 | 18 | int err, id; |
|---|
| 24 | 19 | |
|---|
| 25 | 20 | if (!np) |
|---|
| .. | .. |
|---|
| 33 | 28 | if (!gc) |
|---|
| 34 | 29 | return -ENOMEM; |
|---|
| 35 | 30 | |
|---|
| 36 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
|---|
| 37 | | - dat = devm_ioremap_resource(&pdev->dev, res); |
|---|
| 31 | + dat = devm_platform_ioremap_resource(pdev, 0); |
|---|
| 38 | 32 | if (IS_ERR(dat)) |
|---|
| 39 | 33 | return PTR_ERR(dat); |
|---|
| 40 | 34 | |
|---|
| 41 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
|---|
| 42 | | - dir = devm_ioremap_resource(&pdev->dev, res); |
|---|
| 35 | + dir = devm_platform_ioremap_resource(pdev, 1); |
|---|
| 43 | 36 | if (IS_ERR(dir)) |
|---|
| 44 | 37 | return PTR_ERR(dir); |
|---|
| 45 | 38 | |
|---|