linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] i2c: Finalize the .probe_new() quest
@ 2023-09-05 19:42 Uwe Kleine-König
  2023-09-05 19:42 ` [PATCH 1/2] w1: ds2482: Switch back to use struct i2c_driver's .probe() Uwe Kleine-König
  2023-09-05 19:42 ` [PATCH 2/2] i2c: Drop legacy callback .probe_new() Uwe Kleine-König
  0 siblings, 2 replies; 10+ messages in thread
From: Uwe Kleine-König @ 2023-09-05 19:42 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Krzysztof Kozlowski, linux-i2c, kernel, Lee Jones

Hello,

this patch set finally drops .probe_new() from struct i2c_driver after
it was "temporarily" introduced in 2016 with commit b8a1a4cd5a98 ("i2c:
Provide a temporary .probe_new() call-back type")

Since commit 2be6bc48df59 ("Merge tag 'leds-next-6.6' of
git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds") all users of
.probe_new() are gone from Linus's tree apart from
drivers/w1/masters/ds2482.c. Krzysztof as w1 maintainer asked to take
the patch converting drivers/w1/masters/ds2482.c back to .probe() via
i2c together with the patch dropping .probe_new(). 

@wsa: Both patches have a Link: footer, I was unsure if I should keep it or
not. Feel free to drop them if you like it better this way.

In next are no new usages of .probe_new() and also I handled all
submission listed on https://lore.kernel.org/all/?q=dfb:probe_new to
prevent new usages. I'll continue to monitor the incoming patches for a
while.

According to

	git lg -S.probe_new --author=Kleine-König b8a1a4cd5a98..3f86ed6ec0b3 | wc -l

this quest needed 695 patches, thanks to all maintainers and reviewers for
caring about these, and sorry to all recipients of the patches for
filling their inboxes :-)

I suggest to apply this series on top of v6.6-rc1 in Wolfram's
i2c/for-next. I expect that a stable branch for merging into other trees
won't be necessary, but if it's applied directly on top of v6.6-rc1 we
have the option to create such a branch if and when the need arises.

Best regards
Uwe

Uwe Kleine-König (2):
  w1: ds2482: Switch back to use struct i2c_driver's .probe()
  i2c: Drop legacy callback .probe_new()

 drivers/w1/masters/ds2482.c |  2 +-
 include/linux/i2c.h         | 11 +----------
 2 files changed, 2 insertions(+), 11 deletions(-)

base-commit: 3f86ed6ec0b390c033eae7f9c487a3fea268e027
-- 
2.40.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/2] w1: ds2482: Switch back to use struct i2c_driver's .probe()
  2023-09-05 19:42 [PATCH 0/2] i2c: Finalize the .probe_new() quest Uwe Kleine-König
@ 2023-09-05 19:42 ` Uwe Kleine-König
  2023-09-13  8:50   ` Wolfram Sang
  2023-09-05 19:42 ` [PATCH 2/2] i2c: Drop legacy callback .probe_new() Uwe Kleine-König
  1 sibling, 1 reply; 10+ messages in thread
From: Uwe Kleine-König @ 2023-09-05 19:42 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Krzysztof Kozlowski, linux-i2c, kernel, Lee Jones

After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
commit 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter")
convert back to (the new) .probe() to be able to eventually drop
.probe_new() from struct i2c_driver.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/lkml/20230612072807.839689-1-u.kleine-koenig@pengutronix.de/
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/w1/masters/ds2482.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/w1/masters/ds2482.c b/drivers/w1/masters/ds2482.c
index c1de8a92e144..b2d76c1784bd 100644
--- a/drivers/w1/masters/ds2482.c
+++ b/drivers/w1/masters/ds2482.c
@@ -551,7 +551,7 @@ static struct i2c_driver ds2482_driver = {
 	.driver = {
 		.name	= "ds2482",
 	},
-	.probe_new	= ds2482_probe,
+	.probe		= ds2482_probe,
 	.remove		= ds2482_remove,
 	.id_table	= ds2482_id,
 };
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/2] i2c: Drop legacy callback .probe_new()
  2023-09-05 19:42 [PATCH 0/2] i2c: Finalize the .probe_new() quest Uwe Kleine-König
  2023-09-05 19:42 ` [PATCH 1/2] w1: ds2482: Switch back to use struct i2c_driver's .probe() Uwe Kleine-König
