linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] spi: core: Introduce devm_spi_alloc_master
Date: Fri, 31 Jan 2014 12:12:15 +0000	[thread overview]
Message-ID: <20140131121215.GB22609@sirena.org.uk> (raw)
In-Reply-To: <1391163792-21819-1-git-send-email-maxime.ripard@free-electrons.com>

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

On Fri, Jan 31, 2014 at 11:23:09AM +0100, Maxime Ripard wrote:

> This patchset introduces a devm_spi_alloc_master to the spi core. While most of
> the drivers have a spi_master_put call in the probe, a lot of them using the
> devm_spi_register_master function are missing it in the remove function,
> leading to leaked resources.

This seems confusing - the idea here is that if we've handed the device
off to the managed function then the managed function deals with
destroying it.  Note that spi_alloc_master() says that the put is only
required after errors adding the device (which would be the expected
behaviour if you look at other APIs).  Looking at the code I think there
is an issue here but I'm not at all clear that this is the best fix.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2014-01-31 12:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-31 10:23 [PATCH 0/3] spi: core: Introduce devm_spi_alloc_master Maxime Ripard
2014-01-31 10:23 ` [PATCH 1/3] spi: core: Add devm_spi_alloc_master Maxime Ripard
2014-01-31 10:23 ` [PATCH 2/3] spi: core: Update the devm_spi_register_master documentation Maxime Ripard
2014-01-31 10:23 ` [PATCH 3/3] spi: switch to devm_spi_alloc_master Maxime Ripard
2014-01-31 16:18   ` Stephen Warren
2014-01-31 22:49     ` Maxime Ripard
2014-02-02 12:33   ` Gerhard Sittig
2014-01-31 12:12 ` Mark Brown [this message]
2014-01-31 13:31   ` [PATCH 0/3] spi: core: Introduce devm_spi_alloc_master Maxime Ripard
2014-02-01 17:38     ` Mark Brown
2014-02-02 14:54       ` Maxime Ripard

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=20140131121215.GB22609@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    /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).