mfd: mxs-lradc: Fix Wvoid-pointer-to-enum-cast warning
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Thu, 10 Aug 2023 09:58:49 +0000 (11:58 +0200)
committerLee Jones <lee@kernel.org>
Tue, 22 Aug 2023 07:07:52 +0000 (08:07 +0100)
'soc' is an enum, thus cast of pointer on 64-bit compile test with W=1
causes:

  mxs-lradc.c:145:15: error: cast to smaller integer type 'enum mxs_lradc_id' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810095849.123321-9-krzysztof.kozlowski@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/mxs-lradc.c

index 111d11f..21f3033 100644 (file)
@@ -142,7 +142,7 @@ static int mxs_lradc_probe(struct platform_device *pdev)
        if (!of_id)
                return -EINVAL;
 
-       lradc->soc = (enum mxs_lradc_id)of_id->data;
+       lradc->soc = (uintptr_t)of_id->data;
 
        lradc->clk = devm_clk_get(&pdev->dev, NULL);
        if (IS_ERR(lradc->clk)) {