@ 2023-09-05 19:42 ` Uwe Kleine-König
  2023-09-13  8:50   ` Wolfram Sang
  2023-09-14  9:45   ` Lee Jones
  1 sibling, 2 replies; 10+ messages in thread
From: Uwe Kleine-König @ 2023-09-05 19:42 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-i2c, kernel, Lee Jones, Javier Martinez Canillas,
	Jean Delvare

Now that all drivers are converted to the (new) .probe() callback, the
temporary .probe_new() can go away. \o/

Link: https://lore.kernel.org/linux-i2c/20230626094548.559542-1-u.kleine-koenig@pengutronix.de
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 include/linux/i2c.h | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 3430cc2b05a6..0dae9db27538 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -237,7 +237,6 @@ enum i2c_driver_flags {
  * struct i2c_driver - represent an I2C device driver
  * @class: What kind of i2c device we instantiate (for detect)
  * @probe: Callback for device binding
- * @probe_new: Transitional callback for device binding - do not use
  * @remove: Callback for device unbinding
  * @shutdown: Callback for device shutdown
  * @alert: Alert callback, for example for the SMBus alert protocol
@@ -272,16 +271,8 @@ enum i2c_driver_flags {
 struct i2c_driver {
 	unsigned int class;
 
-	union {
 	/* Standard driver model interfaces */
-		int (*probe)(struct i2c_client *client);
-		/*
-		 * Legacy callback that was part of a conversion of .probe().
-		 * Today it has the same semantic as .probe(). Don't use for new
-		 * code.
-		 */
-		int (*probe_new)(struct i2c_client *client);
-	};
+	int (*probe)(struct i2c_client *client);
 	void (*remove)(struct i2c_client *client);
 
 
-- 
2.40.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 1/2] w1: ds2482: Switch back to use struct i2c_driver's .probe()
  2023-09-05 19:42 ` [PATCH 1/2] w1: ds2482: Switch back to use struct i2c_driver's .probe() Uwe Kleine-König
@ 2023-09-13  8:50   ` Wolfram Sang
  0 siblings, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2023-09-13  8:50 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Krzysztof Kozlowski, linux-i2c, kernel, Lee Jones

[-- Attachment #1: Type: text/plain, Size: 668 bytes --]

On Tue, Sep 05, 2023 at 09:42:52PM +0200, Uwe Kleine-König wrote:
> After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()
> call-back type"), all drivers being converted to .probe_new() and then
> commit 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter")
> convert back to (the new) .probe() to be able to eventually drop
> .probe_new() from struct i2c_driver.
> 
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Link: https://lore.kernel.org/lkml/20230612072807.839689-1-u.kleine-koenig@pengutronix.de/
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Applied to for-current, thanks!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] i2c: Drop legacy callback .probe_new()
  2023-09-05 19:42 ` [PATCH 2/2] i2c: Drop legacy callback .probe_new() Uwe Kleine-König
@ 2023-09-13  8:50   ` Wolfram Sang
  2023-09-20  6:54     ` Uwe Kleine-König
  2023-09-14  9:45   ` Lee Jones
  1 sibling, 1 reply; 10+ messages in thread
From: Wolfram Sang @ 2023-09-13  8:50 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-i2c, kernel, Lee Jones, Javier Martinez Canillas,
	Jean Delvare

[-- Attachment #1: Type: text/plain, Size: 539 bytes --]

On Tue, Sep 05, 2023 at 09:42:53PM +0200, Uwe Kleine-König wrote:
> Now that all drivers are converted to the (new) .probe() callback, the
> temporary .probe_new() can go away. \o/
> 
> Link: https://lore.kernel.org/linux-i2c/20230626094548.559542-1-u.kleine-koenig@pengutronix.de
> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
> Reviewed-by: Jean Delvare <jdelvare@suse.de>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Aaaaaand applied to for-current, thanks! Hooray \o/ Thank you, Uwe!


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] i2c: Drop legacy callback .probe_new()
  2023-09-05 19:42 ` [PATCH 2/2] i2c: Drop legacy callback .probe_new() Uwe Kleine-König
  2023-09-13  8:50   ` Wolfram Sang
@ 2023-09-14  9:45   ` Lee Jones
  1 sibling, 0 replies; 10+ messages in thread
From: Lee Jones @ 2023-09-14  9:45 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Wolfram Sang, linux-i2c, kernel, Javier Martinez Canillas,
	Jean Delvare

On Tue, 05 Sep 2023, Uwe Kleine-König wrote:

