Re: [PATCH v1 3/4] dma: dw: split driver to library part and platform code

From: Arnd Bergmann
Date: Tue Jun 04 2013 - 09:00:53 EST


On Tuesday 04 June 2013 15:36:21 Andy Shevchenko wrote:
> To simplify the driver development let's split driver to library and platform
> code parts. It helps us to add PCI driver in future.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
> ---
> drivers/dma/Makefile | 2 +-
> drivers/dma/dw/Kconfig | 8 +-
> drivers/dma/dw/Makefile | 6 +-
> drivers/dma/dw/{dw_dmac.c => core.c} | 309 ++++--------------------------
> drivers/dma/dw/internal.h | 74 +++++++
> drivers/dma/dw/platform.c | 308 +++++++++++++++++++++++++++++
> drivers/dma/dw/{dw_dmac_regs.h => regs.h} | 1 +

Looks good to me, just one issue I found:

> +#ifdef CONFIG_PM_SLEEP
> +
> +int dw_dma_suspend_noirq(struct dw_dma_chip *chip);
> +int dw_dma_resume_noirq(struct dw_dma_chip *chip);
> +
> +#else /* !CONFIG_PM_SLEEP */
> +
> +#define dw_dma_suspend_noirq NULL
> +#define dw_dma_resume_noirq NULL
> +
> +#endif /* !CONFIG_PM_SLEEP */

This won't work ...

> +static int dw_suspend_noirq(struct device *dev)
> +{
> + struct platform_device *pdev = to_platform_device(dev);
> + struct dw_dma_chip *chip = platform_get_drvdata(pdev);
> +
> + return dw_dma_suspend_noirq(chip);
> +}
> +
> +static int dw_resume_noirq(struct device *dev)
> +{
> + struct platform_device *pdev = to_platform_device(dev);
> + struct dw_dma_chip *chip = platform_get_drvdata(pdev);
> +
> + return dw_dma_resume_noirq(chip);
> +}

when you try to call NULL as a function.

Please try to get it to build with CONFIG_PM_SLEEP disabled.

Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/