From: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Wolfram Sang <wsa@kernel.org>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] i2c: consider devices with of_match_table during i2c device probing
Date: Wed, 26 Aug 2020 19:24:11 +0900 [thread overview]
Message-ID: <20200826102411.GC8849@jagdpanzerIV.localdomain> (raw)
In-Reply-To: <20200826095617.GH1891694@smile.fi.intel.com>
On (20/08/26 12:56), Andy Shevchenko wrote:
> > You probably meant simply:
> >
> > if (!i2c_device_match(dev, dev->driver)) {
> >
> > > status = -ENODEV;
> > > goto put_sync_adapter;
> > > }
> >
> > On the first glance it will work the same way but slightly longer in case of ID
> > table matching.
> >
> > Send a patch!
>
> But then the question is why we have this code in the ->probe() at all?
> ->match() is run before probe by bus core, no?
That's a good question.
There is also one more .id_table traversal done right before ->probe()
call:
driver->probe(client, i2c_match_id(driver->id_table, client))
So in the worst case we can end up doing 3 .id_table lookups.
-ss
next prev parent reply other threads:[~2020-08-26 10:24 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-26 4:29 [PATCH 1/2] i2c: consider devices with of_match_table during i2c device probing Sergey Senozhatsky
2020-08-26 4:29 ` [PATCH 2/2] i2c: do not export i2c_of_match_device() symbol Sergey Senozhatsky
2020-08-26 5:07 ` [PATCH 1/2] i2c: consider devices with of_match_table during i2c device probing Sergey Senozhatsky
2020-08-26 5:08 ` Wolfram Sang
2020-08-26 5:25 ` Sergey Senozhatsky
2020-08-26 9:53 ` Andy Shevchenko
2020-08-26 9:56 ` Andy Shevchenko
2020-08-26 10:24 ` Sergey Senozhatsky [this message]
2020-08-26 10:38 ` Sergey Senozhatsky
2020-08-26 10:54 ` Andy Shevchenko
2020-08-26 11:23 ` Wolfram Sang
2020-08-26 14:18 ` Sergey Senozhatsky
2020-08-26 14:34 ` Andy Shevchenko
2020-08-26 14:50 ` Sergey Senozhatsky
2020-08-26 10:09 ` Sergey Senozhatsky
2020-08-26 7:19 ` kernel test robot
2020-08-26 12:38 ` kernel test robot
2020-08-26 12:56 ` kernel test robot
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=20200826102411.GC8849@jagdpanzerIV.localdomain \
--to=sergey.senozhatsky@gmail.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mika.westerberg@linux.intel.com \
--cc=wsa@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox