spi: pxa2xx: fix PCI dependency

Message ID 20181017185128.2634666-1-arnd@arndb.de
State New
Headers show
Series
  • spi: pxa2xx: fix PCI dependency
Related show

Commit Message

Arnd Bergmann Oct. 17, 2018, 6:50 p.m.
The code reorganization broke building without CONFIG_PCI:

drivers/spi/spi-pxa2xx.c: In function 'pxa2xx_spi_init_pdata':
drivers/spi/spi-pxa2xx.c:1457:15: error: implicit declaration of function 'pci_match_id'; did you mean 'pci_map_sg'? [-Werror=implicit-function-declaration]

Add back an #ifdef around the code block that requires it.

Fixes: 87ae1d2d7077 ("spi: pxa2xx: Add devicetree support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 drivers/spi/spi-pxa2xx.c | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.18.0

Comments

Geert Uytterhoeven Oct. 17, 2018, 8:53 p.m. | #1
Hi Arnd,

On Wed, Oct 17, 2018 at 8:52 PM Arnd Bergmann <arnd@arndb.de> wrote:
> The code reorganization broke building without CONFIG_PCI:

>

> drivers/spi/spi-pxa2xx.c: In function 'pxa2xx_spi_init_pdata':

> drivers/spi/spi-pxa2xx.c:1457:15: error: implicit declaration of function 'pci_match_id'; did you mean 'pci_map_sg'? [-Werror=implicit-function-declaration]

>

> Add back an #ifdef around the code block that requires it.

>

> Fixes: 87ae1d2d7077 ("spi: pxa2xx: Add devicetree support")

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>


Already fixed in spi-next by commit 9c2120090586d7e5 ("PCI: Provide
pci_match_id() with CONFIG_PCI=n").

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Patch

diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index 612cc49db28f..c1c30109dd1f 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -1453,9 +1453,11 @@  pxa2xx_spi_init_pdata(struct platform_device *pdev)
 	if (pdev->dev.of_node)
 		of_id = of_match_device(pdev->dev.driver->of_match_table,
 					&pdev->dev);
+#ifdef CONFIG_PCI
 	else if (dev_is_pci(pdev->dev.parent))
 		pcidev_id = pci_match_id(pxa2xx_spi_pci_compound_match,
 					 to_pci_dev(pdev->dev.parent));
+#endif
 	else if (adev)
 		adev_id = acpi_match_device(pdev->dev.driver->acpi_match_table,
 					    &pdev->dev);