From patchwork Mon Sep 17 06:22:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Leroy X-Patchwork-Id: 970399 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42DGLV2Fp2z9sCv for ; Mon, 17 Sep 2018 16:24:34 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=c-s.fr Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 42DGLV0s9YzF12d for ; Mon, 17 Sep 2018 16:24:34 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=c-s.fr X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=c-s.fr (client-ip=93.17.236.30; helo=pegase1.c-s.fr; envelope-from=christophe.leroy@c-s.fr; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=c-s.fr Received: from pegase1.c-s.fr (pegase1.c-s.fr [93.17.236.30]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 42DGJc6KM2zF12b for ; Mon, 17 Sep 2018 16:22:56 +1000 (AEST) Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 42DGJL6t1hz9ttBx; Mon, 17 Sep 2018 08:22:42 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id KXj_rKAEV1f5; Mon, 17 Sep 2018 08:22:42 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 42DGJL6Mf8z9ttBw; Mon, 17 Sep 2018 08:22:42 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id D642C8B787; Mon, 17 Sep 2018 08:22:51 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id UbgNyy-paiAB; Mon, 17 Sep 2018 08:22:51 +0200 (CEST) Received: from pc16082vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.3]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 8CBEF8B786; Mon, 17 Sep 2018 08:22:51 +0200 (CEST) Received: by pc16082vm.idsi0.si.c-s.fr (Postfix, from userid 0) id CF9E97191E; Mon, 17 Sep 2018 06:22:47 +0000 (UTC) Message-Id: From: Christophe Leroy Subject: [PATCH v3 1/3] watchdog: mpc8xxx: use dev_xxxx() instead of pr_xxxx() To: Wim Van Sebroeck , Guenter Roeck , Radu Rendec , Rob Herring , Mark Rutland Date: Mon, 17 Sep 2018 06:22:47 +0000 (UTC) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" mpc8xxx watchdog driver is a platform device drivers, it is therefore possible to use dev_xxx() messaging rather than pr_xxx() Reviewed-by: Guenter Roeck Signed-off-by: Christophe Leroy --- drivers/watchdog/mpc8xxx_wdt.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c index aca2d6323f8a..1dcf5f10cdd9 100644 --- a/drivers/watchdog/mpc8xxx_wdt.c +++ b/drivers/watchdog/mpc8xxx_wdt.c @@ -17,8 +17,6 @@ * option) any later version. */ -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - #include #include #include @@ -137,26 +135,27 @@ static int mpc8xxx_wdt_probe(struct platform_device *ofdev) struct mpc8xxx_wdt_ddata *ddata; u32 freq = fsl_get_sys_freq(); 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) return -EINVAL; if (!freq || freq == -1) return -EINVAL; - ddata = devm_kzalloc(&ofdev->dev, sizeof(*ddata), GFP_KERNEL); + ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL); if (!ddata) return -ENOMEM; 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)) return PTR_ERR(ddata->base); enabled = in_be32(&ddata->base->swcrr) & SWCRR_SWEN; 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; } @@ -166,7 +165,7 @@ static int mpc8xxx_wdt_probe(struct platform_device *ofdev) ddata->wdd.ops = &mpc8xxx_wdt_ops, 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); @@ -189,12 +188,13 @@ static int mpc8xxx_wdt_probe(struct platform_device *ofdev) ret = watchdog_register_device(&ddata->wdd); 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; } - pr_info("WDT driver for MPC8xxx initialized. mode:%s timeout=%d sec\n", - reset ? "reset" : "interrupt", ddata->wdd.timeout); + dev_info(dev, + "WDT driver for MPC8xxx initialized. mode:%s timeout=%d sec\n", + reset ? "reset" : "interrupt", ddata->wdd.timeout); platform_set_drvdata(ofdev, ddata); return 0; @@ -204,8 +204,8 @@ static int mpc8xxx_wdt_remove(struct platform_device *ofdev) { struct mpc8xxx_wdt_ddata *ddata = platform_get_drvdata(ofdev); - pr_crit("Watchdog removed, expect the %s soon!\n", - reset ? "reset" : "machine check exception"); + dev_crit(&ofdev->dev, "Watchdog removed, expect the %s soon!\n", + reset ? "reset" : "machine check exception"); watchdog_unregister_device(&ddata->wdd); return 0;