.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Watchdog driver for Faraday Technology FTWDT010 |
---|
3 | 4 | * |
---|
.. | .. |
---|
5 | 6 | * |
---|
6 | 7 | * Inspired by the out-of-tree drivers from OpenWRT: |
---|
7 | 8 | * Copyright (C) 2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> |
---|
8 | | - * |
---|
9 | | - * This program is free software; you can redistribute it and/or modify |
---|
10 | | - * it under the terms of the GNU General Public License version 2 as |
---|
11 | | - * published by the Free Software Foundation. |
---|
12 | 9 | */ |
---|
13 | 10 | |
---|
14 | 11 | #include <linux/bitops.h> |
---|
.. | .. |
---|
124 | 121 | static int ftwdt010_wdt_probe(struct platform_device *pdev) |
---|
125 | 122 | { |
---|
126 | 123 | struct device *dev = &pdev->dev; |
---|
127 | | - struct resource *res; |
---|
128 | 124 | struct ftwdt010_wdt *gwdt; |
---|
129 | 125 | unsigned int reg; |
---|
130 | 126 | int irq; |
---|
.. | .. |
---|
134 | 130 | if (!gwdt) |
---|
135 | 131 | return -ENOMEM; |
---|
136 | 132 | |
---|
137 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
---|
138 | | - gwdt->base = devm_ioremap_resource(dev, res); |
---|
| 133 | + gwdt->base = devm_platform_ioremap_resource(pdev, 0); |
---|
139 | 134 | if (IS_ERR(gwdt->base)) |
---|
140 | 135 | return PTR_ERR(gwdt->base); |
---|
141 | 136 | |
---|
.. | .. |
---|
170 | 165 | } |
---|
171 | 166 | |
---|
172 | 167 | ret = devm_watchdog_register_device(dev, &gwdt->wdd); |
---|
173 | | - if (ret) { |
---|
174 | | - dev_err(&pdev->dev, "failed to register watchdog\n"); |
---|
| 168 | + if (ret) |
---|
175 | 169 | return ret; |
---|
176 | | - } |
---|
177 | 170 | |
---|
178 | 171 | /* Set up platform driver data */ |
---|
179 | 172 | platform_set_drvdata(pdev, gwdt); |
---|