| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Watchdog driver for Ricoh RN5T618 PMIC |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * 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/>. |
|---|
| 12 | 6 | */ |
|---|
| 13 | 7 | |
|---|
| 14 | 8 | #include <linux/device.h> |
|---|
| .. | .. |
|---|
| 146 | 140 | |
|---|
| 147 | 141 | static int rn5t618_wdt_probe(struct platform_device *pdev) |
|---|
| 148 | 142 | { |
|---|
| 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); |
|---|
| 150 | 145 | struct rn5t618_wdt *wdt; |
|---|
| 151 | 146 | int min_timeout, max_timeout; |
|---|
| 152 | 147 | |
|---|
| 153 | | - wdt = devm_kzalloc(&pdev->dev, sizeof(struct rn5t618_wdt), GFP_KERNEL); |
|---|
| 148 | + wdt = devm_kzalloc(dev, sizeof(struct rn5t618_wdt), GFP_KERNEL); |
|---|
| 154 | 149 | if (!wdt) |
|---|
| 155 | 150 | return -ENOMEM; |
|---|
| 156 | 151 | |
|---|
| .. | .. |
|---|
| 163 | 158 | wdt->wdt_dev.min_timeout = min_timeout; |
|---|
| 164 | 159 | wdt->wdt_dev.max_timeout = max_timeout; |
|---|
| 165 | 160 | wdt->wdt_dev.timeout = max_timeout; |
|---|
| 166 | | - wdt->wdt_dev.parent = &pdev->dev; |
|---|
| 161 | + wdt->wdt_dev.parent = dev; |
|---|
| 167 | 162 | |
|---|
| 168 | 163 | 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); |
|---|
| 170 | 165 | watchdog_set_nowayout(&wdt->wdt_dev, nowayout); |
|---|
| 171 | 166 | |
|---|
| 172 | 167 | platform_set_drvdata(pdev, wdt); |
|---|