hc
2024-05-14 bedbef8ad3e75a304af6361af235302bcc61d06b
kernel/drivers/watchdog/rn5t618_wdt.c
....@@ -1,14 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Watchdog driver for Ricoh RN5T618 PMIC
34 *
45 * Copyright (C) 2014 Beniamino Galvani <b.galvani@gmail.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
8
- * version 2 as published by the Free Software Foundation.
9
- *
10
- * You should have received a copy of the GNU General Public License
11
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
126 */
137
148 #include <linux/device.h>
....@@ -146,11 +140,12 @@
146140
147141 static int rn5t618_wdt_probe(struct platform_device *pdev)
148142 {
149
- struct rn5t618 *rn5t618 = dev_get_drvdata(pdev->dev.parent);
143
+ struct device *dev = &pdev->dev;
144
+ struct rn5t618 *rn5t618 = dev_get_drvdata(dev->parent);
150145 struct rn5t618_wdt *wdt;
151146 int min_timeout, max_timeout;
152147
153
- wdt = devm_kzalloc(&pdev->dev, sizeof(struct rn5t618_wdt), GFP_KERNEL);
148
+ wdt = devm_kzalloc(dev, sizeof(struct rn5t618_wdt), GFP_KERNEL);
154149 if (!wdt)
155150 return -ENOMEM;
156151
....@@ -163,10 +158,10 @@
163158 wdt->wdt_dev.min_timeout = min_timeout;
164159 wdt->wdt_dev.max_timeout = max_timeout;
165160 wdt->wdt_dev.timeout = max_timeout;
166
- wdt->wdt_dev.parent = &pdev->dev;
161
+ wdt->wdt_dev.parent = dev;
167162
168163 watchdog_set_drvdata(&wdt->wdt_dev, wdt);
169
- watchdog_init_timeout(&wdt->wdt_dev, timeout, &pdev->dev);
164
+ watchdog_init_timeout(&wdt->wdt_dev, timeout, dev);
170165 watchdog_set_nowayout(&wdt->wdt_dev, nowayout);
171166
172167 platform_set_drvdata(pdev, wdt);