usb: musb: Fix an error message
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 4 May 2021 20:26:29 +0000 (22:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 May 2021 14:17:57 +0000 (16:17 +0200)
'ret' is known to be 0 here.
Initialize 'ret' with the expected error code before using it.

Fixes: 0990366bab3c ("usb: musb: Add support for MediaTek musb controller")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/69f514dc7134e3c917cad208e73cc650cb9e2bd6.1620159879.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/musb/mediatek.c

index eebeadd269461421b7e6915adc1a106c249112d2..6b92d037d8fc839f98621779c9b90c9354fa1a3e 100644 (file)
@@ -518,8 +518,8 @@ static int mtk_musb_probe(struct platform_device *pdev)
 
        glue->xceiv = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
        if (IS_ERR(glue->xceiv)) {
-               dev_err(dev, "fail to getting usb-phy %d\n", ret);
                ret = PTR_ERR(glue->xceiv);
+               dev_err(dev, "fail to getting usb-phy %d\n", ret);
                goto err_unregister_usb_phy;
        }