From 96ee7d58a446601e7d511e75ba4c1f15cf4f1375 Mon Sep 17 00:00:00 2001 From: Zhenlin Lian Date: Mon, 29 Nov 2021 16:52:23 +0800 Subject: [PATCH] driver: regulator: Fix the compilation warnings for pointer The pointer returned by of_device_get_match_data() didn't have the same size as u8 on 64-bit architectures, which leads to a compile warning. Typecast the return value to unsigned long and then to u8 to silence the warning. Change-Id: I5156bae75387c3e15acfa1975ac3c8b35da3da91 Signed-off-by: Zhenlin Lian --- drivers/regulator/qpnp-lcdb-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/regulator/qpnp-lcdb-regulator.c b/drivers/regulator/qpnp-lcdb-regulator.c index 02d8f45a916d..628452f264a4 100644 --- a/drivers/regulator/qpnp-lcdb-regulator.c +++ b/drivers/regulator/qpnp-lcdb-regulator.c @@ -2732,7 +2732,7 @@ static int qpnp_lcdb_regulator_probe(struct platform_device *pdev) return -EINVAL; } - lcdb->subtype = (u8)of_device_get_match_data(&pdev->dev); + lcdb->subtype = (u8)(unsigned long)of_device_get_match_data(&pdev->dev); lcdb->dev = &pdev->dev; lcdb->pdev = pdev; dev_id = of_match_device(lcdb->dev->driver->of_match_table, lcdb->dev);