diff mbox series

[1/4] eeprom: at24: don't assign the i2c ID table to at24_driver

Message ID 20180410131206.25760-2-brgl@bgdev.pl
State Superseded
Headers show
Series eeprom: at24: last bits of the big refactoring | expand

Commit Message

Bartosz Golaszewski April 10, 2018, 1:12 p.m. UTC
We switched to using probe_new(), so this is no longer used
by i2c core.

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
---
 drivers/misc/eeprom/at24.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Peter Rosin April 11, 2018, 9:56 a.m. UTC | #1
On 2018-04-10 15:12, Bartosz Golaszewski wrote:
> We switched to using probe_new(), so this is no longer used
> by i2c core.

It seems to be used in i2c_device_match() ???

This could easily be me not understanding something...

Cheers,
Peter

> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
> ---
>  drivers/misc/eeprom/at24.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
> index 0c125f207aea..2310f26ac4f3 100644
> --- a/drivers/misc/eeprom/at24.c
> +++ b/drivers/misc/eeprom/at24.c
> @@ -737,7 +737,6 @@ static struct i2c_driver at24_driver = {
>  	},
>  	.probe_new = at24_probe,
>  	.remove = at24_remove,
> -	.id_table = at24_ids,
>  };
>  
>  static int __init at24_init(void)
>
Bartosz Golaszewski April 11, 2018, 10:09 a.m. UTC | #2
2018-04-11 11:56 GMT+02:00 Peter Rosin <peda@axentia.se>:
> On 2018-04-10 15:12, Bartosz Golaszewski wrote:
>> We switched to using probe_new(), so this is no longer used
>> by i2c core.
>
> It seems to be used in i2c_device_match() ???
>
> This could easily be me not understanding something...
>

Yes, but i2c core no longer uses the id_table field in struct
i2c_driver. We call i2c_device_match() ourselves instead of letting
i2c core do it and pass the driver data to probe().

Hope that helps,
Bartosz
Peter Rosin April 11, 2018, 10:12 a.m. UTC | #3
On 2018-04-11 12:09, Bartosz Golaszewski wrote:
> 2018-04-11 11:56 GMT+02:00 Peter Rosin <peda@axentia.se>:
>> On 2018-04-10 15:12, Bartosz Golaszewski wrote:
>>> We switched to using probe_new(), so this is no longer used
>>> by i2c core.
>>
>> It seems to be used in i2c_device_match() ???
>>
>> This could easily be me not understanding something...
>>
> 
> Yes, but i2c core no longer uses the id_table field in struct
> i2c_driver. We call i2c_device_match() ourselves instead of letting
> i2c core do it and pass the driver data to probe().
> 
> Hope that helps,
> Bartosz
> 

But, i2c_device_match is a static function in the core. I think you
are confusing it with i2c_match_id, which is in fact called from
the static i2c_device_match (with is a bus operation).

So, no, it didn't really help...

Cheers,
Peter
Bartosz Golaszewski April 11, 2018, 11:14 a.m. UTC | #4
2018-04-11 12:12 GMT+02:00 Peter Rosin <peda@axentia.se>:
> On 2018-04-11 12:09, Bartosz Golaszewski wrote:
>> 2018-04-11 11:56 GMT+02:00 Peter Rosin <peda@axentia.se>:
>>> On 2018-04-10 15:12, Bartosz Golaszewski wrote:
>>>> We switched to using probe_new(), so this is no longer used
>>>> by i2c core.
>>>
>>> It seems to be used in i2c_device_match() ???
>>>
>>> This could easily be me not understanding something...
>>>
>>
>> Yes, but i2c core no longer uses the id_table field in struct
>> i2c_driver. We call i2c_device_match() ourselves instead of letting
>> i2c core do it and pass the driver data to probe().
>>
>> Hope that helps,
>> Bartosz
>>
>
> But, i2c_device_match is a static function in the core. I think you
> are confusing it with i2c_match_id, which is in fact called from
> the static i2c_device_match (with is a bus operation).
>

Right. So probe_new() in i2c no longer has the id parameter and the
users are supposed to call i2c_match_id() themselves but
i2c_device_match() still expects the id_table to be present in struct
i2c_driver. I should have tested it with some board that uses platform
data.

Consider this patch dropped.

Thanks for spotting that,
Bartosz
diff mbox series

Patch

diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index 0c125f207aea..2310f26ac4f3 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -737,7 +737,6 @@  static struct i2c_driver at24_driver = {
 	},
 	.probe_new = at24_probe,
 	.remove = at24_remove,
-	.id_table = at24_ids,
 };
 
 static int __init at24_init(void)