From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932477AbdJJQ0B (ORCPT ); Tue, 10 Oct 2017 12:26:01 -0400 Received: from smtp3-g21.free.fr ([212.27.42.3]:36264 "EHLO smtp3-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932345AbdJJQ0A (ORCPT ); Tue, 10 Oct 2017 12:26:00 -0400 Subject: Re: [PATCH v8 2/2] mtd: spi-nor: Add spi-nor mtd resume handler To: Kamal Dasu , marek.vasut@gmail.com Cc: boris.brezillon@free-electrons.com, f.fainelli@gmail.com, richard@nod.at, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, computersforpeace@gmail.com References: <1503434722-5429-1-git-send-email-kdasu.kdev@gmail.com> <1503434722-5429-3-git-send-email-kdasu.kdev@gmail.com> From: Cyrille Pitchen Message-ID: <479a28e4-19bf-514a-e3ca-67e9a2d193dd@wedev4u.fr> Date: Tue, 10 Oct 2017 18:25:58 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <1503434722-5429-3-git-send-email-kdasu.kdev@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 22/08/2017 à 22:45, Kamal Dasu a écrit : > Implemented and populated spi-nor mtd PM handlers for resume ops. > spi-nor resume op re-initializes spi-nor flash to its probed > state by calling the newly implemented spi_nor_init() function. > > Signed-off-by: Kamal Dasu Applied to the spi-nor/next branch of l2-mtd Thanks! > --- > drivers/mtd/spi-nor/spi-nor.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c > index ab98ecff..69164bc 100644 > --- a/drivers/mtd/spi-nor/spi-nor.c > +++ b/drivers/mtd/spi-nor/spi-nor.c > @@ -1871,6 +1871,19 @@ static int spi_nor_init(struct spi_nor *nor) > return 0; > } > > +/* mtd resume handler */ > +static void spi_nor_resume(struct mtd_info *mtd) > +{ > + struct spi_nor *nor = mtd_to_spi_nor(mtd); > + struct device *dev = nor->dev; > + int ret; > + > + /* re-initialize the nor chip */ > + ret = spi_nor_init(nor); > + if (ret) > + dev_err(dev, "resume() failed\n"); > +} > + > int spi_nor_scan(struct spi_nor *nor, const char *name, > const struct spi_nor_hwcaps *hwcaps) > { > @@ -1947,6 +1960,7 @@ int spi_nor_scan(struct spi_nor *nor, const char *name, > mtd->size = params.size; > mtd->_erase = spi_nor_erase; > mtd->_read = spi_nor_read; > + mtd->_resume = spi_nor_resume; > > /* NOR protection support for STmicro/Micron chips and similar */ > if (JEDEC_MFR(info) == SNOR_MFR_MICRON || >