Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

leds: pm8058: Silence pointer to integer size warning

The pointer returned by of_device_get_match_data() doesn't have the same
size as u32 on 64-bit architectures, causing a compile warning when
compile-testing the driver on such platform.

Cast the return value of of_device_get_match_data() to unsigned long and
then to u32 to silence this warning.

Fixes: 7f866986e705 ("leds: add PM8058 LEDs driver")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Bjorn Andersson and committed by
Lee Jones
8f52df50 4fbd8d19

+1 -1
+1 -1
drivers/leds/leds-pm8058.c
··· 106 106 if (!led) 107 107 return -ENOMEM; 108 108 109 - led->ledtype = (u32)of_device_get_match_data(&pdev->dev); 109 + led->ledtype = (u32)(unsigned long)of_device_get_match_data(&pdev->dev); 110 110 111 111 map = dev_get_regmap(pdev->dev.parent, NULL); 112 112 if (!map) {