[PATCH 1/3] usb: chipidea: add CSR SiRFSoC ci13xxx usb driver

Andy Shevchenko andy.shevchenko at gmail.com
Wed Jun 12 08:28:42 EDT 2013


On Sun, Jun 9, 2013 at 6:25 AM, Barry Song <21cnbao at gmail.com> wrote:
> CSR SiRF SoCs licensed chipidea ci13xxx USB IP, this patch
> makes the chipidea drivers support CSR SiRF SoCS.
>
> It also changes the Kconfig, only compile MSM and IMX if related
> drivers are enabled. Otherwise, we always need to enable all
> clients of chipidea drivers.

> +       /* 5. set device dma mask */
> +       if (!pdev->dev.dma_mask) {
> +               pdev->dev.dma_mask = devm_kzalloc(&pdev->dev,
> +                                     sizeof(*pdev->dev.dma_mask), GFP_KERNEL);
> +               if (!pdev->dev.dma_mask) {
> +                       dev_err(&pdev->dev, "Failed to alloc dma_mask!\n");
> +                       ret = -ENOMEM;
> +                       goto err;
> +               }
> +               *pdev->dev.dma_mask = DMA_BIT_MASK(32);
> +               dma_set_coherent_mask(&pdev->dev, *pdev->dev.dma_mask);

Perhaps you could avoid this allocation if you apply coherent mask
first and its address will be used as dma_mask value.

> +       }

> +err:
> +       clk_disable_unprepare(data->clk);
> +       return ret;

Please, check, but if I remember correctly devm_clk* is doing this for
you on release stage.

> +static int ci13xxx_sirf_remove(struct platform_device *pdev)
> +{
> +       struct ci13xxx_sirf_data *data = platform_get_drvdata(pdev);
> +
> +       pm_runtime_disable(&pdev->dev);
> +       ci13xxx_remove_device(data->ci_pdev);
> +
> +       clk_disable_unprepare(data->clk);

Ditto.

--
With Best Regards,
Andy Shevchenko



More information about the linux-arm-kernel mailing list