Re: [PATCHv3 5/7] dmaengine: dw_dmac: add PCI part of the driver

From: Vinod Koul
Date: Thu Sep 27 2012 - 04:50:01 EST


On Thu, 2012-09-27 at 10:31 +0300, Andy Shevchenko wrote:
> +
> +#include <linux/module.h>
> +#include <linux/pci.h>
> +#include <linux/platform_device.h>
> +#include <linux/dw_dmac.h>
> +
> +static struct dw_dma_platform_data pdata = {
> + .is_private = 1,
> + .chan_allocation_order = CHAN_ALLOCATION_ASCENDING,
> + .chan_priority = CHAN_PRIORITY_ASCENDING,
> +};
pdata could use a prefix/suffix

> +
> +static int __devinit dw_pci_probe(struct pci_dev *pdev,
> + const struct pci_device_id *id)
> +{
...
> +
> + pd = platform_device_alloc("dw_dmac", instance);
Why can't the core driver library be agnostic. Why do we care if the
device is platform, pci or something else.
There is nothing in dma API callbacks which driver implements that
warrants it to be some device.

You have already taken care of dma controller accesses be arch
independent so I don't see a reason why this should be done?
> + if (!pd) {
> + dev_err(&pdev->dev, "can't allocate dw_dmac platform device\n");
> + ret = -ENOMEM;
> + goto err0;
> + }

--
~Vinod

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