phy: stm32: use NULL instead of zero
authorVinod Koul <vkoul@kernel.org>
Wed, 8 Jul 2020 13:28:09 +0000 (18:58 +0530)
committerVinod Koul <vkoul@kernel.org>
Mon, 13 Jul 2020 06:45:46 +0000 (12:15 +0530)
devm_clk_get() and devm_reset_control_get() expect a const char *id for
the last arg, but a value of zero was provided. This results in below
sparse warning:

drivers/phy/st/phy-stm32-usbphyc.c:330:42: warning: Using plain integer as NULL pointer
drivers/phy/st/phy-stm32-usbphyc.c:343:52: warning: Using plain integer as NULL pointer

Instead of zero, use NULL

Reviewed-by: Amelie Delaunay <amelie.delaunay@st.com>
Link: https://lore.kernel.org/r/20200708132809.265967-6-vkoul@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/st/phy-stm32-usbphyc.c

index 56bdea4..2b3639c 100644 (file)
@@ -327,7 +327,7 @@ static int stm32_usbphyc_probe(struct platform_device *pdev)
        if (IS_ERR(usbphyc->base))
                return PTR_ERR(usbphyc->base);
 
-       usbphyc->clk = devm_clk_get(dev, 0);
+       usbphyc->clk = devm_clk_get(dev, NULL);
        if (IS_ERR(usbphyc->clk)) {
                ret = PTR_ERR(usbphyc->clk);
                dev_err(dev, "clk get failed: %d\n", ret);
@@ -340,7 +340,7 @@ static int stm32_usbphyc_probe(struct platform_device *pdev)
                return ret;
        }
 
-       usbphyc->rst = devm_reset_control_get(dev, 0);
+       usbphyc->rst = devm_reset_control_get(dev, NULL);
        if (!IS_ERR(usbphyc->rst)) {
                reset_control_assert(usbphyc->rst);
                udelay(2);