[PATCH] mux: adgs1408: fix Wvoid-pointer-to-enum-cast warning

From: Krzysztof Kozlowski
Date: Thu Aug 10 2023 - 05:59:18 EST


'chip_id' is an enum, thus cast of pointer on 64-bit compile test with
W=1 causes:

adgs1408.c:62:12: error: cast to smaller integer type 'enum adgs1408_chip_id' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@xxxxxxxxxx>
---
drivers/mux/adgs1408.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mux/adgs1408.c b/drivers/mux/adgs1408.c
index 22ed051eb1a4..29836062152c 100644
--- a/drivers/mux/adgs1408.c
+++ b/drivers/mux/adgs1408.c
@@ -59,7 +59,7 @@ static int adgs1408_probe(struct spi_device *spi)
s32 idle_state;
int ret;

- chip_id = (enum adgs1408_chip_id)device_get_match_data(dev);
+ chip_id = (uintptr_t)device_get_match_data(dev);
if (!chip_id)
chip_id = spi_get_device_id(spi)->driver_data;

--
2.34.1