[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <27e8b8f3-5d83-c78b-e1b4-d7c7a150bce1@microchip.com>
Date: Wed, 24 Apr 2019 12:21:47 +0000
From: <Tudor.Ambarus@...rochip.com>
To: <Claudiu.Beznea@...rochip.com>, <broonie@...nel.org>,
<Nicolas.Ferre@...rochip.com>, <alexandre.belloni@...tlin.com>,
<Ludovic.Desroches@...rochip.com>
CC: <linux-spi@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] spi: atmel-quadspi: fix crash while suspending
On 04/24/2019 12:17 PM, Claudiu.Beznea@...rochip.com wrote:
> From: Claudiu Beznea <claudiu.beznea@...rochip.com>
>
> atmel_qspi objects are kept in spi_controller objects, so, first get
> pointer to spi_controller object and then get atmel_qspi object from
> spi_controller object.
>
> Fixes: 2d30ac5ed633 ("mtd: spi-nor: atmel-quadspi: Use spi-mem interface for atmel-quadspi driver")
> Signed-off-by: Claudiu Beznea <claudiu.beznea@...rochip.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@...rochip.com>
> ---
> drivers/spi/atmel-quadspi.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/spi/atmel-quadspi.c b/drivers/spi/atmel-quadspi.c
> index e54109759d34..9f24d5f0b431 100644
> --- a/drivers/spi/atmel-quadspi.c
> +++ b/drivers/spi/atmel-quadspi.c
> @@ -570,7 +570,8 @@ static int atmel_qspi_remove(struct platform_device *pdev)
>
> static int __maybe_unused atmel_qspi_suspend(struct device *dev)
> {
> - struct atmel_qspi *aq = dev_get_drvdata(dev);
> + struct spi_controller *ctrl = dev_get_drvdata(dev);
> + struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
>
> clk_disable_unprepare(aq->qspick);
> clk_disable_unprepare(aq->pclk);
> @@ -580,7 +581,8 @@ static int __maybe_unused atmel_qspi_suspend(struct device *dev)
>
> static int __maybe_unused atmel_qspi_resume(struct device *dev)
> {
> - struct atmel_qspi *aq = dev_get_drvdata(dev);
> + struct spi_controller *ctrl = dev_get_drvdata(dev);
> + struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
>
> clk_prepare_enable(aq->pclk);
> clk_prepare_enable(aq->qspick);
>
Powered by blists - more mailing lists