.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) ST-Ericsson SA 2011-2013 |
---|
3 | | - * |
---|
4 | | - * License Terms: GNU General Public License v2 |
---|
5 | 4 | * |
---|
6 | 5 | * Author: Mathieu Poirier <mathieu.poirier@linaro.org> for ST-Ericsson |
---|
7 | 6 | * Author: Jonas Aaberg <jonas.aberg@stericsson.com> for ST-Ericsson |
---|
.. | .. |
---|
86 | 85 | |
---|
87 | 86 | static int ux500_wdt_probe(struct platform_device *pdev) |
---|
88 | 87 | { |
---|
| 88 | + struct device *dev = &pdev->dev; |
---|
89 | 89 | int ret; |
---|
90 | | - struct ux500_wdt_data *pdata = dev_get_platdata(&pdev->dev); |
---|
| 90 | + struct ux500_wdt_data *pdata = dev_get_platdata(dev); |
---|
91 | 91 | |
---|
92 | 92 | if (pdata) { |
---|
93 | 93 | if (pdata->timeout > 0) |
---|
.. | .. |
---|
96 | 96 | ux500_wdt.max_timeout = WATCHDOG_MAX28; |
---|
97 | 97 | } |
---|
98 | 98 | |
---|
99 | | - ux500_wdt.parent = &pdev->dev; |
---|
| 99 | + ux500_wdt.parent = dev; |
---|
100 | 100 | watchdog_set_nowayout(&ux500_wdt, nowayout); |
---|
101 | 101 | |
---|
102 | 102 | /* disable auto off on sleep */ |
---|
.. | .. |
---|
105 | 105 | /* set HW initial value */ |
---|
106 | 106 | prcmu_load_a9wdog(PRCMU_WDOG_ALL, timeout * 1000); |
---|
107 | 107 | |
---|
108 | | - ret = watchdog_register_device(&ux500_wdt); |
---|
| 108 | + ret = devm_watchdog_register_device(dev, &ux500_wdt); |
---|
109 | 109 | if (ret) |
---|
110 | 110 | return ret; |
---|
111 | 111 | |
---|
112 | | - dev_info(&pdev->dev, "initialized\n"); |
---|
113 | | - |
---|
114 | | - return 0; |
---|
115 | | -} |
---|
116 | | - |
---|
117 | | -static int ux500_wdt_remove(struct platform_device *dev) |
---|
118 | | -{ |
---|
119 | | - watchdog_unregister_device(&ux500_wdt); |
---|
| 112 | + dev_info(dev, "initialized\n"); |
---|
120 | 113 | |
---|
121 | 114 | return 0; |
---|
122 | 115 | } |
---|
.. | .. |
---|
153 | 146 | |
---|
154 | 147 | static struct platform_driver ux500_wdt_driver = { |
---|
155 | 148 | .probe = ux500_wdt_probe, |
---|
156 | | - .remove = ux500_wdt_remove, |
---|
157 | 149 | .suspend = ux500_wdt_suspend, |
---|
158 | 150 | .resume = ux500_wdt_resume, |
---|
159 | 151 | .driver = { |
---|