mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 09:31:14 +00:00
watchdog: mpc8xxx: use dev_xxxx() instead of pr_xxxx()
mpc8xxx watchdog driver is a platform device drivers, it is therefore possible to use dev_xxx() messaging rather than pr_xxx() Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
This commit is contained in:
parent
c99d9df1d3
commit
79b10e09bb
1 changed files with 12 additions and 12 deletions
|
@ -17,8 +17,6 @@
|
||||||
* option) any later version.
|
* option) any later version.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
|
||||||
|
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
|
@ -137,26 +135,27 @@ static int mpc8xxx_wdt_probe(struct platform_device *ofdev)
|
||||||
struct mpc8xxx_wdt_ddata *ddata;
|
struct mpc8xxx_wdt_ddata *ddata;
|
||||||
u32 freq = fsl_get_sys_freq();
|
u32 freq = fsl_get_sys_freq();
|
||||||
bool enabled;
|
bool enabled;
|
||||||
|
struct device *dev = &ofdev->dev;
|
||||||
|
|
||||||
wdt_type = of_device_get_match_data(&ofdev->dev);
|
wdt_type = of_device_get_match_data(dev);
|
||||||
if (!wdt_type)
|
if (!wdt_type)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (!freq || freq == -1)
|
if (!freq || freq == -1)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
ddata = devm_kzalloc(&ofdev->dev, sizeof(*ddata), GFP_KERNEL);
|
ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL);
|
||||||
if (!ddata)
|
if (!ddata)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
|
||||||
ddata->base = devm_ioremap_resource(&ofdev->dev, res);
|
ddata->base = devm_ioremap_resource(dev, res);
|
||||||
if (IS_ERR(ddata->base))
|
if (IS_ERR(ddata->base))
|
||||||
return PTR_ERR(ddata->base);
|
return PTR_ERR(ddata->base);
|
||||||
|
|
||||||
enabled = in_be32(&ddata->base->swcrr) & SWCRR_SWEN;
|
enabled = in_be32(&ddata->base->swcrr) & SWCRR_SWEN;
|
||||||
if (!enabled && wdt_type->hw_enabled) {
|
if (!enabled && wdt_type->hw_enabled) {
|
||||||
pr_info("could not be enabled in software\n");
|
dev_info(dev, "could not be enabled in software\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,7 +165,7 @@ static int mpc8xxx_wdt_probe(struct platform_device *ofdev)
|
||||||
ddata->wdd.ops = &mpc8xxx_wdt_ops,
|
ddata->wdd.ops = &mpc8xxx_wdt_ops,
|
||||||
|
|
||||||
ddata->wdd.timeout = WATCHDOG_TIMEOUT;
|
ddata->wdd.timeout = WATCHDOG_TIMEOUT;
|
||||||
watchdog_init_timeout(&ddata->wdd, timeout, &ofdev->dev);
|
watchdog_init_timeout(&ddata->wdd, timeout, dev);
|
||||||
|
|
||||||
watchdog_set_nowayout(&ddata->wdd, nowayout);
|
watchdog_set_nowayout(&ddata->wdd, nowayout);
|
||||||
|
|
||||||
|
@ -189,11 +188,12 @@ static int mpc8xxx_wdt_probe(struct platform_device *ofdev)
|
||||||
|
|
||||||
ret = watchdog_register_device(&ddata->wdd);
|
ret = watchdog_register_device(&ddata->wdd);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
pr_err("cannot register watchdog device (err=%d)\n", ret);
|
dev_err(dev, "cannot register watchdog device (err=%d)\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
pr_info("WDT driver for MPC8xxx initialized. mode:%s timeout=%d sec\n",
|
dev_info(dev,
|
||||||
|
"WDT driver for MPC8xxx initialized. mode:%s timeout=%d sec\n",
|
||||||
reset ? "reset" : "interrupt", ddata->wdd.timeout);
|
reset ? "reset" : "interrupt", ddata->wdd.timeout);
|
||||||
|
|
||||||
platform_set_drvdata(ofdev, ddata);
|
platform_set_drvdata(ofdev, ddata);
|
||||||
|
@ -204,7 +204,7 @@ static int mpc8xxx_wdt_remove(struct platform_device *ofdev)
|
||||||
{
|
{
|
||||||
struct mpc8xxx_wdt_ddata *ddata = platform_get_drvdata(ofdev);
|
struct mpc8xxx_wdt_ddata *ddata = platform_get_drvdata(ofdev);
|
||||||
|
|
||||||
pr_crit("Watchdog removed, expect the %s soon!\n",
|
dev_crit(&ofdev->dev, "Watchdog removed, expect the %s soon!\n",
|
||||||
reset ? "reset" : "machine check exception");
|
reset ? "reset" : "machine check exception");
|
||||||
watchdog_unregister_device(&ddata->wdd);
|
watchdog_unregister_device(&ddata->wdd);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue