Re: [PATCH 6/8] Add EHCI support for MX27 and MX31 based boards

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

 



On Thu, Jun 11, 2009 at 07:12:49PM +0200, Valentin Longchamp wrote:
>> +static int __exit ehci_mxc_drv_remove(struct platform_device *pdev)
>> +{
>> +       struct ehci_mxc_priv *priv = platform_get_drvdata(pdev);
>> +       struct usb_hcd *hcd = priv->hcd;
>> +
>> +       usb_remove_hcd(hcd);
>> +       iounmap(hcd->regs);
>> +       release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
>> +       usb_put_hcd(hcd);
>> +       platform_set_drvdata(pdev, NULL);
>> +
>> +       clk_disable(priv->usbclk);
>> +       clk_put(priv->usbclk);
>> +       if (priv->ahbclk) {
>> +               clk_disable(priv->ahbclk);
>> +               clk_put(priv->ahbclk);
>> +       }
>> +
>> +       kfree(priv);
>> +
>> +       return 0;
>> +}
>> +
>> +MODULE_ALIAS("platform:mxc-ehci");
>> +
>> +static struct platform_driver ehci_mxc_driver = {
>> +       .probe = ehci_mxc_drv_probe,
>> +       .remove = __exit_p(ehci_mxc_drv_remove),
>> +       .shutdown = usb_hcd_platform_shutdown,
>> +       .driver = {
>> +                  .name = "mxc-ehci",
>> +       },
>> +};
>
> The call to usb_hcd_platform_shutdown does not work, because this  
> function awaits that the dev->priv_data directly is a usb_hcd struct.  
> However, in our case we have a ehci_mxc_priv struct. Here is a patch  
> suggesting a way to correct this (inspired by the  
> usb_hcd_platform_shutdown implementation):
>
> +void ehci_mxc_drv_shutdown(struct platform_device *pdev)
> +{
> +       struct ehci_mxc_priv *priv = platform_get_drvdata(pdev);
> +       struct usb_hcd *hcd = priv->hcd;
> +
> +       if (hcd->driver->shutdown)
> +               hcd->driver->shutdown(hcd);
> +}
> +
>  MODULE_ALIAS("platform:mxc-ehci");
>
>  static struct platform_driver ehci_mxc_driver = {
>         .probe = ehci_mxc_drv_probe,
>         .remove = __exit_p(ehci_mxc_drv_remove),
> -       .shutdown = usb_hcd_platform_shutdown,
> +       .shutdown = ehci_mxc_drv_shutdown,
>         .driver = {
>                    .name = "mxc-ehci",
>         },

Thanks a lot. I'll queue that and resend the whole series after some
more cleanups.

Daniel
--
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