Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: amlogic: meson-g12a-usb2: fix Wvoid-pointer-to-enum-cast warning

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

phy-meson-g12a-usb2.c:322:17: error: cast to smaller integer type 'enum meson_soc_id' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20230810091310.70231-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Vinod Koul
ffc1786c 7451eecf

+1 -1
+1 -1
drivers/phy/amlogic/phy-meson-g12a-usb2.c
··· 319 319 if (IS_ERR(base)) 320 320 return PTR_ERR(base); 321 321 322 - priv->soc_id = (enum meson_soc_id)of_device_get_match_data(&pdev->dev); 322 + priv->soc_id = (uintptr_t)of_device_get_match_data(&pdev->dev); 323 323 324 324 priv->regmap = devm_regmap_init_mmio(dev, base, 325 325 &phy_meson_g12a_usb2_regmap_conf);