linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build failure after merge of the mfd tree
@ 2023-03-31  1:15 Stephen Rothwell
  2023-03-31  7:03 ` [PATCH] mfd: rsmu_i2c: Convert to i2c's .probe_new() again Uwe Kleine-König
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2023-03-31  1:15 UTC (permalink / raw)
  To: Lee Jones
  Cc: Uwe Kleine-König, Wolfram Sang, Min Li,
	Linux Kernel Mailing List, Linux Next Mailing List

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

Hi all,

After merging the mfd tree, today's linux-next build (x86_64 allmodconfig)
failed like this:

drivers/mfd/rsmu_i2c.c:282:18: error: initialization of 'int (*)(struct i2c_client *)' from incompatible pointer type 'int (*)(struct i2c_client *, const struct i2c_device_id *)' [-Werror=incompatible-pointer-types]
  282 |         .probe = rsmu_i2c_probe,
      |                  ^~~~~~~~~~~~~~
drivers/mfd/rsmu_i2c.c:282:18: note: (near initialization for 'rsmu_i2c_driver.<anonymous>.probe')

Caused by commit

  1b3b1d6c27cc ("mfd: rsmu: Support 32-bit address space")

interacting with commit

  03c835f498b5 ("i2c: Switch .probe() to not take an id parameter")

from Linus' tree (v6.3-rc2).

I applied the following merge fix patch (which may not be right :-():

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri, 31 Mar 2023 12:05:44 +1100
Subject: [PATCH] fixup for "mfd: rsmu: Support 32-bit address space"

interacting with "i2c: Switch .probe() to not take an id parameter"

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 drivers/mfd/rsmu_i2c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mfd/rsmu_i2c.c b/drivers/mfd/rsmu_i2c.c
index 221023faaadf..26972a5aff45 100644
--- a/drivers/mfd/rsmu_i2c.c
+++ b/drivers/mfd/rsmu_i2c.c
@@ -201,9 +201,9 @@ static const struct regmap_config rsmu_sl_regmap_config = {
 	.can_multi_write = true,
 };
 
-static int rsmu_i2c_probe(struct i2c_client *client,
-			  const struct i2c_device_id *id)
+static int rsmu_i2c_probe(struct i2c_client *client)
 {
+	const struct i2c_device_id *id = i2c_client_get_device_id(client);
 	const struct regmap_config *cfg;
 	struct rsmu_ddata *rsmu;
 	int ret;
-- 
2.39.2

-- 
Cheers,
Stephen Rothwell

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

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

* [PATCH] mfd: rsmu_i2c: Convert to i2c's .probe_new() again
  2023-03-31  1:15 linux-next: build failure after merge of the mfd tree Stephen Rothwell
@ 2023-03-31  7:03 ` Uwe Kleine-König
  2023-04-03 15:22   ` Lee Jones
  0 siblings, 1 reply; 3+ messages in thread
From: Uwe Kleine-König @ 2023-03-31  7:03 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Lee Jones, Wolfram Sang, Min Li, Linux Kernel Mailing List,
	Linux Next Mailing List

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

This commit reapplies commit 601e6d48ee35 ("mfd: rsmu_i2c: Convert to
i2c's .probe_new()") which was accidently reverted by commit
1b3b1d6c27cc ("mfd: rsmu: Support 32-bit address space").

Without this change the driver fails to build in combination with commit
03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") which
is contained in v6.3-rc2.

Fixes: 1b3b1d6c27cc ("mfd: rsmu: Support 32-bit address space")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

On Fri, Mar 31, 2023 at 12:15:25PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the mfd tree, today's linux-next build (x86_64 allmodconfig)
> failed like this:
> 
> drivers/mfd/rsmu_i2c.c:282:18: error: initialization of 'int (*)(struct i2c_client *)' from incompatible pointer type 'int (*)(struct i2c_client *, const struct i2c_device_id *)' [-Werror=incompatible-pointer-types]
>   282 |         .probe = rsmu_i2c_probe,
>       |                  ^~~~~~~~~~~~~~
> drivers/mfd/rsmu_i2c.c:282:18: note: (near initialization for 'rsmu_i2c_driver.<anonymous>.probe')
> 
> Caused by commit
> 
>   1b3b1d6c27cc ("mfd: rsmu: Support 32-bit address space")

This commit is strange as it undoes commit
601e6d48ee3519648679177a0647dd3b3cbaefbb without mentioning that. I
guess the reason is a wrong conflict resolution when the address space
patch was rebased.

> interacting with commit
> 
>   03c835f498b5 ("i2c: Switch .probe() to not take an id parameter")
> 
> from Linus' tree (v6.3-rc2).
> 
> I applied the following merge fix patch (which may not be right :-():
> 
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Fri, 31 Mar 2023 12:05:44 +1100
> Subject: [PATCH] fixup for "mfd: rsmu: Support 32-bit address space"
> 
> interacting with "i2c: Switch .probe() to not take an id parameter"
> 
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
> ---
>  drivers/mfd/rsmu_i2c.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mfd/rsmu_i2c.c b/drivers/mfd/rsmu_i2c.c
> index 221023faaadf..26972a5aff45 100644
> --- a/drivers/mfd/rsmu_i2c.c
> +++ b/drivers/mfd/rsmu_i2c.c
> @@ -201,9 +201,9 @@ static const struct regmap_config rsmu_sl_regmap_config = {
>  	.can_multi_write = true,
>  };
>  
> -static int rsmu_i2c_probe(struct i2c_client *client,
> -			  const struct i2c_device_id *id)
> +static int rsmu_i2c_probe(struct i2c_client *client)
>  {
> +	const struct i2c_device_id *id = i2c_client_get_device_id(client);
>  	const struct regmap_config *cfg;
>  	struct rsmu_ddata *rsmu;
>  	int ret;

Nearly right. This works as fix for a tree that has the above mentioned
commits. But in the mfd tree sturct i2c_driver::probe still takes the id
parameter. So to actually prevent the build failure between the merge of
mfd and Linus's tree, the right thing is to reapply commit 601e6d48ee35
("mfd: rsmu_i2c: Convert to i2c's .probe_new()") on the mfd tree.

Best regards
Uwe

 drivers/mfd/rsmu_i2c.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/rsmu_i2c.c b/drivers/mfd/rsmu_i2c.c
index 221023faaadf..807c32101460 100644
--- a/drivers/mfd/rsmu_i2c.c
+++ b/drivers/mfd/rsmu_i2c.c
@@ -201,9 +201,9 @@ static const struct regmap_config rsmu_sl_regmap_config = {
 	.can_multi_write = true,
 };
 
-static int rsmu_i2c_probe(struct i2c_client *client,
-			  const struct i2c_device_id *id)
+static int rsmu_i2c_probe(struct i2c_client *client)
 {
+	const struct i2c_device_id *id = i2c_client_get_device_id(client);
 	const struct regmap_config *cfg;
 	struct rsmu_ddata *rsmu;
 	int ret;
@@ -279,7 +279,7 @@ static struct i2c_driver rsmu_i2c_driver = {
 		.name = "rsmu-i2c",
 		.of_match_table = of_match_ptr(rsmu_i2c_of_match),
 	},
-	.probe = rsmu_i2c_probe,
+	.probe_new = rsmu_i2c_probe,
 	.remove	= rsmu_i2c_remove,
 	.id_table = rsmu_i2c_id,
 };

base-commit: 1b3b1d6c27cc0bfda4326de574f9d73f13a26bc4
-- 
2.39.2

-- 
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 related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mfd: rsmu_i2c: Convert to i2c's .probe_new() again
  2023-03-31  7:03 ` [PATCH] mfd: rsmu_i2c: Convert to i2c's .probe_new() again Uwe Kleine-König
@ 2023-04-03 15:22   ` Lee Jones
  0 siblings, 0 replies; 3+ messages in thread
From: Lee Jones @ 2023-04-03 15:22 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Stephen Rothwell, Wolfram Sang, Min Li,
	Linux Kernel Mailing List, Linux Next Mailing List

On Fri, 31 Mar 2023, Uwe Kleine-König wrote:

> This commit reapplies commit 601e6d48ee35 ("mfd: rsmu_i2c: Convert to
> i2c's .probe_new()") which was accidently reverted by commit
> 1b3b1d6c27cc ("mfd: rsmu: Support 32-bit address space").
>
> Without this change the driver fails to build in combination with commit
> 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") which
> is contained in v6.3-rc2.
>
> Fixes: 1b3b1d6c27cc ("mfd: rsmu: Support 32-bit address space")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Looks good.  Thanks Uwe.

Applied, thanks

--
Lee Jones [李琼斯]

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

end of thread, other threads:[~2023-04-03 15:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-31  1:15 linux-next: build failure after merge of the mfd tree Stephen Rothwell
2023-03-31  7:03 ` [PATCH] mfd: rsmu_i2c: Convert to i2c's .probe_new() again Uwe Kleine-König
2023-04-03 15:22   ` 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).