linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Tudor.Ambarus@microchip.com>
To: <Claudiu.Beznea@microchip.com>, <broonie@kernel.org>,
	<Nicolas.Ferre@microchip.com>, <alexandre.belloni@bootlin.com>,
	<Ludovic.Desroches@microchip.com>
Cc: <linux-spi@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] spi: atmel-quadspi: fix crash while suspending
Date: Wed, 24 Apr 2019 12:21:47 +0000	[thread overview]
Message-ID: <27e8b8f3-5d83-c78b-e1b4-d7c7a150bce1@microchip.com> (raw)
In-Reply-To: <1556097463-29672-1-git-send-email-claudiu.beznea@microchip.com>



On 04/24/2019 12:17 PM, Claudiu.Beznea@microchip.com wrote:
> From: Claudiu Beznea <claudiu.beznea@microchip.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@microchip.com>

Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.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);
> 

  reply	other threads:[~2019-04-24 12:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-24  9:17 [PATCH] spi: atmel-quadspi: fix crash while suspending Claudiu.Beznea
2019-04-24 12:21 ` Tudor.Ambarus [this message]
2019-04-25 19:24 ` Applied "spi: atmel-quadspi: fix crash while suspending" to the spi tree Mark Brown
2019-04-25 19:26 ` Mark Brown
2019-05-02  2:18 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=27e8b8f3-5d83-c78b-e1b4-d7c7a150bce1@microchip.com \
    --to=tudor.ambarus@microchip.com \
    --cc=Claudiu.Beznea@microchip.com \
    --cc=Ludovic.Desroches@microchip.com \
    --cc=Nicolas.Ferre@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=broonie@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).