Linux SPI subsystem development
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Vladimir Oltean <olteanv@gmail.com>,
	Viresh Kumar <vireshk@kernel.org>,
	Rui Miguel Silva <rmfrfs@gmail.com>,
	Alex Elder <elder@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Lukas Wunner <lukas@wunner.de>,
	linux-media@vger.kernel.org, linux-spi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] spi: fix controller registration API inconsistency
Date: Thu, 21 May 2026 09:39:15 +0200	[thread overview]
Message-ID: <ag62oyX6ySknD6iV@hovoldconsulting.com> (raw)
In-Reply-To: <3016d236-ed02-4998-b1d7-c50a6fa2a7a4@sirena.org.uk>

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

On Wed, May 20, 2026 at 02:38:51PM +0100, Mark Brown wrote:
> On Tue, May 12, 2026 at 04:01:31PM +0200, Johan Hovold wrote:
> 
> > With most drivers converted to use managed allocation in preparation for
> > fixing the API, the remaining 16 drivers can be converted in one
> > tree-wide change. Ten of those drivers use the bitbang interface and can
> > be converted by simply removing the extra reference already taken by
> > spi_bitbang_start(). [4]
> 
> > Fix the API inconsistency by no longer dropping a reference when
> > deregistering non-devres allocated controllers.
> 
> > - *
> > - * On success, this routine will take a reference to the controller. The caller
> > - * is responsible for calling spi_bitbang_stop() to decrement the reference and
> > - * spi_controller_put() as counterpart of spi_alloc_host() to prevent a memory
> > - * leak.
> >   */
> 
> The xilinx and xtensa-xtfpga drivers use devm_spi_alloc_host() and
> spi_bitbang_start() but still call spi_controller_put() in their remove
> paths.

Thanks for catching that. I've just posted a v2 here:

	https://lore.kernel.org/r/20260521073816.766596-1-johan@kernel.org

Johan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 265 bytes --]

      reply	other threads:[~2026-05-21  7:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12 14:01 [PATCH] spi: fix controller registration API inconsistency Johan Hovold
2026-05-20 13:38 ` Mark Brown
2026-05-21  7:39   ` Johan Hovold [this message]

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=ag62oyX6ySknD6iV@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=broonie@kernel.org \
    --cc=elder@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=mchehab@kernel.org \
    --cc=olteanv@gmail.com \
    --cc=rmfrfs@gmail.com \
    --cc=vireshk@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