phy: marvell pxa-usb: fix Wvoid-pointer-to-enum-cast warning
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Thu, 10 Aug 2023 11:19:58 +0000 (13:19 +0200)
committerVinod Koul <vkoul@kernel.org>
Fri, 11 Aug 2023 08:25:15 +0000 (09:25 +0100)
'version' is an enum, thus cast of pointer on 64-bit compile test with
W=1 causes:

  phy-pxa-usb.c:299:26: error: cast to smaller integer type 'enum pxa_usb_phy_version' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20230810111958.205705-4-krzysztof.kozlowski@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/marvell/phy-pxa-usb.c

index ffe889893ff4a0e5ed9c5290501c74c8690ce935..6c98eb9608e9c1f0c42deef70be0a86b9db834a1 100644 (file)
@@ -296,7 +296,7 @@ static int pxa_usb_phy_probe(struct platform_device *pdev)
 
        of_id = of_match_node(pxa_usb_phy_of_match, dev->of_node);
        if (of_id)
-               pxa_usb_phy->version = (enum pxa_usb_phy_version)of_id->data;
+               pxa_usb_phy->version = (uintptr_t)of_id->data;
        else
                pxa_usb_phy->version = PXA_USB_PHY_MMP2;