All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Nikolaus Voss <nikolaus.voss@loewensteinmedical.de>,
	Javier Martinez Canillas <javierm@redhat.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Xiongfeng Wang <xiongfeng.wang@linaro.org>,
	linux-iio@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	nv@vosn.de
Subject: Re: [PATCH v2 2/2] IIO: st_accel_i2c.c: Use probe_new() instead of probe()
Date: Wed, 4 Jul 2018 13:19:26 +0300	[thread overview]
Message-ID: <CAHp75VcQrd134aA54_nZtGr3YaXAtwZLXpj6Oi1=BOSMynEvVQ@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1807041119360.8194@fox.voss.local>

Summon Javier to the discussion.
For my opinion he is an expert in this topic.

On Wed, Jul 4, 2018 at 12:42 PM, Nikolaus Voss
<nikolaus.voss@loewensteinmedical.de> wrote:
> On Wed, 4 Jul 2018, Andy Shevchenko wrote:
>> On Wed, Jul 4, 2018 at 12:09 PM, Nikolaus Voss
>> <nikolaus.voss@loewensteinmedical.de> wrote:
>>> On Wed, 4 Jul 2018, Andy Shevchenko wrote:
>>>> On Wed, Jul 4, 2018 at 9:37 AM, Nikolaus Voss
>>>> <nikolaus.voss@loewensteinmedical.de> wrote:
>>>>> On Wed, 4 Jul 2018, Andy Shevchenko wrote:
>>>>>> On Tue, Jul 3, 2018 at 9:06 AM, Nikolaus Voss
>>>>>> <nikolaus.voss@loewensteinmedical.de> wrote:

>>>>>>> struct i2c_device_id argument of probe() is not used, so use
>>>>>>> probe_new()
>>>>>>> instead.

>>>>>> This makes...
>>>>>>
>>>>>>>  MODULE_DEVICE_TABLE(i2c, st_accel_id_table);

>>>>>> ...this table obsolete IIUC. At least that's what I did when switched
>>>>>> to ->probe_new() in some drivers.
>>>>>>
>>>>>> If I'm mistaken (again? :-) ) I would hear from someone to point me
>>>>>> how it can be used after a switch.

>>>>> It is still used by the i2c-core in i2c_device_match() if DT and ACPI
>>>>> matching fails.

>>>>> And it is used to create the corresponding modaliases for
>>>>> driver loading.

>>>> My question is "How?!"
>>>> I don't really see any points to match against it after switching to
>>>> ->probe_new().
>>>>
>>>> Could you point me to the code path in i2c (or OF?) core for that?

>>> As written above in i2c-core-base.c: i2c_device_match() ->
>>> i2c_match_id(driver->id_table,...
>>>
>>> This is used for driver matching before probe() or probe_new() of the
>>> device
>>> driver can be called. probe_new() actually is a function signature change
>>> only.

>> Okay, IIUC we got a match. What should we do with it? The table is not
>> used in ->probe_new() (in i2c core), so, you can't say which line
>> matched there.

> The table is not used by the driver, but is necessary to
>
> a) bind an i2c device declared via i2c_board_info with type field set
>    to one of the names of the i2c_device_id table to this driver
> b) bind an i2c device declared via DT or ACPI but with no match in of_id/
>    acpi_id table but an i2c_device_id table match to this driver (fallback
>    matching)
> c) create the right modaliases at compile time for this driver to make
>    module auto-loading work in case of a) and b)

Javier, just a summary of the above. Nikolaus switched one driver to
use ->probe_new() hook and left i2c ID table at the same time.
My understanding that this table is not anymore in use.

But I have to admit I didn't see entire picture of this. Can you shed a light?

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2018-07-04 10:19 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-03  6:34 [PATCH v2 0/2] IIO: st_sensors_i2c: improve device enumeration Nikolaus Voss
2018-07-03  5:41 ` [PATCH v2 1/2] IIO: st_accel_i2c.c: Simplify access to driver data Nikolaus Voss
2018-07-03 21:07   ` Andy Shevchenko
2018-07-04  6:56     ` Nikolaus Voss
2018-07-04  9:00       ` Andy Shevchenko
2018-07-03  6:06 ` [PATCH v2 2/2] IIO: st_accel_i2c.c: Use probe_new() instead of probe() Nikolaus Voss
2018-07-03 22:54   ` Andy Shevchenko
2018-07-04  6:37     ` Nikolaus Voss
2018-07-04  8:58       ` Andy Shevchenko
2018-07-04  9:09         ` Nikolaus Voss
2018-07-04  9:16           ` Andy Shevchenko
2018-07-04  9:42             ` Nikolaus Voss
2018-07-04 10:19               ` Andy Shevchenko [this message]
2018-07-04 10:49                 ` Javier Martinez Canillas
2018-07-04 11:15                   ` Nikolaus Voss
2018-07-04 11:26                     ` Javier Martinez Canillas
2018-07-04 11:32                       ` Javier Martinez Canillas
2018-07-04 11:46                       ` Nikolaus Voss
2018-07-04 12:09                         ` Javier Martinez Canillas
2018-07-04 12:31                           ` Nikolaus Voss
2018-07-04 12:37                             ` Javier Martinez Canillas
2018-07-04 13:24                               ` Nikolaus Voss
2018-07-04 13:44                                 ` Javier Martinez Canillas
2018-07-04 16:11                                   ` Andy Shevchenko
2018-07-04 18:53                                     ` Javier Martinez Canillas

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='CAHp75VcQrd134aA54_nZtGr3YaXAtwZLXpj6Oi1=BOSMynEvVQ@mail.gmail.com' \
    --to=andy.shevchenko@gmail.com \
    --cc=javierm@redhat.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.bianconi83@gmail.com \
    --cc=nikolaus.voss@loewensteinmedical.de \
    --cc=nv@vosn.de \
    --cc=pmeerw@pmeerw.net \
    --cc=xiongfeng.wang@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.