Messages in this thread | | | From | Arnd Bergmann <> | Subject | Re: [PATCHv2 2/4] dmaengine: dw_dmac: Add PCI part of the driver | Date | Thu, 27 Sep 2012 07:41:53 +0000 |
| |
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);
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.
Does this make sense?
Arnd
| |