ARM: mmp: fix pxa168_device_usb_phy use on aspenite
authorArnd Bergmann <arnd@arndb.de>
Mon, 10 Dec 2018 20:43:02 +0000 (21:43 +0100)
committerOlof Johansson <olof@lixom.net>
Wed, 12 Dec 2018 21:54:44 +0000 (13:54 -0800)
This one ended up in the wrong header file, causing a build failure
on at least one platform:

arch/arm/mach-mmp/aspenite.c: In function 'common_init':
arch/arm/mach-mmp/aspenite.c:260:28: error: 'pxa168_device_usb_phy' undeclared (first use in this function); did you mean 'pxa168_device_ssp5'?

We can just include both the pxa168.h and pxa910.h headers to make
that work, which gets us to the next failure:

arch/arm/mach-mmp/aspenite.o: In function `common_init':
aspenite.c:(.init.text+0x1c0): undefined reference to `pxa168_device_usb_phy'

This is solved by using the matching ifdef check around the
USB device registration, enabling them only when either USB
host or gadget mode are enabled.

Fixes: a225daf72ee7 ("ARM: mmp: add a pxa-usb-phy device")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Olof Johansson <olof@lixom.net>
arch/arm/mach-mmp/aspenite.c
arch/arm/mach-mmp/ttc_dkb.c

index 23f99976b5f5658ae854a6a917497da8a6b1818c..75b2d7db643e7ad47f6deca37f6002b8b2eb2054 100644 (file)
@@ -29,6 +29,7 @@
 #include "addr-map.h"
 #include "mfp-pxa168.h"
 #include "pxa168.h"
 #include "addr-map.h"
 #include "mfp-pxa168.h"
 #include "pxa168.h"
+#include "pxa910.h"
 #include "irqs.h"
 #include "common.h"
 
 #include "irqs.h"
 #include "common.h"
 
@@ -256,6 +257,7 @@ static void __init common_init(void)
        /* off-chip devices */
        platform_device_register(&smc91x_device);
 
        /* off-chip devices */
        platform_device_register(&smc91x_device);
 
+#if IS_ENABLED(CONFIG_USB_SUPPORT)
 #if IS_ENABLED(CONFIG_PHY_PXA_USB)
        platform_device_register(&pxa168_device_usb_phy);
 #endif
 #if IS_ENABLED(CONFIG_PHY_PXA_USB)
        platform_device_register(&pxa168_device_usb_phy);
 #endif
@@ -263,6 +265,7 @@ static void __init common_init(void)
 #if IS_ENABLED(CONFIG_USB_EHCI_MV)
        pxa168_add_usb_host(&pxa168_sph_pdata);
 #endif
 #if IS_ENABLED(CONFIG_USB_EHCI_MV)
        pxa168_add_usb_host(&pxa168_sph_pdata);
 #endif
+#endif
 }
 
 MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform")
 }
 
 MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform")
index 767dcb23ee1cd18b001d3ec4d750a83099c256bc..09b53ace08acc955fcdbc7e880bd95989dd974de 100644 (file)
@@ -282,6 +282,7 @@ static void __init ttc_dkb_init(void)
                                 sizeof(struct pxa_gpio_platform_data));
        platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices));
 
                                 sizeof(struct pxa_gpio_platform_data));
        platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices));
 
+#if IS_ENABLED(CONFIG_USB_SUPPORT)
 #if IS_ENABLED(CONFIG_PHY_PXA_USB)
        platform_device_register(&pxa168_device_usb_phy);
 #endif
 #if IS_ENABLED(CONFIG_PHY_PXA_USB)
        platform_device_register(&pxa168_device_usb_phy);
 #endif
@@ -300,6 +301,7 @@ static void __init ttc_dkb_init(void)
        pxa168_device_u2ootg.dev.platform_data = &ttc_usb_pdata;
        platform_device_register(&pxa168_device_u2ootg);
 #endif
        pxa168_device_u2ootg.dev.platform_data = &ttc_usb_pdata;
        platform_device_register(&pxa168_device_u2ootg);
 #endif
+#endif
 
 #if IS_ENABLED(CONFIG_MMP_DISP)
        add_disp();
 
 #if IS_ENABLED(CONFIG_MMP_DISP)
        add_disp();