Re: [PATCH 1/2] i2c: consider devices with of_match_table during i2c device probing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux