Received: by 10.223.185.116 with SMTP id b49csp4130216wrg; Mon, 19 Feb 2018 11:40:52 -0800 (PST) X-Google-Smtp-Source: AH8x224RIydiD9c4xjykcWgrift9Iggvm1vfaO+nKYRDwf8bnCQ+thEFeJDBLfgx0YtlQV0welhO X-Received: by 10.101.85.143 with SMTP id j15mr12920495pgs.387.1519069252231; Mon, 19 Feb 2018 11:40:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519069252; cv=none; d=google.com; s=arc-20160816; b=IxrWBo3gf9NRVaXdI1xlTZO/7TFbLOaUIF7TabfvS2V+0sbP4fQAfEYc+X5l5FmxkM 3KTlSEocBr6LUFDKhbk3Tl4SO1YLo2olV/crDRZCbD8OcUf22vIs+usMy1VncbccX5C/ RiQumxupGBVrZXJiJoDDs0FmUJPFc1tj7DrmPXK3lQBMSNyeNuG2uFsv1gvZzv+CuCS8 ilIu5dz7IKy9A/kK3W4t3Zkg5CizHellGXwxRnGD2SXHZI1E/XGS3FKVuxnnw+pXzldM gtk1Ib/Dlydp8PHs5i74PFZy+/KShqxWBRYPL9ZW66W2fRIEasaxlk0tuFTBDIuK9wBb k6HA== 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:date:cc:to:from:subject:message-id :dkim-signature:arc-authentication-results; bh=pAThaJ4iqdyOgeLmLxpyKMZa3z6IfcG2EDbN0UMyBcA=; b=s0TgjxLE0OMyRtdDdfbBQXD1KLFZjvbqKMnIXkeAciT24CHRUFo4LIv8PCwFW27JAt I6UCIlcNYTfgKfFmYF0ybZI0BnTYVBUjQo062/S3TX61mW/lqnAeM/2iOrmO1oG0/xI4 629Jv5eMa4O6XKLLim57gtGy6+LtwdInUwr4RMahzZ6vxyDfy95Hs+bXCzf+WHSzC8d6 wD9dgAfrR75G/ospC8GtRrOZjDY7OwoZvqaKK5wkjbCp66g9o/qCq+w4B3HryAuAnK5I 3AH7Hg6QUfIXwVxQmeJxhVRMsajsCJRq9GuvBBU3wv4kFIShBKRtWgSUtBwdYBIpdM4M Pzow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aVqsc7vp; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z11-v6si6524588plo.811.2018.02.19.11.40.37; Mon, 19 Feb 2018 11:40:52 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=aVqsc7vp; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753605AbeBSTkA (ORCPT + 99 others); Mon, 19 Feb 2018 14:40:00 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:40047 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753466AbeBSTj6 (ORCPT ); Mon, 19 Feb 2018 14:39:58 -0500 Received: by mail-pg0-f68.google.com with SMTP id g2so6236944pgn.7 for ; Mon, 19 Feb 2018 11:39:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=pAThaJ4iqdyOgeLmLxpyKMZa3z6IfcG2EDbN0UMyBcA=; b=aVqsc7vpRkyhq3Kw9JovTEfBNU+DVHm2oESybNdKmGCFGxWILFXfeQs7sQAEoSogc7 lSAo687uqmvSvX02oBSmASt8zRsKW/Fj7L6D4vQw5tsRxlhjuPcB36dX38BvXqSWKTBC 5TWbogOdJV7cupzBjrWEjfTCchpP8AsUie4fE8jl+y5SrAvhnHXxt0jaQFA0NdugYTgb RpF+yeGAxt+jDKL5+jpUjLDNwGrGj+ttIhAJpHZubqxNG4CLYFtfoLN0tLASUh/nhzD4 tUHeEv87v1uX/U/TaBe/Lb+RChBlfNHpNjxZtCsF8ZY5drV+LCklqktjqziJqdHYlTIV OnNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=pAThaJ4iqdyOgeLmLxpyKMZa3z6IfcG2EDbN0UMyBcA=; b=q6W42l7BkvpOQ31SmBoPwJwCe4W9Tehdq0hcCzS0PbwLHJGhiS/ufjmyFkDOYB+9rL 6x1TmAk5yGngPln5/LoNVDL2DkvDUwSWb7bIJ+1xyaeugwjJlqa/mxbPC+R/cjSOp3/Y 6w1bnWrOn+p5mHAGauurDnO+6wDaFD8d+JDqr164VZepSoSoVESqYcoOvW3Ccng2MRbv QFGssPu7UreyKM1ONIWUv8oqaCWnXErxmOdgLf/qTm4yX3cMWtaO2Vm1FqGXEgrcoSSQ RI9KlecKxLE0eJlsm06KoBxa6hFxcmLjzfluX91UWKACvkFcNSNwpoKiB20EZSBV9OIn 4Cxg== X-Gm-Message-State: APf1xPBAbyqJE6FJIc1cgqYN5c3Q1og/TDqQk1CdCo2t+KxxmI6Qls0W nZaXBjSRGL1yy/Wqw72kKv8= X-Received: by 10.99.112.20 with SMTP id l20mr13385006pgc.412.1519069198118; Mon, 19 Feb 2018 11:39:58 -0800 (PST) Received: from [10.0.2.15] ([103.212.140.144]) by smtp.googlemail.com with ESMTPSA id j25sm61197960pfi.118.2018.02.19.11.39.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Feb 2018 11:39:57 -0800 (PST) Message-ID: <1519069191.2102.3.camel@gmail.com> Subject: Re: [PATCH NAND] mtd: nand: Replace printk() with appropriate dev_*macro() From: Shreeya Patel To: Boris Brezillon 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 Date: Tue, 20 Feb 2018 01:09:51 +0530 In-Reply-To: <20180219161216.4f3ec2f3@bbrezillon> References: <1519046339-9678-1-git-send-email-shreeya.patel23498@gmail.com> <20180219161216.4f3ec2f3@bbrezillon> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.18.5.2-0ubuntu3.2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2018-02-19 at 16:12 +0100, Boris Brezillon wrote: > 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(). Yes, this will be better :) I'll include these changes in my pr_xxx() patch. Then we will work for dev_xxx(). Thanks > > > > >   } > >   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); > >