Received: by 10.223.185.116 with SMTP id b49csp3862588wrg; Mon, 19 Feb 2018 07:13:51 -0800 (PST) X-Google-Smtp-Source: AH8x227PWexSoV/QfYUazq/gYYrfsH5w7AKXEtYh7M4eFGoAcR8dWdHgeN99V6rUtrNF+lBStrrG X-Received: by 2002:a17:902:bd94:: with SMTP id q20-v6mr14577455pls.247.1519053231007; Mon, 19 Feb 2018 07:13:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519053230; cv=none; d=google.com; s=arc-20160816; b=mLl6285bzItwzg+43Q37DWRugAdXQUzYwVzzkN4xbHi+SdLfS825PFYLy1KMRHP7ci Y1wpqGaBrvhd001Rqr4Dmff0ACFxx2QNbM7qbvjSa7yTsD8SvQ2LfU2G0I97LBU46ZJR DciFZQ1cFL3y27v71nf5dfkCh+eHN+86B0J4BCOSiV88D/qfI736ON2IvyKMvUGigFWS SUmm9FWdAn2TAdbzupG9hRPXrkd/2Z+ZKZC3plExUX3WEw69y0OOji64SS+62dGXXNU/ hATzEiZlyGqao3fl8rlB4MNgjwyUjs6s0aFsRBet5PTBcSzIa/OFI/STe8hL/VJCJQzQ le0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=19YqIVYYnBAabU6VbqoTrDsCbIi6r5Sa467R0HyVEoA=; b=cWHpUJgWIVuEWljqDkSvCB5+FAMnueJOqPUNYnGMX4iwwqaC7RR/1vpocgeX/tQPap 6ng0DJGdTqWA5KEoEAssST2kC8gX/qM6usZLSmo+Xjiu1ceC8hRJ/lvPtiaL+5c9oAcW aSTCDSiMiP9CF6X+DSllvIKopt75cHvklFOrnZNxQsgYI4ofWIJQiey/lA8Hhg5Ktql9 7s7Xj0OIsriyaudlQOxrawRCDyZpTIQSFXPlaL5keO9jzLfqgUa2SMXfF+ulENoCl7AI ygEhER34H6nF71+d7MXbcB/ZPyt733fY5brICAXYufmRqV+JsFnfa4GL4UJU/OXKqP62 HbMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l10si5764849pfc.203.2018.02.19.07.13.35; Mon, 19 Feb 2018 07:13:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752830AbeBSPM3 (ORCPT + 99 others); Mon, 19 Feb 2018 10:12:29 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:37706 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751515AbeBSPM2 (ORCPT ); Mon, 19 Feb 2018 10:12:28 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id 1BC48207CF; Mon, 19 Feb 2018 16:12:27 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from bbrezillon (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 94F8720719; Mon, 19 Feb 2018 16:12:16 +0100 (CET) Date: Mon, 19 Feb 2018 16:12:16 +0100 From: Boris Brezillon To: Shreeya Patel Cc: boris.brezillon@free-electrons.com, richard@nod.at, dwmw2@infradead.org, computersforpeace@gmail.com, marek.vasut@gmail.com, cyrille.pitchen@wedev4u.fr, maximlevitsky@gmail.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, ezequiel@vanguardiasur.com.ar, outreachy-kernel@googlegroups.com Subject: Re: [PATCH NAND] mtd: nand: Replace printk() with appropriate dev_*macro() Message-ID: <20180219161216.4f3ec2f3@bbrezillon> In-Reply-To: <1519046339-9678-1-git-send-email-shreeya.patel23498@gmail.com> References: <1519046339-9678-1-git-send-email-shreeya.patel23498@gmail.com> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 19 Feb 2018 18:48:59 +0530 Shreeya Patel wrote: > Replace printks having a log level with the appropriate > dev_*macro. > Also, use pdev->dev as it is guaranteed in each case to be > properly initialized when passed into dev_*macro(). > > Signed-off-by: Shreeya Patel > --- > drivers/mtd/nand/ams-delta.c | 6 ++++-- > drivers/mtd/nand/cafe_nand.c | 5 +++-- > drivers/mtd/nand/sh_flctl.c | 2 +- > 3 files changed, 8 insertions(+), 5 deletions(-) > > diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-delta.c > index dcec9cf..2419ca8 100644 > --- a/drivers/mtd/nand/ams-delta.c > +++ b/drivers/mtd/nand/ams-delta.c > @@ -185,7 +185,8 @@ static int ams_delta_init(struct platform_device *pdev) > /* Allocate memory for MTD device structure and private data */ > this = kzalloc(sizeof(struct nand_chip), GFP_KERNEL); > if (!this) { > - printk (KERN_WARNING "Unable to allocate E3 NAND MTD device structure.\n"); > + dev_warn(&pdev->dev, > + "Unable to allocate E3 NAND MTD device structure.\n"); > err = -ENOMEM; > goto out; > } > @@ -219,7 +220,8 @@ static int ams_delta_init(struct platform_device *pdev) > this->dev_ready = ams_delta_nand_ready; > } else { > this->dev_ready = NULL; > - printk(KERN_NOTICE "Couldn't request gpio for Delta NAND ready.\n"); > + dev_notice(&pdev->dev, > + "Couldn't request gpio for Delta NAND ready.\n"); > } > /* 25 us command delay time */ > this->chip_delay = 30; > diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c > index bc558c4..51f58ea 100644 > --- a/drivers/mtd/nand/cafe_nand.c > +++ b/drivers/mtd/nand/cafe_nand.c > @@ -773,8 +773,9 @@ static int cafe_nand_probe(struct pci_dev *pdev, > cafe->nand.bbt_td = &cafe_bbt_main_descr_512; > cafe->nand.bbt_md = &cafe_bbt_mirror_descr_512; > } else { > - printk(KERN_WARNING "Unexpected NAND flash writesize %d. Aborting\n", > - mtd->writesize); > + dev_warn(&cafe->pdev->dev, > + "Unexpected NAND flash writesize %d. Aborting\n", > + mtd->writesize); > goto out_free_dma; I see plenty of printk()s (or pr_xxx()s if this patch is applied after the printk() -> pr_xxx() replacement) that are not converted to dev_xxx() in this driver. If we start using dev_xxx() it should be used consistently. How about we convert all printk()s to pr_xxx()s first (what you do in your first patch), including those you convert to dev_xxx() here, and then we consider patching some of the drivers to use dev_xxx() instead of pr_xxx(). > } > cafe->nand.ecc.mode = NAND_ECC_HW_SYNDROME; > diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c > index e7f3c98..c534c49 100644 > --- a/drivers/mtd/nand/sh_flctl.c > +++ b/drivers/mtd/nand/sh_flctl.c > @@ -877,7 +877,7 @@ static void flctl_cmdfunc(struct mtd_info *mtd, unsigned int command, > else if (!flctl->seqin_column) > execmd_write_page_sector(mtd); > else > - printk(KERN_ERR "Invalid address !?\n"); > + dev_err(&flctl->pdev->dev, "Invalid address !?\n"); > break; > } > set_cmd_regs(mtd, command, (command << 8) | NAND_CMD_SEQIN); -- Boris Brezillon, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering http://bootlin.com