Skip to content

Commit

Permalink
leds: pm8058: Silence pointer to integer size warning
Browse files Browse the repository at this point in the history
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: 7f86698 ("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>
  • Loading branch information
Bjorn Andersson authored and Lee Jones committed Dec 1, 2017
1 parent 4fbd8d1 commit 8f52df5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/leds/leds-pm8058.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ static int pm8058_led_probe(struct platform_device *pdev)
if (!led)
return -ENOMEM;

led->ledtype = (u32)of_device_get_match_data(&pdev->dev);
led->ledtype = (u32)(unsigned long)of_device_get_match_data(&pdev->dev);

map = dev_get_regmap(pdev->dev.parent, NULL);
if (!map) {
Expand Down

0 comments on commit 8f52df5

Please sign in to comment.