| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Ralink MT7621/MT7628 built-in hardware watchdog timer |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2014 John Crispin <john@phrozen.org> |
|---|
| 5 | 6 | * |
|---|
| 6 | 7 | * This driver was based on: drivers/watchdog/rt2880_wdt.c |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 9 | | - * under the terms of the GNU General Public License version 2 as published |
|---|
| 10 | | - * by the Free Software Foundation. |
|---|
| 11 | 8 | */ |
|---|
| 12 | 9 | |
|---|
| 13 | 10 | #include <linux/clk.h> |
|---|
| .. | .. |
|---|
| 133 | 130 | |
|---|
| 134 | 131 | static int mt7621_wdt_probe(struct platform_device *pdev) |
|---|
| 135 | 132 | { |
|---|
| 136 | | - struct resource *res; |
|---|
| 137 | | - |
|---|
| 138 | | - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
|---|
| 139 | | - mt7621_wdt_base = devm_ioremap_resource(&pdev->dev, res); |
|---|
| 133 | + struct device *dev = &pdev->dev; |
|---|
| 134 | + mt7621_wdt_base = devm_platform_ioremap_resource(pdev, 0); |
|---|
| 140 | 135 | if (IS_ERR(mt7621_wdt_base)) |
|---|
| 141 | 136 | return PTR_ERR(mt7621_wdt_base); |
|---|
| 142 | 137 | |
|---|
| 143 | | - mt7621_wdt_reset = devm_reset_control_get_exclusive(&pdev->dev, NULL); |
|---|
| 138 | + mt7621_wdt_reset = devm_reset_control_get_exclusive(dev, NULL); |
|---|
| 144 | 139 | if (!IS_ERR(mt7621_wdt_reset)) |
|---|
| 145 | 140 | reset_control_deassert(mt7621_wdt_reset); |
|---|
| 146 | 141 | |
|---|
| 147 | 142 | mt7621_wdt_dev.bootstatus = mt7621_wdt_bootcause(); |
|---|
| 148 | 143 | |
|---|
| 149 | 144 | watchdog_init_timeout(&mt7621_wdt_dev, mt7621_wdt_dev.max_timeout, |
|---|
| 150 | | - &pdev->dev); |
|---|
| 145 | + dev); |
|---|
| 151 | 146 | watchdog_set_nowayout(&mt7621_wdt_dev, nowayout); |
|---|
| 152 | 147 | if (mt7621_wdt_is_running(&mt7621_wdt_dev)) { |
|---|
| 153 | 148 | /* |
|---|
| .. | .. |
|---|
| 164 | 159 | set_bit(WDOG_HW_RUNNING, &mt7621_wdt_dev.status); |
|---|
| 165 | 160 | } |
|---|
| 166 | 161 | |
|---|
| 167 | | - return devm_watchdog_register_device(&pdev->dev, &mt7621_wdt_dev); |
|---|
| 162 | + return devm_watchdog_register_device(dev, &mt7621_wdt_dev); |
|---|
| 168 | 163 | } |
|---|
| 169 | 164 | |
|---|
| 170 | 165 | static void mt7621_wdt_shutdown(struct platform_device *pdev) |
|---|