Subject: linux-next: build failure after merge of the driver-core tree

From: Stephen Rothwell <[email-masked]>
Date: Mon, 6 Jan 2025 16:04:51 +1100

Hi all,

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

drivers/leds/leds-turris-omnia.c: In function 'omnia_find_mcu_and_get_features':
drivers/leds/leds-turris-omnia.c:457:56: error: passing argument 3 of 'device_find_child' from incompatible pointer type [-Wincompatible-pointer-types]
  457 |         mcu_dev = device_find_child(dev->parent, NULL, omnia_match_mcu_client);
      |                                                        ^~~~~~~~~~~~~~~~~~~~~~
      |                                                        |
      |                                                        int (*)(struct device *, void *)
In file included from include/linux/acpi.h:14,
                 from include/linux/i2c.h:13,
                 from drivers/leds/leds-turris-omnia.c:8:
include/linux/device.h:1085:49: note: expected 'device_match_t' {aka 'int (*)(struct device *, const void *)'} but argument is of type 'int (*)(struct device *, void *)'
 1085 |                                  device_match_t match);
      |                                  ~~~~~~~~~~~~~~~^~~~~

Caused by commit

  f1e8bf56320a ("driver core: Constify API device_find_child() and adapt for various usages")

interacting with commit

  b4c3960da27d ("leds: turris-omnia: Use command execution functions from the MCU driver")

from the leds-lj tree.

I have applied the following merge fix patch.

From: Stephen Rothwell <[email-masked]>
Date: Mon, 6 Jan 2025 15:58:47 +1100
Subject: [PATCH] fix up 2 for "driver core: Constify API device_find_child()
 and adapt for various usages"

interacting with commit

  b4c3960da27d ("leds: turris-omnia: Use command execution functions from the MCU driver")

from the leds-lj tree.

Signed-off-by: Stephen Rothwell <[email-masked]>
---
 drivers/leds/leds-turris-omnia.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/leds/leds-turris-omnia.c b/drivers/leds/leds-turris-omnia.c
index 7d3b24c8ecae..4fe1a9c0bc1b 100644
--- a/drivers/leds/leds-turris-omnia.c
+++ b/drivers/leds/leds-turris-omnia.c
@@ -438,7 +438,7 @@ static int omnia_mcu_get_features(const struct i2c_client *mcu_client)
 	return reply;
 }
 
-static int omnia_match_mcu_client(struct device *dev, void *data)
+static int omnia_match_mcu_client(struct device *dev, const void *data)
 {
 	struct i2c_client *client;
 
-- 
2.45.2

-- 
Cheers,
Stephen Rothwell