From patchwork Tue Mar 20 12:39:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arushi Singhal X-Patchwork-Id: 888190 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="hF/l+Vay"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="atvfugn0"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 405CFf5qQxz9s15 for ; Tue, 20 Mar 2018 23:40:22 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:To:From :Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=rsMX8MuGjbeBMrb/LDAEsDf9IxYB/TjxADK6KuU7t5Q=; b=hF/l+Vay+cRY8H PFo4nrM7mz/rMnFV3uKJwtTAKfABgqEJ3k9zMfM0agBrS1HpEDGrAdtQTOSZMzpHRIho4jmK3QO3d hf+KqZh6e5d0WMw+ojnJVbT/OZISW7DhzGLoMGllkSZ3DWSB410vrx5N89TroP0H6iJ0G5c2578Uv Lmo2iyBxJFRf4RqlYPvJCf7tvWA/JVuzPgh9mqfgu8/Dn9q1yceFWiKGX1UgAVAJcc2QRUEUtNK8p tb63l/OyyUCGzZ930P9rBSQ2khiLsIpQg4IpYOHdyBp3faLJFcGXdV1H3ztJIaDclDdL09KmtAcUr AV+RjlKFW57ySOh+kNtA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1eyGYr-0006jy-2i; Tue, 20 Mar 2018 12:40:17 +0000 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1eyGYi-0005Tj-Ng for linux-mtd@lists.infradead.org; Tue, 20 Mar 2018 12:40:15 +0000 Received: by mail-pf0-x242.google.com with SMTP id j2so563821pff.10 for ; Tue, 20 Mar 2018 05:39:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=lGxmAm5Lpp/0jWz7Igh/ExpQ/o7YeY5OPqiTY4o4hQ0=; b=atvfugn07Z6dfDkB2Vr1C8krZvZyS6YWyfWQYglsKHBV4gwfjdKFk8HfbDHQu5KYRd C7aXNgymp+GbZyM2n9AKLJzZlG/cgR/Dau7jL2wC3205zoCdL6nO1Bg82YcxUlehEtOl R1c6HsbL3U0s5YpfoyDduliYubCT7SjODTVpcrIAEUY+Q/Y2sLeTM0iVS6Ad1K65gFHQ XKYmVilx8heBLeWhn269Td6O4WBSZitVWPnR7WXDtepyEcIaViCbDJgDkz3NhXHPQorM Jy2Izy281irw1Xrr4jEuNipfYQEw7emu1wcIzmm+Nhy5A/ynZ5B3yIcGS3Yev6UpOaOc nwMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=lGxmAm5Lpp/0jWz7Igh/ExpQ/o7YeY5OPqiTY4o4hQ0=; b=hn9Gq6QNfz3ndg13QlPqcOUdQu/rjGvkKqrMiMwnDsLpMz13i8Q74TXoQyVyA4lq5g k+T1QFLVZkKjAMEYysNB7Py3ZQAE5IiY7ORt7TMo12T98G6piwpC8xTz096lvn4g6ABF D1Mflxy3KqgzY3NnAbXZdN5Fpzdk+hrUQX3H67e1uXOGsIWt58KT9hBjtb8GvIF/vsKp DfG/wFQLo8aNh7hbPAEx+AsBy8ZeTJy+zZj1sbje0ogbr51FFICqZVZwcSQQql9g5t9W REn98yQcL9sxxzHdXHwrxDjsjVEwZaBjjak+39IMKsZxtx4XqVQ1+qNfibJsa6m81Nk+ dTrw== X-Gm-Message-State: AElRT7FPMkvRCODlpOa6LktDHq/RZr9JiuYzp5ZZZ6FkPMnSt/nIX6CR tJhwrsRARsNj5URtxvIf+nmH/A== X-Google-Smtp-Source: AG47ELvP9cI+K55T8fHlEXjaCYuVuAhhg0YC8yGt595MWlCZS20YdpDLwvo895vgLCVW3+QnfoYoVw== X-Received: by 10.101.99.149 with SMTP id h21mr9535474pgv.345.1521549597510; Tue, 20 Mar 2018 05:39:57 -0700 (PDT) Received: from seema-Inspiron-15-3567 ([14.139.82.6]) by smtp.gmail.com with ESMTPSA id e16sm3951679pfb.157.2018.03.20.05.39.55 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Mar 2018 05:39:56 -0700 (PDT) Date: Tue, 20 Mar 2018 18:09:07 +0530 From: Arushi Singhal To: computersforpeace@gmail.com Subject: [PATCH v2] mtd: chips: Replace printk() with more standardize output format Message-ID: <20180320123906.GA575@seema-Inspiron-15-3567> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180320_054008_875195_750A630E X-CRM114-Status: GOOD ( 20.21 ) X-Spam-Score: 0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c00:0:0:0:242 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (arushisinghal19971997[at]gmail.com) 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (arushisinghal19971997[at]gmail.com) -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Boris Brezillon , Richard Weinberger , linux-kernel@vger.kernel.org, Marek Vasut , linux-mtd@lists.infradead.org, Cyrille Pitchen , David Woodhouse Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org printk() is the raw way to print output and should be avoided. For drivers with defined "struct device object", dev_*macro() is prefer to standardize the output format within the subsystem. If no "struct device object" is defined prefer pr_*macro() over printk(). This patch Replace printk having a log level with the appropriate output format according to the order of preference. Change string explicitly mentioning function name to "%s...", __func__. Signed-off-by: Arushi Singhal --- changes in v2 *if "struct device object" is defined prefered dev_*macro() over pr_*macro(). drivers/mtd/chips/cfi_cmdset_0001.c | 127 +++++++++++++++++++----------------- 1 file changed, 66 insertions(+), 61 deletions(-) diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c index 5e1b68c..18f24ce 100644 --- a/drivers/mtd/chips/cfi_cmdset_0001.c +++ b/drivers/mtd/chips/cfi_cmdset_0001.c @@ -182,7 +182,7 @@ static void fixup_convert_atmel_pri(struct mtd_info *mtd) memcpy(&atmel_pri, extp, sizeof(atmel_pri)); memset((char *)extp + 5, 0, sizeof(*extp) - 5); - printk(KERN_ERR "atmel Features: %02x\n", atmel_pri.Features); + dev_err(&mtd->dev, "atmel Features: %02x\n", atmel_pri.Features); if (atmel_pri.Features & 0x01) /* chip erase supported */ features |= (1<<0); @@ -224,8 +224,7 @@ static void fixup_intel_strataflash(struct mtd_info *mtd) struct cfi_private *cfi = map->fldrv_priv; struct cfi_pri_intelext *extp = cfi->cmdset_priv; - printk(KERN_WARNING "cfi_cmdset_0001: Suspend " - "erase on write disabled.\n"); + dev_warn(&mtd->dev, "cfi_cmdset_0001: Suspend erase on write disabled\n"); extp->SuspendCmdSupport &= ~1; } #endif @@ -239,7 +238,7 @@ static void fixup_no_write_suspend(struct mtd_info *mtd) if (cfip && (cfip->FeatureSupport&4)) { cfip->FeatureSupport &= ~4; - printk(KERN_WARNING "cfi_cmdset_0001: write suspend disabled\n"); + dev_warn(&mtd->dev, "cfi_cmdset_0001: write suspend disabled\n"); } } #endif @@ -282,13 +281,13 @@ static void fixup_LH28F640BF(struct mtd_info *mtd) /* Reset the Partition Configuration Register on LH28F640BF * to a single partition (PCR = 0x000): PCR is embedded into A0-A15. */ if (is_LH28F640BF(cfi)) { - printk(KERN_INFO "Reset Partition Config. Register: 1 Partition of 4 planes\n"); + dev_info(&mtd->dev, "Reset Partition Config. Register: 1 Partition of 4 planes\n"); map_write(map, CMD(0x60), 0); map_write(map, CMD(0x04), 0); /* We have set one single partition thus * Simultaneous Operations are not allowed */ - printk(KERN_INFO "cfi_cmdset_0001: Simultaneous Operations disabled\n"); + dev_info(&mtd->dev, "cfi_cmdset_0001: Simultaneous Operations disabled\n"); extp->FeatureSupport &= ~512; } } @@ -307,7 +306,7 @@ static void fixup_use_write_buffers(struct mtd_info *mtd) struct map_info *map = mtd->priv; struct cfi_private *cfi = map->fldrv_priv; if (cfi->cfiq->BufWriteTimeoutTyp) { - printk(KERN_INFO "Using buffer write method\n" ); + dev_info(&mtd->dev, "Using buffer write method\n"); mtd->_write = cfi_intelext_write_buffers; mtd->_writev = cfi_intelext_writev; } @@ -323,7 +322,7 @@ static void fixup_unlock_powerup_lock(struct mtd_info *mtd) struct cfi_pri_intelext *cfip = cfi->cmdset_priv; if (cfip->FeatureSupport&32) { - printk(KERN_INFO "Using auto-unlock on power-up/resume\n" ); + dev_info(&mtd->dev, "Using auto-unlock on power-up/resume\n"); mtd->flags |= MTD_POWERUP_LOCK; } } @@ -392,9 +391,8 @@ read_pri_intelext(struct map_info *map, __u16 adr) if (extp->MajorVersion != '1' || (extp->MinorVersion < '0' || extp->MinorVersion > '5')) { - printk(KERN_ERR " Unknown Intel/Sharp Extended Query " - "version %c.%c.\n", extp->MajorVersion, - extp->MinorVersion); + pr_err("Unknown Intel/Sharp Extended Query version %c.%c\n", + extp->MajorVersion, extp->MinorVersion); kfree(extp); return NULL; } @@ -452,9 +450,8 @@ read_pri_intelext(struct map_info *map, __u16 adr) extp_size = sizeof(*extp) + extra_size; kfree(extp); if (extp_size > 4096) { - printk(KERN_ERR - "%s: cfi_pri_intelext is too fat\n", - __func__); + pr_err("%s: cfi_pri_intelext is too fat\n", + __func__); return NULL; } goto again; @@ -519,7 +516,8 @@ struct mtd_info *cfi_cmdset_0001(struct map_info *map, int primary) #endif if(extp->SuspendCmdSupport & 1) { - printk(KERN_NOTICE "cfi_cmdset_0001: Erase suspend on write enabled\n"); + pr_notice("%s: Erase suspend on write enabled\n", + __func__); } } else if (cfi->cfi_mode == CFI_MODE_JEDEC) { @@ -622,15 +620,16 @@ static struct mtd_info *cfi_intelext_setup(struct mtd_info *mtd) if (offset != devsize) { /* Argh */ - printk(KERN_WARNING "Sum of regions (%lx) != total size of set of interleaved chips (%lx)\n", offset, devsize); + dev_warn(&mtd->dev, "Sum of regions (%lx) != total size of set of interleaved chips (%lx)\n", + offset, devsize); goto setup_err; } for (i=0; inumeraseregions;i++){ - printk(KERN_DEBUG "erase region %d: offset=0x%llx,size=0x%x,blocks=%d\n", - i,(unsigned long long)mtd->eraseregions[i].offset, - mtd->eraseregions[i].erasesize, - mtd->eraseregions[i].numblocks); + dev_dbg(&mtd->dev, "erase region %d: offset=0x%llx,size=0x%x,blocks=%d\n", + i, (unsigned long long)mtd->eraseregions[i].offset, + mtd->eraseregions[i].erasesize, + mtd->eraseregions[i].numblocks); } #ifdef CONFIG_MTD_OTP @@ -722,10 +721,10 @@ static int cfi_intelext_partition_fixup(struct mtd_info *mtd, prinfo = (struct cfi_intelext_programming_regioninfo *)&extp->extra[offs]; mtd->writesize = cfi->interleave << prinfo->ProgRegShift; mtd->flags &= ~MTD_BIT_WRITEABLE; - printk(KERN_DEBUG "%s: program region size/ctrl_valid/ctrl_inval = %d/%d/%d\n", - map->name, mtd->writesize, - cfi->interleave * prinfo->ControlValid, - cfi->interleave * prinfo->ControlInvalid); + dev_dbg(&mtd->dev, "%s: program region size/ctrl_valid/ctrl_inval = %d/%d/%d\n", + map->name, mtd->writesize, + cfi->interleave * prinfo->ControlValid, + cfi->interleave * prinfo->ControlInvalid); } /* @@ -736,8 +735,7 @@ static int cfi_intelext_partition_fixup(struct mtd_info *mtd, partshift = cfi->chipshift - __ffs(numparts); if ((1 << partshift) < mtd->erasesize) { - printk( KERN_ERR - "%s: bad number of hw partitions (%d)\n", + dev_err(&mtd->dev, "%s: bad number of hw partitions (%d)\n", __func__, numparts); return -EINVAL; } @@ -771,10 +769,9 @@ static int cfi_intelext_partition_fixup(struct mtd_info *mtd, } } - printk(KERN_DEBUG "%s: %d set(s) of %d interleaved chips " - "--> %d partitions of %d KiB\n", - map->name, cfi->numchips, cfi->interleave, - newcfi->numchips, 1<<(newcfi->chipshift-10)); + dev_dbg(&mtd->dev, "%s: %d set(s) of %d interleaved chips --> %d partitions of %d KiB\n", + map->name, cfi->numchips, cfi->interleave, + newcfi->numchips, 1 << (newcfi->chipshift - 10)); map->fldrv_priv = newcfi; *pcfi = newcfi; @@ -853,8 +850,8 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long /* Urgh. Resume and pretend we weren't here. * Make sure we're in 'read status' mode if it had finished */ put_chip(map, chip, adr); - printk(KERN_ERR "%s: Chip not ready after erase " - "suspended: status = 0x%lx\n", map->name, status.x[0]); + pr_err("%s: Chip not ready after erase suspended: status = 0x%lx\n", + map->name, status.x[0]); return -EIO; } @@ -1057,7 +1054,8 @@ static void put_chip(struct map_info *map, struct flchip *chip, unsigned long ad case FL_JEDEC_QUERY: break; default: - printk(KERN_ERR "%s: put_chip() called with oldstate %d!!\n", map->name, chip->oldstate); + pr_err("%s: %s() called with oldstate %d!!\n", + map->name, __func__, chip->oldstate); } wake_up(&chip->wq); } @@ -1436,7 +1434,8 @@ static int cfi_intelext_unpoint(struct mtd_info *mtd, loff_t from, size_t len) if(chip->ref_point_counter == 0) chip->state = FL_READY; } else { - printk(KERN_ERR "%s: Error: unpoint called on non pointed region\n", map->name); + dev_err(&mtd->dev, "%s: Error: unpoint called on non pointed region\n", + map->name); err = -EINVAL; } @@ -1560,7 +1559,7 @@ static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip, chip->word_write_time_max); if (ret) { xip_enable(map, chip, adr); - printk(KERN_ERR "%s: word write error (status timeout)\n", map->name); + pr_err("%s: word write error (status timeout)\n", map->name); goto out; } @@ -1577,10 +1576,11 @@ static int __xipram do_write_oneword(struct map_info *map, struct flchip *chip, if (chipstatus & 0x02) { ret = -EROFS; } else if (chipstatus & 0x08) { - printk(KERN_ERR "%s: word write error (bad VPP)\n", map->name); + pr_err("%s: word write error (bad VPP)\n", map->name); ret = -EIO; } else { - printk(KERN_ERR "%s: word write error (status 0x%lx)\n", map->name, chipstatus); + pr_err("%s: word write error (status 0x%lx)\n", + map->name, chipstatus); ret = -EINVAL; } @@ -1723,7 +1723,8 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, status = map_read(map, cmd_adr); if (map_word_bitsset(map, status, CMD(0x30))) { xip_enable(map, chip, cmd_adr); - printk(KERN_WARNING "SR.4 or SR.5 bits set in buffer write (status %lx). Clearing.\n", status.x[0]); + pr_warn("SR.4 or SR.5 bits set in buffer write (status %lx). Clearing\n", + status.x[0]); xip_disable(map, chip, cmd_adr); map_write(map, CMD(0x50), cmd_adr); map_write(map, CMD(0x70), cmd_adr); @@ -1741,8 +1742,8 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, map_write(map, CMD(0x50), cmd_adr); map_write(map, CMD(0x70), cmd_adr); xip_enable(map, chip, cmd_adr); - printk(KERN_ERR "%s: Chip not ready for buffer write. Xstatus = %lx, status = %lx\n", - map->name, Xstatus.x[0], status.x[0]); + pr_err("%s: Chip not ready for buffer write. Xstatus = %lx, status = %lx\n", + map->name, Xstatus.x[0], status.x[0]); goto out; } @@ -1806,7 +1807,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, map_write(map, CMD(0x70), cmd_adr); chip->state = FL_STATUS; xip_enable(map, chip, cmd_adr); - printk(KERN_ERR "%s: buffer write error (status timeout)\n", map->name); + pr_err("%s: buffer write error (status timeout)\n", map->name); goto out; } @@ -1823,10 +1824,11 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip, if (chipstatus & 0x02) { ret = -EROFS; } else if (chipstatus & 0x08) { - printk(KERN_ERR "%s: buffer write error (bad VPP)\n", map->name); + pr_err("%s: buffer write error (bad VPP)\n", map->name); ret = -EIO; } else { - printk(KERN_ERR "%s: buffer write error (status 0x%lx)\n", map->name, chipstatus); + pr_err("%s: buffer write error (status 0x%lx)\n", + map->name, chipstatus); ret = -EINVAL; } @@ -1942,7 +1944,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, map_write(map, CMD(0x70), adr); chip->state = FL_STATUS; xip_enable(map, chip, adr); - printk(KERN_ERR "%s: block erase error: (status timeout)\n", map->name); + pr_err("%s: block erase error: (status timeout)\n", map->name); goto out; } @@ -1961,23 +1963,26 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, xip_enable(map, chip, adr); if ((chipstatus & 0x30) == 0x30) { - printk(KERN_ERR "%s: block erase error: (bad command sequence, status 0x%lx)\n", map->name, chipstatus); + pr_err("%s: block erase error: (bad command sequence, status 0x%lx)\n", + map->name, chipstatus); ret = -EINVAL; } else if (chipstatus & 0x02) { /* Protection bit set */ ret = -EROFS; } else if (chipstatus & 0x8) { /* Voltage */ - printk(KERN_ERR "%s: block erase error: (bad VPP)\n", map->name); + pr_err("%s: block erase error: (bad VPP)\n", map->name); ret = -EIO; } else if (chipstatus & 0x20 && retries--) { - printk(KERN_DEBUG "block erase failed at 0x%08lx: status 0x%lx. Retrying...\n", adr, chipstatus); + pr_debug("block erase failed at 0x%08lx: status 0x%lx. Retrying...\n", + adr, chipstatus); DISABLE_VPP(map); put_chip(map, chip, adr); mutex_unlock(&chip->mutex); goto retry; } else { - printk(KERN_ERR "%s: block erase failed at 0x%08lx (status 0x%lx)\n", map->name, adr, chipstatus); + pr_err("%s: block erase failed at 0x%08lx (status 0x%lx)\n", + map->name, adr, chipstatus); ret = -EIO; } @@ -2073,8 +2078,8 @@ static int __xipram do_printlockstatus_oneblock(struct map_info *map, unsigned long adr, int len, void *thunk) { - printk(KERN_DEBUG "block status register for 0x%08lx is %x\n", - adr, do_getlockstatus_oneblock(map, chip, adr, len, thunk)); + pr_debug("block status register for 0x%08lx is %x\n", + adr, do_getlockstatus_oneblock(map, chip, adr, len, thunk)); return 0; } #endif @@ -2131,7 +2136,7 @@ static int __xipram do_xxlock_oneblock(struct map_info *map, struct flchip *chip map_write(map, CMD(0x70), adr); chip->state = FL_STATUS; xip_enable(map, chip, adr); - printk(KERN_ERR "%s: block unlock error: (status timeout)\n", map->name); + pr_err("%s: block unlock error: (status timeout)\n", map->name); goto out; } @@ -2147,8 +2152,8 @@ static int cfi_intelext_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len) int ret; #ifdef DEBUG_LOCK_BITS - printk(KERN_DEBUG "%s: lock status before, ofs=0x%08llx, len=0x%08X\n", - __func__, ofs, len); + dev_dbg(&mtd->dev, "%s: lock status before, ofs=0x%08llx, len=0x%08X\n", + __func__, ofs, len); cfi_varsize_frob(mtd, do_printlockstatus_oneblock, ofs, len, NULL); #endif @@ -2157,8 +2162,7 @@ static int cfi_intelext_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len) ofs, len, DO_XXLOCK_ONEBLOCK_LOCK); #ifdef DEBUG_LOCK_BITS - printk(KERN_DEBUG "%s: lock status after, ret=%d\n", - __func__, ret); + dev_dbg(&mtd->dev, "%s: lock status after, ret=%d\n", __func__, ret); cfi_varsize_frob(mtd, do_printlockstatus_oneblock, ofs, len, NULL); #endif @@ -2171,8 +2175,8 @@ static int cfi_intelext_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) int ret; #ifdef DEBUG_LOCK_BITS - printk(KERN_DEBUG "%s: lock status before, ofs=0x%08llx, len=0x%08X\n", - __func__, ofs, len); + dev_dbg(&mtd->dev, "%s: lock status before, ofs=0x%08llx, len=0x%08X\n", + __func__, ofs, len); cfi_varsize_frob(mtd, do_printlockstatus_oneblock, ofs, len, NULL); #endif @@ -2181,8 +2185,7 @@ static int cfi_intelext_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) ofs, len, DO_XXLOCK_ONEBLOCK_UNLOCK); #ifdef DEBUG_LOCK_BITS - printk(KERN_DEBUG "%s: lock status after, ret=%d\n", - __func__, ret); + dev_dbg(&mtd->dev, "%s: lock status after, ret=%d\n", __func__, ret); cfi_varsize_frob(mtd, do_printlockstatus_oneblock, ofs, len, NULL); #endif @@ -2520,7 +2523,8 @@ static int cfi_intelext_suspend(struct mtd_info *mtd) */ } else { /* There seems to be an operation pending. We must wait for it. */ - printk(KERN_NOTICE "Flash device refused suspend due to pending operation (oldstate %d)\n", chip->oldstate); + dev_notice(&mtd->dev, "Flash device refused suspend due to pending operation (oldstate %d)\n", + chip->oldstate); ret = -EAGAIN; } break; @@ -2529,7 +2533,8 @@ static int cfi_intelext_suspend(struct mtd_info *mtd) allowed to. Or should we return -EAGAIN, because the upper layers ought to have already shut down anything which was using the device anyway? The latter for now. */ - printk(KERN_NOTICE "Flash device refused suspend due to active operation (state %d)\n", chip->state); + dev_notice(&mtd->dev, "Flash device refused suspend due to active operation (state %d)\n", + chip->state); ret = -EAGAIN; case FL_PM_SUSPENDED: break;