.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2016 Oleksij Rempel <linux@rempel-privat.de> |
---|
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, |
---|
7 | | - * or (at your option) any later version. |
---|
8 | 4 | */ |
---|
9 | 5 | |
---|
10 | 6 | #include <linux/clk.h> |
---|
.. | .. |
---|
249 | 245 | { |
---|
250 | 246 | struct asm9260_rtc_priv *priv; |
---|
251 | 247 | struct device *dev = &pdev->dev; |
---|
252 | | - struct resource *res; |
---|
253 | 248 | int irq_alarm, ret; |
---|
254 | 249 | u32 ccr; |
---|
255 | 250 | |
---|
.. | .. |
---|
261 | 256 | platform_set_drvdata(pdev, priv); |
---|
262 | 257 | |
---|
263 | 258 | irq_alarm = platform_get_irq(pdev, 0); |
---|
264 | | - if (irq_alarm < 0) { |
---|
265 | | - dev_err(dev, "No alarm IRQ resource defined\n"); |
---|
| 259 | + if (irq_alarm < 0) |
---|
266 | 260 | return irq_alarm; |
---|
267 | | - } |
---|
268 | 261 | |
---|
269 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
---|
270 | | - priv->iobase = devm_ioremap_resource(dev, res); |
---|
| 262 | + priv->iobase = devm_platform_ioremap_resource(pdev, 0); |
---|
271 | 263 | if (IS_ERR(priv->iobase)) |
---|
272 | 264 | return PTR_ERR(priv->iobase); |
---|
273 | 265 | |
---|
274 | 266 | priv->clk = devm_clk_get(dev, "ahb"); |
---|
| 267 | + if (IS_ERR(priv->clk)) |
---|
| 268 | + return PTR_ERR(priv->clk); |
---|
| 269 | + |
---|
275 | 270 | ret = clk_prepare_enable(priv->clk); |
---|
276 | 271 | if (ret) { |
---|
277 | 272 | dev_err(dev, "Failed to enable clk!\n"); |
---|