| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Driver for MediaTek SoC based RTC |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2017 Sean Wang <sean.wang@mediatek.com> |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or |
|---|
| 7 | | - * modify it under the terms of the GNU General Public License as |
|---|
| 8 | | - * published by the Free Software Foundation; either version 2 of |
|---|
| 9 | | - * the License, or (at your option) any later version. |
|---|
| 10 | | - * |
|---|
| 11 | | - * This program is distributed in the hope that it will be useful, |
|---|
| 12 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 14 | | - * GNU General Public License for more details. |
|---|
| 15 | 6 | */ |
|---|
| 16 | 7 | |
|---|
| 17 | 8 | #include <linux/clk.h> |
|---|
| .. | .. |
|---|
| 312 | 303 | static int mtk_rtc_probe(struct platform_device *pdev) |
|---|
| 313 | 304 | { |
|---|
| 314 | 305 | struct mtk_rtc *hw; |
|---|
| 315 | | - struct resource *res; |
|---|
| 316 | 306 | int ret; |
|---|
| 317 | 307 | |
|---|
| 318 | 308 | hw = devm_kzalloc(&pdev->dev, sizeof(*hw), GFP_KERNEL); |
|---|
| .. | .. |
|---|
| 321 | 311 | |
|---|
| 322 | 312 | platform_set_drvdata(pdev, hw); |
|---|
| 323 | 313 | |
|---|
| 324 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
|---|
| 325 | | - hw->base = devm_ioremap_resource(&pdev->dev, res); |
|---|
| 314 | + hw->base = devm_platform_ioremap_resource(pdev, 0); |
|---|
| 326 | 315 | if (IS_ERR(hw->base)) |
|---|
| 327 | 316 | return PTR_ERR(hw->base); |
|---|
| 328 | 317 | |
|---|
| .. | .. |
|---|
| 338 | 327 | |
|---|
| 339 | 328 | hw->irq = platform_get_irq(pdev, 0); |
|---|
| 340 | 329 | if (hw->irq < 0) { |
|---|
| 341 | | - dev_err(&pdev->dev, "No IRQ resource\n"); |
|---|
| 342 | 330 | ret = hw->irq; |
|---|
| 343 | 331 | goto err; |
|---|
| 344 | 332 | } |
|---|