From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61E5BC4360C for ; Thu, 10 Oct 2019 07:22:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 448F32196E for ; Thu, 10 Oct 2019 07:22:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733096AbfJJHWJ (ORCPT ); Thu, 10 Oct 2019 03:22:09 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:44634 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733012AbfJJHVW (ORCPT ); Thu, 10 Oct 2019 03:21:22 -0400 Received: from dhcp-172-31-174-146.wireless.concordia.ca (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 46710290786; Thu, 10 Oct 2019 08:21:20 +0100 (BST) Date: Thu, 10 Oct 2019 09:21:17 +0200 From: Boris Brezillon To: Cc: , , , , , linux-aspeed@lists.ozlabs.org, andrew@aj.id.au, richard@nod.at, linux-kernel@vger.kernel.org, vz@mleia.com, linux-mediatek@lists.infradead.org, joel@jms.id.au, miquel.raynal@bootlin.com, matthias.bgg@gmail.com, computersforpeace@gmail.com, dwmw2@infradead.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 08/22] mtd: spi-nor: Rework write_enable/disable() Message-ID: <20191010092117.4c5018a8@dhcp-172-31-174-146.wireless.concordia.ca> In-Reply-To: <20190924074533.6618-9-tudor.ambarus@microchip.com> References: <20190924074533.6618-1-tudor.ambarus@microchip.com> <20190924074533.6618-9-tudor.ambarus@microchip.com> Organization: Collabora X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-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 Tue, 24 Sep 2019 07:46:18 +0000 wrote: > From: Tudor Ambarus > > static int write_enable(struct spi_nor *nor) > static int write_disable(struct spi_nor *nor) > become > static int spi_nor_write_enable(struct spi_nor *nor) > static int spi_nor_write_disable(struct spi_nor *nor) > > Check for errors after each call to them. Move them up in the > file as the first SPI NOR Register Operations, to avoid further > forward declarations. Same here, split that in 3 patches please. > > Signed-off-by: Tudor Ambarus > --- > drivers/mtd/spi-nor/spi-nor.c | 175 +++++++++++++++++++++++++++++------------- > 1 file changed, 120 insertions(+), 55 deletions(-) > > diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c > index 0fb124bd2e77..0aee068a5835 100644 > --- a/drivers/mtd/spi-nor/spi-nor.c > +++ b/drivers/mtd/spi-nor/spi-nor.c > @@ -389,6 +389,64 @@ static ssize_t spi_nor_write_data(struct spi_nor *nor, loff_t to, size_t len, > } > > /** > + * spi_nor_write_enable() - Set write enable latch with Write Enable command. > + * @nor: pointer to 'struct spi_nor' > + * > + * Return: 0 on success, -errno otherwise. > + */ > +static int spi_nor_write_enable(struct spi_nor *nor) > +{ > + int ret; > + > + if (nor->spimem) { > + struct spi_mem_op op = > + SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_WREN, 1), > + SPI_MEM_OP_NO_ADDR, > + SPI_MEM_OP_NO_DUMMY, > + SPI_MEM_OP_NO_DATA); > + > + ret = spi_mem_exec_op(nor->spimem, &op); > + } else { > + ret = nor->controller_ops->write_reg(nor, SPINOR_OP_WREN, > + NULL, 0); > + } > + > + if (ret) > + dev_err(nor->dev, "error %d on Write Enable\n", ret); Do we really need these error messages? I mean, if there's an error it should be propagated to the upper layer, so maybe we should use dev_dbg() here. > + > + return ret; > +} > + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F070AC10F14 for ; Thu, 10 Oct 2019 07:21:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BADB820B7C for ; Thu, 10 Oct 2019 07:21:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="agZ5Xex6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BADB820B7C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org 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:References:In-Reply-To: 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: List-Owner; bh=+HUdOJqpRoesdbojri3rLuw/WVkJQLjCiVHfgA1okmc=; b=agZ5Xex6vGATrJ vZhuWFSgOvr6tXBmcpoZj/I1OxAU+iETLl/VeB5weMovyDOfBJ4sqqT3AyEMrgXJIaKxpL+nX4PGh wvQuQSM1cBzcDncXsmt+OmdS02jBljtFRX3g4o/BbPRTqbDQ+J9JVKDWlFsLQ4KT1sHuEr7uZjKmN /yOI+AZibyLGi1t4iYdhgKe97VTilOXbMOJW69Tf3iLF61R2AoVbwpyRDomW9+5zQz+Wozo2anQN0 JtVtTg8Gpd+EMGiu9gdAtOyVoHU83KcLaCb9QWWYULWb9hjAUzeimA4f5/rcqExizZLsCti0WFj8H 7GgfoJG7NyVnAzT/SKHQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iISlT-0007DU-3R; Thu, 10 Oct 2019 07:21:35 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iISlG-00071X-4K; Thu, 10 Oct 2019 07:21:23 +0000 Received: from dhcp-172-31-174-146.wireless.concordia.ca (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 46710290786; Thu, 10 Oct 2019 08:21:20 +0100 (BST) Date: Thu, 10 Oct 2019 09:21:17 +0200 From: Boris Brezillon To: Subject: Re: [PATCH v2 08/22] mtd: spi-nor: Rework write_enable/disable() Message-ID: <20191010092117.4c5018a8@dhcp-172-31-174-146.wireless.concordia.ca> In-Reply-To: <20190924074533.6618-9-tudor.ambarus@microchip.com> References: <20190924074533.6618-1-tudor.ambarus@microchip.com> <20190924074533.6618-9-tudor.ambarus@microchip.com> Organization: Collabora X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_002122_301828_4A0E3F7B X-CRM114-Status: GOOD ( 18.44 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, vigneshr@ti.com, geert+renesas@glider.be, andrew@aj.id.au, richard@nod.at, linux-kernel@vger.kernel.org, vz@mleia.com, marek.vasut@gmail.com, jonas@norrbonn.se, linux-mtd@lists.infradead.org, joel@jms.id.au, miquel.raynal@bootlin.com, matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org, computersforpeace@gmail.com, dwmw2@infradead.org, linux-aspeed@lists.ozlabs.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org On Tue, 24 Sep 2019 07:46:18 +0000 wrote: > From: Tudor Ambarus > > static int write_enable(struct spi_nor *nor) > static int write_disable(struct spi_nor *nor) > become > static int spi_nor_write_enable(struct spi_nor *nor) > static int spi_nor_write_disable(struct spi_nor *nor) > > Check for errors after each call to them. Move them up in the > file as the first SPI NOR Register Operations, to avoid further > forward declarations. Same here, split that in 3 patches please. > > Signed-off-by: Tudor Ambarus > --- > drivers/mtd/spi-nor/spi-nor.c | 175 +++++++++++++++++++++++++++++------------- > 1 file changed, 120 insertions(+), 55 deletions(-) > > diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c > index 0fb124bd2e77..0aee068a5835 100644 > --- a/drivers/mtd/spi-nor/spi-nor.c > +++ b/drivers/mtd/spi-nor/spi-nor.c > @@ -389,6 +389,64 @@ static ssize_t spi_nor_write_data(struct spi_nor *nor, loff_t to, size_t len, > } > > /** > + * spi_nor_write_enable() - Set write enable latch with Write Enable command. > + * @nor: pointer to 'struct spi_nor' > + * > + * Return: 0 on success, -errno otherwise. > + */ > +static int spi_nor_write_enable(struct spi_nor *nor) > +{ > + int ret; > + > + if (nor->spimem) { > + struct spi_mem_op op = > + SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_WREN, 1), > + SPI_MEM_OP_NO_ADDR, > + SPI_MEM_OP_NO_DUMMY, > + SPI_MEM_OP_NO_DATA); > + > + ret = spi_mem_exec_op(nor->spimem, &op); > + } else { > + ret = nor->controller_ops->write_reg(nor, SPINOR_OP_WREN, > + NULL, 0); > + } > + > + if (ret) > + dev_err(nor->dev, "error %d on Write Enable\n", ret); Do we really need these error messages? I mean, if there's an error it should be propagated to the upper layer, so maybe we should use dev_dbg() here. > + > + return ret; > +} > + ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ From mboxrd@z Thu Jan 1 00:00:00 1970 From: Boris Brezillon Subject: Re: [PATCH v2 08/22] mtd: spi-nor: Rework write_enable/disable() Date: Thu, 10 Oct 2019 09:21:17 +0200 Message-ID: <20191010092117.4c5018a8@dhcp-172-31-174-146.wireless.concordia.ca> References: <20190924074533.6618-1-tudor.ambarus@microchip.com> <20190924074533.6618-9-tudor.ambarus@microchip.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190924074533.6618-9-tudor.ambarus@microchip.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=m.gmane.org@lists.infradead.org To: Tudor.Ambarus@microchip.com Cc: linux-arm-kernel@lists.infradead.org, vigneshr@ti.com, geert+renesas@glider.be, andrew@aj.id.au, richard@nod.at, linux-kernel@vger.kernel.org, vz@mleia.com, marek.vasut@gmail.com, jonas@norrbonn.se, linux-mtd@lists.infradead.org, joel@jms.id.au, miquel.raynal@bootlin.com, matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org, computersforpeace@gmail.com, dwmw2@infradead.org, linux-aspeed@lists.ozlabs.org List-Id: linux-mediatek@lists.infradead.org On Tue, 24 Sep 2019 07:46:18 +0000 wrote: > From: Tudor Ambarus > > static int write_enable(struct spi_nor *nor) > static int write_disable(struct spi_nor *nor) > become > static int spi_nor_write_enable(struct spi_nor *nor) > static int spi_nor_write_disable(struct spi_nor *nor) > > Check for errors after each call to them. Move them up in the > file as the first SPI NOR Register Operations, to avoid further > forward declarations. Same here, split that in 3 patches please. > > Signed-off-by: Tudor Ambarus > --- > drivers/mtd/spi-nor/spi-nor.c | 175 +++++++++++++++++++++++++++++------------- > 1 file changed, 120 insertions(+), 55 deletions(-) > > diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c > index 0fb124bd2e77..0aee068a5835 100644 > --- a/drivers/mtd/spi-nor/spi-nor.c > +++ b/drivers/mtd/spi-nor/spi-nor.c > @@ -389,6 +389,64 @@ static ssize_t spi_nor_write_data(struct spi_nor *nor, loff_t to, size_t len, > } > > /** > + * spi_nor_write_enable() - Set write enable latch with Write Enable command. > + * @nor: pointer to 'struct spi_nor' > + * > + * Return: 0 on success, -errno otherwise. > + */ > +static int spi_nor_write_enable(struct spi_nor *nor) > +{ > + int ret; > + > + if (nor->spimem) { > + struct spi_mem_op op = > + SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_WREN, 1), > + SPI_MEM_OP_NO_ADDR, > + SPI_MEM_OP_NO_DUMMY, > + SPI_MEM_OP_NO_DATA); > + > + ret = spi_mem_exec_op(nor->spimem, &op); > + } else { > + ret = nor->controller_ops->write_reg(nor, SPINOR_OP_WREN, > + NULL, 0); > + } > + > + if (ret) > + dev_err(nor->dev, "error %d on Write Enable\n", ret); Do we really need these error messages? I mean, if there's an error it should be propagated to the upper layer, so maybe we should use dev_dbg() here. > + > + return ret; > +} > + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D6AB7C4360C for ; Thu, 10 Oct 2019 07:21:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9C0EF20B7C for ; Thu, 10 Oct 2019 07:21:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sJsiFU4d" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C0EF20B7C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:References:In-Reply-To: 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: List-Owner; bh=eQrjFFKgmWRXl5Qni6W5DoXerVYNOeTG5FVjFBeQmhA=; b=sJsiFU4ddqTGGf 8UkucNS+gX4UdogQ0/k6CgZeYqg/LgVbW/KnJOP/qtP+c484rCvITxhxWNjvtjfcb5joDHGTMy/kU iB8W141LIKaMzRHrjC9UttLvp7KjQGZnp6AziapysjwLTZQfknBYhOtOx1iMJJQp7ZVMeQOnsOiCg APd96H8FkAA9NyJXgDQJ6EV5hVZAMUPGvhdUD26QsrSpPyAg3belXsm6mUYsxWLRZwNkxCqqpI8ZQ 1fEqFNxh7ICloQUaNBZRogpqUycJ89MP3or3peGfqeVXbMkoPGrVaR0cHRFSVdSJneIwGqDoDlFoq +3OPwoRsLKAkmrp5uVMg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iISlJ-000726-JI; Thu, 10 Oct 2019 07:21:25 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iISlG-00071X-4K; Thu, 10 Oct 2019 07:21:23 +0000 Received: from dhcp-172-31-174-146.wireless.concordia.ca (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: bbrezillon) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 46710290786; Thu, 10 Oct 2019 08:21:20 +0100 (BST) Date: Thu, 10 Oct 2019 09:21:17 +0200 From: Boris Brezillon To: Subject: Re: [PATCH v2 08/22] mtd: spi-nor: Rework write_enable/disable() Message-ID: <20191010092117.4c5018a8@dhcp-172-31-174-146.wireless.concordia.ca> In-Reply-To: <20190924074533.6618-9-tudor.ambarus@microchip.com> References: <20190924074533.6618-1-tudor.ambarus@microchip.com> <20190924074533.6618-9-tudor.ambarus@microchip.com> Organization: Collabora X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191010_002122_301828_4A0E3F7B X-CRM114-Status: GOOD ( 18.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, vigneshr@ti.com, geert+renesas@glider.be, andrew@aj.id.au, richard@nod.at, linux-kernel@vger.kernel.org, vz@mleia.com, marek.vasut@gmail.com, jonas@norrbonn.se, linux-mtd@lists.infradead.org, joel@jms.id.au, miquel.raynal@bootlin.com, matthias.bgg@gmail.com, linux-mediatek@lists.infradead.org, computersforpeace@gmail.com, dwmw2@infradead.org, linux-aspeed@lists.ozlabs.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, 24 Sep 2019 07:46:18 +0000 wrote: > From: Tudor Ambarus > > static int write_enable(struct spi_nor *nor) > static int write_disable(struct spi_nor *nor) > become > static int spi_nor_write_enable(struct spi_nor *nor) > static int spi_nor_write_disable(struct spi_nor *nor) > > Check for errors after each call to them. Move them up in the > file as the first SPI NOR Register Operations, to avoid further > forward declarations. Same here, split that in 3 patches please. > > Signed-off-by: Tudor Ambarus > --- > drivers/mtd/spi-nor/spi-nor.c | 175 +++++++++++++++++++++++++++++------------- > 1 file changed, 120 insertions(+), 55 deletions(-) > > diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c > index 0fb124bd2e77..0aee068a5835 100644 > --- a/drivers/mtd/spi-nor/spi-nor.c > +++ b/drivers/mtd/spi-nor/spi-nor.c > @@ -389,6 +389,64 @@ static ssize_t spi_nor_write_data(struct spi_nor *nor, loff_t to, size_t len, > } > > /** > + * spi_nor_write_enable() - Set write enable latch with Write Enable command. > + * @nor: pointer to 'struct spi_nor' > + * > + * Return: 0 on success, -errno otherwise. > + */ > +static int spi_nor_write_enable(struct spi_nor *nor) > +{ > + int ret; > + > + if (nor->spimem) { > + struct spi_mem_op op = > + SPI_MEM_OP(SPI_MEM_OP_CMD(SPINOR_OP_WREN, 1), > + SPI_MEM_OP_NO_ADDR, > + SPI_MEM_OP_NO_DUMMY, > + SPI_MEM_OP_NO_DATA); > + > + ret = spi_mem_exec_op(nor->spimem, &op); > + } else { > + ret = nor->controller_ops->write_reg(nor, SPINOR_OP_WREN, > + NULL, 0); > + } > + > + if (ret) > + dev_err(nor->dev, "error %d on Write Enable\n", ret); Do we really need these error messages? I mean, if there's an error it should be propagated to the upper layer, so maybe we should use dev_dbg() here. > + > + return ret; > +} > + _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel