Re: [PATCHv2 2/4] dmaengine: dw_dmac: Add PCI part of the driver

From: Vinod Koul
Date: Thu Sep 27 2012 - 10:28:31 EST


On Thu, 2012-09-27 at 07:41 +0000, Arnd Bergmann wrote:
> On Thursday 27 September 2012, viresh kumar wrote:
> > I believe there is no common initialization part here, because PCI device in any
> > case would be calling probe of platform device. :)
>
> Looking at the driver more closely now. Right now, it only supports platform
> devices, and the dw_probe function contains some parts that are related to
> platform devices and some parts that are needed also in case of PCI.
>
> My suggestion would be that you split the dw_probe function to separate out
> the bus specific parts and end up with three functions like
>
> int dw_dmac_probe(struct dw_dma *dw);
> int dw_dmac_platform_probe(struct platform_device *pdev);
> int dw_dmac_pci_probe(struct dw_dma *dw);
yes and bus probe shoudl aquire resources, other stuff should be done in
dmac_probe.
>
> where the first one is called by the other two, depending on the bus type.
> This could be done either splitting the driver into multiple files so you can
> have the platform and pci parts in separate driver modules depending on the
> common module that does all the actual work, or everything can be put in
> a single file with an #ifdef CONFIG_PCI to disable the pci driver parts
> when they don't apply.
probe wont be called if PCI device is not loaded, so see no reason why
CONFIG_xxx would be needed
>
> Does this make sense?
Yup!
>
> 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/


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