From patchwork Mon Sep 8 11:27:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 386889 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2001:1868:205::9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8F134140171 for ; Mon, 8 Sep 2014 21:30:30 +1000 (EST) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XQx8A-0005EC-9r; Mon, 08 Sep 2014 11:29:10 +0000 Received: from mail-qg0-f51.google.com ([209.85.192.51]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XQx87-00052f-Px for linux-mtd@lists.infradead.org; Mon, 08 Sep 2014 11:29:08 +0000 Received: by mail-qg0-f51.google.com with SMTP id e89so1642093qgf.38 for ; Mon, 08 Sep 2014 04:28:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ulxzk1HIHrNdcRjVZfCmoyXPotR3XJOLcIgwGoV/R3A=; b=O1Szl6CL0wfKP4ppilH8imHqpfkIdTT7AzeLZTpMyDZSNnfoQA04dKfNe9arPzYp1j FjJb38VgMOp/0Nr3gDUnad55Y4UFOCom3re7La14stDSfH/Ad0z2kJsr80AwZ5gLUtbG gOf9h+v1WqRMefGvLEVgDEAFUaRJRFcWDGa9KkO0wayAMxn3EVEV4C1pPaNAyBsvZ0Aq vtbmvgFUbgeiq0vxGdDFhkFEYQAl2VeFVJxRrSX9KKV9AEwK6D8y70IpltI3FmxnarJh n1OqCfa01kYrFHOuliQ8EDNcGcZybbZ1kh++DXWHmAIRLyUU7T3mMFJnSxc64C0OmO4M kUFg== X-Gm-Message-State: ALoCoQkGHgvOZ970uHPJFBhJlycDl2tmfL8wJVM57vHxuAzVIu12BUxomcIvGihHfiN55XVZscp+ X-Received: by 10.224.136.10 with SMTP id p10mr3705199qat.26.1410175726366; Mon, 08 Sep 2014 04:28:46 -0700 (PDT) Received: from arch.hh.imgtec.org ([190.2.108.156]) by mx.google.com with ESMTPSA id u95sm7037345qgu.35.2014.09.08.04.28.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 08 Sep 2014 04:28:45 -0700 (PDT) From: Ezequiel Garcia To: Brian Norris , Roger Quadros Subject: [PATCH v2 3/3] nand: omap2: Replace pr_err with dev_err Date: Mon, 8 Sep 2014 08:27:16 -0300 Message-Id: <1410175636-4036-4-git-send-email-ezequiel@vanguardiasur.com.ar> X-Mailer: git-send-email 2.0.1 In-Reply-To: <1410175636-4036-1-git-send-email-ezequiel@vanguardiasur.com.ar> References: <1410175636-4036-1-git-send-email-ezequiel@vanguardiasur.com.ar> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140908_042907_913015_ACD1078D X-CRM114-Status: GOOD ( 13.68 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.192.51 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.8 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.192.51 listed in wl.mailspike.net] Cc: Tony Lindgren , linux-omap@vger.kernel.org, linux-mtd@lists.infradead.org, Ezequiel Garcia , =?UTF-8?q?Guido=20Mart=C3=ADnez?= X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Usage of pr_err is frowned upon, so replace it with dev_err. Aditionally, the message on nand_bch_init() error is redundant, since proper error is showed if the function fails. Signed-off-by: Ezequiel Garcia --- drivers/mtd/nand/omap2.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index f97a4ff..eb5e898 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -1375,7 +1375,7 @@ static int omap_elm_correct_data(struct mtd_info *mtd, u_char *data, erased_ecc_vec = bch16_vector; break; default: - pr_err("invalid driver configuration\n"); + dev_err(&info->pdev->dev, "invalid driver configuration\n"); return -EINVAL; } @@ -1446,7 +1446,8 @@ static int omap_elm_correct_data(struct mtd_info *mtd, u_char *data, err = 0; for (i = 0; i < eccsteps; i++) { if (err_vec[i].error_uncorrectable) { - pr_err("nand: uncorrectable bit-flips found\n"); + dev_err(&info->pdev->dev, + "uncorrectable bit-flips found\n"); err = -EBADMSG; } else if (err_vec[i].error_reported) { for (j = 0; j < err_vec[i].error_count; j++) { @@ -1483,8 +1484,9 @@ static int omap_elm_correct_data(struct mtd_info *mtd, u_char *data, 1 << bit_pos; } } else { - pr_err("invalid bit-flip @ %d:%d\n", - byte_pos, bit_pos); + dev_err(&info->pdev->dev, + "invalid bit-flip @ %d:%d\n", + byte_pos, bit_pos); err = -EBADMSG; } } @@ -1598,13 +1600,13 @@ static bool is_elm_present(struct omap_nand_info *info, /* check whether elm-id is passed via DT */ if (!elm_node) { - pr_err("nand: error: ELM DT node not found\n"); + dev_err(&info->pdev->dev, "ELM devicetree node not found\n"); return false; } pdev = of_find_device_by_node(elm_node); /* check whether ELM device is registered */ if (!pdev) { - pr_err("nand: error: ELM device not found\n"); + dev_err(&info->pdev->dev, "ELM device not found\n"); return false; } /* ELM module available, now configure it */ @@ -1734,14 +1736,14 @@ static int omap_nand_probe(struct platform_device *pdev) /* scan NAND device connected to chip controller */ nand_chip->options |= pdata->devsize & NAND_BUSWIDTH_16; if (nand_scan_ident(mtd, 1, NULL)) { - pr_err("nand device scan failed, may be bus-width mismatch\n"); + dev_err(&info->pdev->dev, "scan failed, may be bus-width mismatch\n"); err = -ENXIO; goto return_error; } /* check for small page devices */ if ((mtd->oobsize < 64) && (pdata->ecc_opt != OMAP_ECC_HAM1_CODE_HW)) { - pr_err("small page devices are not supported\n"); + dev_err(&info->pdev->dev, "small page devices are not supported\n"); err = -EINVAL; goto return_error; } @@ -1959,7 +1961,6 @@ static int omap_nand_probe(struct platform_device *pdev) nand_chip->ecc.bytes, &ecclayout); if (!nand_chip->ecc.priv) { - pr_err("nand: error: unable to use s/w BCH library\n"); err = -EINVAL; goto return_error; } @@ -2026,7 +2027,7 @@ static int omap_nand_probe(struct platform_device *pdev) ecclayout->eccpos[ecclayout->eccbytes - 1] + 1; break; default: - pr_err("nand: error: invalid or unsupported ECC scheme\n"); + dev_err(&info->pdev->dev, "invalid or unsupported ECC scheme\n"); err = -EINVAL; goto return_error; } @@ -2038,8 +2039,9 @@ static int omap_nand_probe(struct platform_device *pdev) ecclayout->oobfree->length = mtd->oobsize - ecclayout->oobfree->offset; /* check if NAND device's OOB is enough to store ECC signatures */ if (mtd->oobsize < (ecclayout->eccbytes + BADBLOCK_MARKER_LENGTH)) { - pr_err("not enough OOB bytes required = %d, available=%d\n", - ecclayout->eccbytes, mtd->oobsize); + dev_err(&info->pdev->dev, + "not enough OOB bytes required = %d, available=%d\n", + ecclayout->eccbytes, mtd->oobsize); err = -EINVAL; goto return_error; }