> Now that all drivers are converted to the (new) .probe() callback, the
> temporary .probe_new() can go away. \o/
> 
> Link: https://lore.kernel.org/linux-i2c/20230626094548.559542-1-u.kleine-koenig@pengutronix.de
> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
> Reviewed-by: Jean Delvare <jdelvare@suse.de>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  include/linux/i2c.h | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)
> 
> diff --git a/include/linux/i2c.h b/include/linux/i2c.h
> index 3430cc2b05a6..0dae9db27538 100644
> --- a/include/linux/i2c.h
> +++ b/include/linux/i2c.h
> @@ -237,7 +237,6 @@ enum i2c_driver_flags {
>   * struct i2c_driver - represent an I2C device driver
>   * @class: What kind of i2c device we instantiate (for detect)
>   * @probe: Callback for device binding
> - * @probe_new: Transitional callback for device binding - do not use
>   * @remove: Callback for device unbinding
>   * @shutdown: Callback for device shutdown
>   * @alert: Alert callback, for example for the SMBus alert protocol
> @@ -272,16 +271,8 @@ enum i2c_driver_flags {
>  struct i2c_driver {
>  	unsigned int class;
>  
> -	union {
>  	/* Standard driver model interfaces */
> -		int (*probe)(struct i2c_client *client);
> -		/*
> -		 * Legacy callback that was part of a conversion of .probe().
> -		 * Today it has the same semantic as .probe(). Don't use for new
> -		 * code.
> -		 */
> -		int (*probe_new)(struct i2c_client *client);
> -	};
> +	int (*probe)(struct i2c_client *client);
>  	void (*remove)(struct i2c_client *client);

*party smiley*

Good going Uwe!

-- 
Lee Jones [李琼斯]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] i2c: Drop legacy callback .probe_new()
  2023-09-13  8:50   ` Wolfram Sang
@ 2023-09-20  6:54     ` Uwe Kleine-König
  2023-09-20  9:04       ` Wolfram Sang
  0 siblings, 1 reply; 10+ messages in thread
From: Uwe Kleine-König @ 2023-09-20  6:54 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c, kernel, Lee Jones,
	Javier Martinez Canillas, Jean Delvare

[-- Attachment #1: Type: text/plain, Size: 916 bytes --]

Hello Wolfram,

On Wed, Sep 13, 2023 at 10:50:41AM +0200, Wolfram Sang wrote:
> On Tue, Sep 05, 2023 at 09:42:53PM +0200, Uwe Kleine-König wrote:
> > Now that all drivers are converted to the (new) .probe() callback, the
> > temporary .probe_new() can go away. \o/
> > 
> > Link: https://lore.kernel.org/linux-i2c/20230626094548.559542-1-u.kleine-koenig@pengutronix.de
> > Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
> > Reviewed-by: Jean Delvare <jdelvare@suse.de>
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> Aaaaaand applied to for-current, thanks! Hooray \o/ Thank you, Uwe!

you even took it via a faster path than I expected (i.e. it went in for
6.6-rc2 instead of 6.7-rc1).

Thanks!
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] i2c: Drop legacy callback .probe_new()
  2023-09-20  6:54     ` Uwe Kleine-König
@ 2023-09-20  9:04       ` Wolfram Sang
  2023-09-20  9:43         ` Uwe Kleine-König
  0 siblings, 1 reply; 10+ messages in thread
From: Wolfram Sang @ 2023-09-20  9:04 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-i2c, kernel, Lee Jones, Javier Martinez Canillas,
	Jean Delvare

[-- Attachment #1: Type: text/plain, Size: 150 bytes --]


> you even took it via a faster path than I expected (i.e. it went in for
> 6.6-rc2 instead of 6.7-rc1).

Was that bad? Was there a reason to wait?


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] i2c: Drop legacy callback .probe_new()
  2023-09-20  9:04       ` Wolfram Sang
@ 2023-09-20  9:43         ` Uwe Kleine-König
  2023-09-20  9:47           ` Wolfram Sang
  0 siblings, 1 reply; 10+ messages in thread
From: Uwe Kleine-König @ 2023-09-20  9:43 UTC (permalink / raw)
  To: Wolfram Sang, linux-i2c, kernel, Lee Jones,
	Javier Martinez Canillas, Jean Delvare

[-- Attachment #1: Type: text/plain, Size: 650 bytes --]

Hello Wolfram,

On Wed, Sep 20, 2023 at 11:04:07AM +0200, Wolfram Sang wrote:
> 
> > you even took it via a faster path than I expected (i.e. it went in for
> > 6.6-rc2 instead of 6.7-rc1).
> 
> Was that bad? Was there a reason to wait?

No, it's great. This way I can reduce my checks about new drivers being
added that get it wrong. I just expected that this change doesn't
qualify to be applied after -rc1 and I'd have to wait for the next merge
window.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 2/2] i2c: Drop legacy callback .probe_new()
  2023-09-20  9:43         ` Uwe Kleine-König
@ 2023-09-20  9:47           ` Wolfram Sang
  0 siblings, 0 replies; 10+ messages in thread
From: Wolfram Sang @ 2023-09-20  9:47 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: linux-i2c, kernel, Lee Jones, Javier Martinez Canillas,
	Jean Delvare

[-- Attachment #1: Type: text/plain, Size: 338 bytes --]


> added that get it wrong. I just expected that this change doesn't
> qualify to be applied after -rc1 and I'd have to wait for the next merge
> window.

When something is cleaned up with rc1, then removing deprecated
interfaces for rc2 always worked for me. As you said, it prevents people
from using the old interface again.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-09-20  9:47 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-05 19:42 [PATCH 0/2] i2c: Finalize the .probe_new() quest Uwe Kleine-König
2023-09-05 19:42 ` [PATCH 1/2] w1: ds2482: Switch back to use struct i2c_driver's .probe() Uwe Kleine-König
2023-09-13  8:50   ` Wolfram Sang
2023-09-05 19:42 ` [PATCH 2/2] i2c: Drop legacy callback .probe_new() Uwe Kleine-König
2023-09-13  8:50   ` Wolfram Sang
2023-09-20  6:54     ` Uwe Kleine-König
2023-09-20  9:04       ` Wolfram Sang
2023-09-20  9:43         ` Uwe Kleine-König
2023-09-20  9:47           ` Wolfram Sang
2023-09-14  9:45   ` Lee Jones

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).