From: Wolfram Sang <hidden> Date: 2018-08-21 15:02:58
So, I wanted to do this in the next cycle, but Linus seems to want it this
cycle already [1], so here it is:
Remove the attach_adapter callback from the 2.4 times by converting
the last user to a custom probing mechanism based on deferred probing. We used
this already in commit ac397c80de89 ("ALSA: ppc: keywest: drop using attach
adapter") successfully on HW, so we agreed to use it on the windtunnel driver
as well.
With the last user gone, we can then remove the callback \o/ I think this
allows for more cleanup in the core, but let's do this later and focus on the
removal for now.
Tested on a Renesas R-Car Salvator-XS board (M3N) by using and rebinding
various I2C busses. Build bot and checkpatch are happy, too.
I'd like to send a pull request to Linus this merge window, so looking forward
to super fast comments, acks, etc...
Thanks,
Wolfram
[1] http://patchwork.ozlabs.org/patch/959322/#1976742
Wolfram Sang (2):
macintosh: therm_windtunnel: drop using attach_adapter
i2c: remove deprecated attach_adapter callback
drivers/i2c/i2c-core-base.c | 11 +----------
drivers/macintosh/therm_windtunnel.c | 25 +++++++++++++++++++++++--
include/linux/i2c.h | 6 ------
3 files changed, 24 insertions(+), 18 deletions(-)
--
2.11.0
From: Wolfram Sang <hidden> Date: 2018-08-21 15:02:48
As we now have deferred probing, we can use a custom mechanism and
finally get rid of the legacy interface from the i2c core.
Signed-off-by: Wolfram Sang <redacted>
---
drivers/macintosh/therm_windtunnel.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
From: Wolfram Sang <hidden> Date: 2018-08-21 15:02:52
There aren't any users left. Remove this callback from the 2.4 times.
Phew, finally, that took years to reach...
Signed-off-by: Wolfram Sang <redacted>
---
drivers/i2c/i2c-core-base.c | 11 +----------
include/linux/i2c.h | 6 ------
2 files changed, 1 insertion(+), 16 deletions(-)
@@ -1124,15 +1124,6 @@ static int i2c_do_add_adapter(struct i2c_driver *driver,/* Detect supported devices on that bus, and instantiate them */i2c_detect(adap,driver);-/* Let legacy drivers scan this bus for matching devices */-if(driver->attach_adapter){-dev_warn(&adap->dev,"%s: attach_adapter method is deprecated\n",-driver->driver.name);-dev_warn(&adap->dev,-"Please use another way to instantiate your i2c_client\n");-/* We ignore the return code; if it fails, too bad */-driver->attach_adapter(adap);-}return0;}
@@ -268,11 +267,6 @@ enum i2c_alert_protocol {structi2c_driver{unsignedintclass;-/* Notifies the driver that a new bus has appeared. You should avoid-*usingthis,itwillberemovedinanearfuture.-*/-int(*attach_adapter)(structi2c_adapter*)__deprecated;-/* Standard driver model interfaces */int(*probe)(structi2c_client*,conststructi2c_device_id*);int(*remove)(structi2c_client*);
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2018-08-23 03:31:02
Wolfram Sang [off-list ref] writes:
So, I wanted to do this in the next cycle, but Linus seems to want it this
cycle already [1], so here it is:
Remove the attach_adapter callback from the 2.4 times by converting
the last user to a custom probing mechanism based on deferred probing. We used
this already in commit ac397c80de89 ("ALSA: ppc: keywest: drop using attach
adapter") successfully on HW, so we agreed to use it on the windtunnel driver
as well.
With the last user gone, we can then remove the callback \o/ I think this
allows for more cleanup in the core, but let's do this later and focus on the
removal for now.
Tested on a Renesas R-Car Salvator-XS board (M3N) by using and rebinding
various I2C busses. Build bot and checkpatch are happy, too.
I'd like to send a pull request to Linus this merge window, so looking forward
to super fast comments, acks, etc...
Sure, I don't have a G4 hooked up to test this, so just merge it and if
it breaks we can fix it.
cheers
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2018-08-23 03:31:43
Wolfram Sang [off-list ref] writes:
As we now have deferred probing, we can use a custom mechanism and
finally get rid of the legacy interface from the i2c core.
Signed-off-by: Wolfram Sang <redacted>
---
drivers/macintosh/therm_windtunnel.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
I don't have a G4 to test this on, so merge it and if it breaks we can
fix it up later.
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
cheers
From: Wolfram Sang <hidden> Date: 2018-08-24 12:47:47
On Tue, Aug 21, 2018 at 05:02:39PM +0200, Wolfram Sang wrote:
As we now have deferred probing, we can use a custom mechanism and
finally get rid of the legacy interface from the i2c core.
Signed-off-by: Wolfram Sang <redacted>
From: Wolfram Sang <hidden> Date: 2018-08-24 12:47:54
On Tue, Aug 21, 2018 at 05:02:40PM +0200, Wolfram Sang wrote:
There aren't any users left. Remove this callback from the 2.4 times.
Phew, finally, that took years to reach...
Signed-off-by: Wolfram Sang <redacted>