Re: [PATCH] chipidea: ci13xxx_imx: Access phy via private data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 25, 2013 at 2:58 AM, Fabio Estevam
<fabio.estevam@xxxxxxxxxxxxx> wrote:
> commit ea1418b5f1a (usb: chipidea: i.MX: use devm_usb_get_phy_by_phandle to get
> phy) causes the USB host to miss the disconnect/connect events.
>
> In order to reproduce this problem:
>
> - Insert a USB thumb into the USB host port (connection is detected)
> - Remove it (no disconnect event will be reported)
> - Insert the USB thumb again (connection is not detected)
>
> Fix this problem by accessing the usb_phy structure using the private data
> instead of accessing a local structure.
>
> Tested on a mx28evk board.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@xxxxxxxxxxxxx>
> ---
>  drivers/usb/chipidea/ci13xxx_imx.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c
> index 7e6f067..46f273e 100644
> --- a/drivers/usb/chipidea/ci13xxx_imx.c
> +++ b/drivers/usb/chipidea/ci13xxx_imx.c
> @@ -98,7 +98,6 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
>         };
>         struct resource *res;
>         int ret;
> -       struct usb_phy *phy;
>
>         if (of_find_property(pdev->dev.of_node, "fsl,usbmisc", NULL)
>                 && !usbmisc_ops)
> @@ -130,14 +129,14 @@ static int ci13xxx_imx_probe(struct platform_device *pdev)
>                 return ret;
>         }
>
> -       phy = devm_usb_get_phy_by_phandle(&pdev->dev, "fsl,usbphy", 0);
> -       if (!IS_ERR(phy)) {
> -               ret = usb_phy_init(phy);
> +       data->phy = devm_usb_get_phy_by_phandle(&pdev->dev, "fsl,usbphy", 0);
> +       if (!IS_ERR(data->phy)) {
> +               ret = usb_phy_init(data->phy);
>                 if (ret) {
>                         dev_err(&pdev->dev, "unable to init phy: %d\n", ret);
>                         goto err_clk;
>                 }
> -       } else if (PTR_ERR(phy) == -EPROBE_DEFER) {
> +       } else if (PTR_ERR(data->phy) == -EPROBE_DEFER) {
>                 ret = -EPROBE_DEFER;
>                 goto err_clk;
>         }
> --
> 1.8.1.2

Acked-by: Peter Chen <peter.chen@xxxxxxxxxxxxx>

--
BR,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux