public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: bugalski.piotr@gmail.com (Piotr Bugalski)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 1/2] spi: Add QuadSPI driver for Atmel SAMA5D2
Date: Wed, 20 Jun 2018 16:31:13 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1806201627330.26137@carbonite> (raw)
In-Reply-To: <20180619151506.GG11230@sirena.org.uk>

Hi Mark,

Thank you very much for quick answer.

On Tue, 19 Jun 2018, Mark Brown wrote:

> On Mon, Jun 18, 2018 at 06:21:23PM +0200, Piotr Bugalski wrote:
>
>> +static int atmel_qspi_adjust_op_size(struct spi_mem *mem, struct spi_mem_op *op)
>> +{
>> +	return 0;
>> +}
>
> If this can be empty should we adjust the callers to allow it to just be
> omitted?
>

If I remember well some commits ago spi-mem required even empty 
adjust_op_size. Now it seems unnecessary, but I forgot to remove the 
code. I will fix it in next version.

>> +static int atmel_qspi_remove(struct platform_device *pdev)
>> +{
>> +	struct spi_controller *ctrl = platform_get_drvdata(pdev);
>> +	struct atmel_qspi *aq = spi_controller_get_devdata(ctrl);
>> +
>> +	qspi_writel(aq, QSPI_CR, QSPI_CR_QSPIDIS);
>> +	clk_disable_unprepare(aq->clk);
>> +
>> +	spi_unregister_controller(ctrl);
>> +
>> +	return 0;
>> +}
>
> You should unregister the controller before disabling the hardware,
> otherwise something could come in and try to start an operation on the
> controller (or already be running one) while the hardware is disabled
> which might blow up.
>

Sure, deinit should be done in reverse order of init, you are perfectly 
right, just my mistake. I'll fix it in next version.

Best Regards,
Piotr

  reply	other threads:[~2018-06-20 14:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-18 16:21 [RFC PATCH 0/2] New QuadSPI driver for Atmel SAMA5D2 Piotr Bugalski
2018-06-18 16:21 ` [RFC PATCH 1/2] spi: Add " Piotr Bugalski
2018-06-19 15:15   ` Mark Brown
2018-06-20 14:31     ` Piotr Bugalski [this message]
2018-06-21 21:33   ` Boris Brezillon
2018-06-22  5:57     ` Piotr Bugalski
2018-06-22  7:39       ` Boris Brezillon
2018-06-26 14:44         ` Tudor Ambarus
2018-06-27  7:52           ` Piotr Bugalski
2018-06-28  8:37             ` Tudor Ambarus
2018-06-28 12:02               ` Piotr Bugalski
2018-06-18 16:21 ` [RFC PATCH 2/2] dt-bindings: spi: QuadSPI driver for Atmel SAMA5D2 documentation Piotr Bugalski
2018-06-20 14:47   ` Boris Brezillon
2018-06-21 10:56     ` Piotr Bugalski
2018-06-20 14:54 ` [RFC PATCH 0/2] New QuadSPI driver for Atmel SAMA5D2 Boris Brezillon
2018-06-21 10:52   ` Piotr Bugalski

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=alpine.DEB.2.20.1806201627330.26137@carbonite \
    --to=bugalski.piotr@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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