From patchwork Thu Sep 11 15:02:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 4888861 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6D289C0338 for ; Thu, 11 Sep 2014 15:04:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A9C8020251 for ; Thu, 11 Sep 2014 15:04:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4B1F520220 for ; Thu, 11 Sep 2014 15:04:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753441AbaIKPE2 (ORCPT ); Thu, 11 Sep 2014 11:04:28 -0400 Received: from mail-qa0-f52.google.com ([209.85.216.52]:37809 "EHLO mail-qa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751778AbaIKPE1 (ORCPT ); Thu, 11 Sep 2014 11:04:27 -0400 Received: by mail-qa0-f52.google.com with SMTP id m5so2560849qaj.39 for ; Thu, 11 Sep 2014 08:04:26 -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=x6GcUnYZN4NUzwVC4QotUOgxFOeullvIZfPBrJJIfOo=; b=dcxYhpncEo0WMPBqWZ5pnbMpJk/cxHdclYGbPO/W7XIWHe5SC+NeV/vczt0Gt/SO8W dRoM3LOsKdTihN3wTslpef2xK2flylTAuMnok+YHIg85HxBxi9R0jhCn+AZrY1cbaFyr I9b3Rg94j/yiYO4Ub452Ah813J51cjTvyBVuwK6PNyJHRHcTgYB8kjdiregBSC2Mtguo /LvxzADXZQK35rGsHRiaylyF1f7nVHumx10/ug15NpTZ1a0z1eFCc1ypLSLhveqrg2VQ G/kSp38GcqdDK0s4MZQWkj5U7wiL8XCOkTMNAQhTsLgd1m4oMcAbt8Ah+QdMkJ99as4Y lIEA== X-Gm-Message-State: ALoCoQncmEvMzSqr++m1BuoX4V/cqnWI45+WxNTautFqQ1zVWi2zuVlLuyPEwErLu0d8+eU/0LTq X-Received: by 10.224.24.130 with SMTP id v2mr2432810qab.80.1410447866628; Thu, 11 Sep 2014 08:04:26 -0700 (PDT) Received: from localhost.localdomain (host195.181-8-55.telecom.net.ar. [181.8.55.195]) by mx.google.com with ESMTPSA id s102sm774413qgd.44.2014.09.11.08.04.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 11 Sep 2014 08:04:26 -0700 (PDT) From: Ezequiel Garcia To: Roger Quadros , Brian Norris Cc: Tony Lindgren , , , Ezequiel Garcia Subject: [PATCH v3 3/3] nand: omap2: Replace pr_err with dev_err Date: Thu, 11 Sep 2014 12:02:10 -0300 Message-Id: <1410447730-16087-4-git-send-email-ezequiel@vanguardiasur.com.ar> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1410447730-16087-1-git-send-email-ezequiel@vanguardiasur.com.ar> References: <1410447730-16087-1-git-send-email-ezequiel@vanguardiasur.com.ar> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-9.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Roger Quadros --- drivers/mtd/nand/omap2.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index f97a4ff..3b357e9 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; } @@ -1896,8 +1898,9 @@ 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"); + dev_err(&info->pdev->dev, "unable to use BCH library\n"); err = -EINVAL; + goto return_error; } break; @@ -1959,7 +1962,7 @@ 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"); + dev_err(&info->pdev->dev, "unable to use BCH library\n"); err = -EINVAL; goto return_error; } @@ -2026,7 +2029,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 +2041,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; }