public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Johan Hovold <johan@kernel.org>
Cc: "Rafał Miłecki" <zajec5@gmail.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] driver core: platform: document registration-failure requirement
Date: Wed, 22 Dec 2021 14:00:00 +0100	[thread overview]
Message-ID: <YcMhUDbemvo/n3mB@kroah.com> (raw)
In-Reply-To: <20211222104213.5673-1-johan@kernel.org>

On Wed, Dec 22, 2021 at 11:42:13AM +0100, Johan Hovold wrote:
> Add an explicit comment to document that the reference initialised by
> platform_device_register() needs to be released by a call to
> platform_device_put() also when registration fails (cf.
> device_register()).
> 
> Signed-off-by: Johan Hovold <johan@kernel.org>
> ---
> 
> Greg,
> 
> I took a quick look at driver code registering non-static platform
> devices and only found four drivers getting this wrong.
> 
> I've fixed up two of them and of the remaining two, one media driver is
> using devres (hurray!) and the other ignores registration failures
> completely anyway:
> 
> 	- vpif_probe()
> 	- sm501_register_device()
> 
> It seems to me that the right thing to do here, at least short term, is
> to add a comment clarifying this behaviour and fix up the few driver
> that got it wrong.

Looks good, thanks for this, now queued up.

greg k-h

      reply	other threads:[~2021-12-22 13:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22 10:42 [PATCH v2] driver core: platform: document registration-failure requirement Johan Hovold
2021-12-22 13:00 ` Greg Kroah-Hartman [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=YcMhUDbemvo/n3mB@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zajec5@gmail.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