[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180203151125.GA17486@osadl.at>
Date: Sat, 3 Feb 2018 15:11:25 +0000
From: Nicholas Mc Guire <der.herr@...r.at>
To: Wolfram Sang <wsa@...-dreams.de>
Cc: Andy Shevchenko <andy.shevchenko@...il.com>,
Nicholas Mc Guire <hofrat@...dl.org>,
Jonathan Corbet <corbet@....net>,
linux-i2c <linux-i2c@...r.kernel.org>,
Linux Documentation List <linux-doc@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Documentation: i2c: drop unnecessary .owner field in
examples
On Mon, Jan 15, 2018 at 09:28:47PM +0100, Wolfram Sang wrote:
> On Mon, Jan 15, 2018 at 10:24:52PM +0200, Andy Shevchenko wrote:
> > On Mon, Jan 15, 2018 at 2:08 PM, Nicholas Mc Guire <hofrat@...dl.org> wrote:
> > > From: Nicholas Mc Guire <hofrat@...dl.at>
> > >
> > > Currently there are a few drivers that still set the .owner
> > > in the i2c_driver structure - all of which are reported by
> > > coccinelle (scripts/coccinelle/api/platform_no_drv_owner.cocci)
> > > and there are no cases that set the .onwer and do not call any
> > > of the functions that set the .owner field anyway in any of the
> > > drivers (checked by a modified coccinelle script based on the
> > > above) so it seems that the examples are no longer valid and
> > > .owner = THIS_MODULE, can be removed here.
> > >
> > > While at it an obvious typo (new new) was also fixed.
> >
> > AFAIU It is right only in case when someone does this, e.g.
> > module_i2c_driver() macro. Otherwise the field is pretty valid and
> > must be filled.
>
> It gets filled with i2c_add_driver. module_i2c_driver uses
> i2c_add_driver. I was about to suggest to keep the field in the old
> driver and describe that it can be removed when using one of
> i2c_add_driver or module_i2c_driver.
>
> But then I realised that the kernel tree does not have any such old
> drivers anymore and I couldn't even find out-of-tree code via some
> search engines (I tried looking for "I2C_CLIENT_INSMOD").
>
> I consider this obsolete and irrelevant these days. It might be good to
> simply remove it to not confuse users.
>
Not sure what the status of this is now - but I would
want to clean up some of the coccinelle findings - as a pre-requisite
it would make sense to either drop the examples inclusion of
.owner = THIS_MODULE or add a note in the documentation making
clear that this is only needed in case where the appropriate
module initialization helpers are not used. Is there any good
reason *not* to use these initialization helpers when upgrading
a driver ? If not (and I could not find one) then it might simply
be the right way to recommend using the initialization helpers and
drop the .owner = THIS_MODULE from the examples.
Anyway - cleaning up coccinelle findings would seem futile if the
documentation may be the cause.
thx!
hofrat
Powered by blists - more mailing lists