From: Greg KH <gregkh@linuxfoundation.org>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: Arnd Bergmann <arnd@arndb.de>,
linux-arm-kernel@lists.infradead.org,
Russell King - ARM Linux <linux@arm.linux.org.uk>,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
cocci@systeme.lip6.fr
Subject: Re: [RFC] drop owner assignment from platform_drivers
Date: Sat, 11 Oct 2014 13:55:27 -0700 [thread overview]
Message-ID: <20141011205527.GA30877@kroah.com> (raw)
In-Reply-To: <20141011165650.GA1263@katana>
On Sat, Oct 11, 2014 at 06:56:51PM +0200, Wolfram Sang wrote:
>
> > > You got me wondering, though, that it could not be correct to call
> > > platform_driver_register() from the platform core instead of module
> > > init. I will check tomorrow. Still, this would be a bug independent of
> > > my series. Although I'd need to respin it if platform_driver_probe()
> > > needed a fix.
> >
> > Right, this seems to be a preexisting bug. platform_create_bundle
> > and platform_driver_probe will both overwrite the .owner field with
> > NULL since they live in builtin code. They need to be replaced with
> > __platform_driver_probe and __platform_driver_register that both
> > take an extra owner argument passed down from the caller in the driver
> > module.
>
> Yeah, that would be one solution. However, my personal favourite would
> meanwhile be to revert the commit that Russell mentioned. I think it is
> cleaner to have the owner explicitly set in the module rather than
> hidden away by a function call. However, grepping through include/linux,
> there are a few subsystems hiding it this way. So, it is a pattern
> somewhow. Oh well...
The pattern is to not have to manually set MODULE_OWNER, and have the
pre-processor do it for you, otherwise you will forget or get it wrong.
That is why I accepted this patch to the platform driver interface, as
it is in line with many other bus driver apis (pci, usb, etc.).
I missed the one code path you pointed out, and that should be fixed,
but that doesn't mean that the original patch should be reverted, as it
is the way we want things to be, let's just fix up the bug and move on.
And again, may I just say how much I hate the platform driver code, one
of these days I'm going to lock myself in a room for a week and figure
out a way to just delete that stuff...
greg k-h
next prev parent reply other threads:[~2014-10-11 20:56 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-10 7:24 [RFC] drop owner assignment from platform_drivers Wolfram Sang
2014-10-10 7:54 ` [Cocci] " Julia Lawall
2014-10-10 18:04 ` Wolfram Sang
2014-10-10 8:30 ` Arnd Bergmann
2014-10-10 18:12 ` Wolfram Sang
2014-10-10 19:39 ` Arnd Bergmann
2014-10-10 8:36 ` Russell King - ARM Linux
2014-10-10 18:26 ` Wolfram Sang
2014-10-10 19:42 ` Arnd Bergmann
2014-10-11 16:56 ` Wolfram Sang
2014-10-11 17:15 ` Russell King - ARM Linux
2014-10-11 20:55 ` Greg KH [this message]
2014-10-12 5:51 ` Wolfram Sang
2014-10-12 14:24 ` Greg KH
2014-10-12 17:01 ` Wolfram Sang
2014-10-10 21:34 ` Russell King - ARM Linux
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=20141011205527.GA30877@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=arnd@arndb.de \
--cc=cocci@systeme.lip6.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=wsa@the-dreams.de \
/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