Re: [PATCH v2 00/32] driver core: Constify API device_find_child() and adapt for various existing usages

From: Zijun Hu
Date: Tue Dec 03 2024 - 07:58:42 EST


On 2024/12/3 20:00, Uwe Kleine-König wrote:
> Hello,
>
> On Tue, Dec 03, 2024 at 08:33:22AM +0800, Zijun Hu wrote:
>> This patch series is to constify the following API:
>> struct device *device_find_child(struct device *dev, void *data,
>> int (*match)(struct device *dev, void *data));
>> To :
>> struct device *device_find_child(struct device *dev, const void *data,
>> device_match_t match);
>> typedef int (*device_match_t)(struct device *dev, const void *data);
>
> This series isn't bisectible. With only the first two patches applied I
> hit:

yes. such patch series needs to be merge as atomic way.

Hi Greg,

is it possible to ONLY merge such patch series by atomic way into your
driver-core tree?

or squash such patch series into a single patch ?

various subsystem maintainers may not like squashing way.

>
> CC drivers/pwm/core.o
> drivers/pwm/core.c: In function ‘pwm_unexport_child’:
> drivers/pwm/core.c:1292:55: error: passing argument 3 of ‘device_find_child’ from incompatible pointer type [-Wincompatible-pointer-types]
> 1292 | pwm_dev = device_find_child(pwmchip_dev, pwm, pwm_unexport_match);
> | ^~~~~~~~~~~~~~~~~~
> | |
> | int (*)(struct device *, void *)
> In file included from include/linux/acpi.h:14,
> from drivers/pwm/core.c:11:
> 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);
> | ~~~~~~~~~~~~~~~^~~~~
> drivers/pwm/core.c: In function ‘pwm_class_get_state’:
> drivers/pwm/core.c:1386:55: error: passing argument 3 of ‘device_find_child’ from incompatible pointer type [-Wincompatible-pointer-types]
> 1386 | pwm_dev = device_find_child(pwmchip_dev, pwm, pwm_unexport_match);
> | ^~~~~~~~~~~~~~~~~~
> | |
> | int (*)(struct device *, void *)
> 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);
> | ~~~~~~~~~~~~~~~^~~~~
> make[5]: *** [scripts/Makefile.build:194: drivers/pwm/core.o] Error 1
> make[4]: *** [scripts/Makefile.build:440: drivers/pwm] Error 2
> make[3]: *** [scripts/Makefile.build:440: drivers] Error 2
> make[2]: *** [Makefile:1989: .] Error 2
> make[1]: *** [Makefile:372: __build_one_by_one] Error 2
> make: *** [Makefile:251: __sub-make] Error 2
>
> Best regards
> Uwe