Commit c243f983 authored by Ishizaki Kou's avatar Ishizaki Kou Committed by Paul Mackerras

[POWERPC] ps3: don't call ps3_system_bus_driver_register on other platforms

ps3_system_bus_driver_register is PS3 platform specific function.
On other platforms, it triggers WARN_ON in kref_get.
Signed-off-by: default avatarKou Ishizaki <kou.ishizaki@toshiba.co.jp>
Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 89680a8c
...@@ -42,6 +42,9 @@ ...@@ -42,6 +42,9 @@
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
#ifdef CONFIG_PPC_PS3
#include <asm/firmware.h>
#endif
/*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/
...@@ -951,7 +954,9 @@ static int __init ehci_hcd_init(void) ...@@ -951,7 +954,9 @@ static int __init ehci_hcd_init(void)
#endif #endif
#ifdef PS3_SYSTEM_BUS_DRIVER #ifdef PS3_SYSTEM_BUS_DRIVER
retval = ps3_system_bus_driver_register(&PS3_SYSTEM_BUS_DRIVER); if (firmware_has_feature(FW_FEATURE_PS3_LV1)) {
retval = ps3_system_bus_driver_register(
&PS3_SYSTEM_BUS_DRIVER);
if (retval < 0) { if (retval < 0) {
#ifdef PLATFORM_DRIVER #ifdef PLATFORM_DRIVER
platform_driver_unregister(&PLATFORM_DRIVER); platform_driver_unregister(&PLATFORM_DRIVER);
...@@ -961,6 +966,7 @@ static int __init ehci_hcd_init(void) ...@@ -961,6 +966,7 @@ static int __init ehci_hcd_init(void)
#endif #endif
return retval; return retval;
} }
}
#endif #endif
return retval; return retval;
...@@ -976,6 +982,7 @@ static void __exit ehci_hcd_cleanup(void) ...@@ -976,6 +982,7 @@ static void __exit ehci_hcd_cleanup(void)
pci_unregister_driver(&PCI_DRIVER); pci_unregister_driver(&PCI_DRIVER);
#endif #endif
#ifdef PS3_SYSTEM_BUS_DRIVER #ifdef PS3_SYSTEM_BUS_DRIVER
if (firmware_has_feature(FW_FEATURE_PS3_LV1))
ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER); ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
#endif #endif
} }
......
...@@ -42,6 +42,9 @@ ...@@ -42,6 +42,9 @@
#include <asm/system.h> #include <asm/system.h>
#include <asm/unaligned.h> #include <asm/unaligned.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#ifdef CONFIG_PPC_PS3
#include <asm/firmware.h>
#endif
#include "../core/hcd.h" #include "../core/hcd.h"
...@@ -944,9 +947,12 @@ static int __init ohci_hcd_mod_init(void) ...@@ -944,9 +947,12 @@ static int __init ohci_hcd_mod_init(void)
sizeof (struct ed), sizeof (struct td)); sizeof (struct ed), sizeof (struct td));
#ifdef PS3_SYSTEM_BUS_DRIVER #ifdef PS3_SYSTEM_BUS_DRIVER
retval = ps3_system_bus_driver_register(&PS3_SYSTEM_BUS_DRIVER); if (firmware_has_feature(FW_FEATURE_PS3_LV1)) {
retval = ps3_system_bus_driver_register(
&PS3_SYSTEM_BUS_DRIVER);
if (retval < 0) if (retval < 0)
goto error_ps3; goto error_ps3;
}
#endif #endif
#ifdef PLATFORM_DRIVER #ifdef PLATFORM_DRIVER
...@@ -992,6 +998,7 @@ static int __init ohci_hcd_mod_init(void) ...@@ -992,6 +998,7 @@ static int __init ohci_hcd_mod_init(void)
error_platform: error_platform:
#endif #endif
#ifdef PS3_SYSTEM_BUS_DRIVER #ifdef PS3_SYSTEM_BUS_DRIVER
if (firmware_has_feature(FW_FEATURE_PS3_LV1))
ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER); ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
error_ps3: error_ps3:
#endif #endif
...@@ -1014,6 +1021,7 @@ static void __exit ohci_hcd_mod_exit(void) ...@@ -1014,6 +1021,7 @@ static void __exit ohci_hcd_mod_exit(void)
platform_driver_unregister(&PLATFORM_DRIVER); platform_driver_unregister(&PLATFORM_DRIVER);
#endif #endif
#ifdef PS3_SYSTEM_BUS_DRIVER #ifdef PS3_SYSTEM_BUS_DRIVER
if (firmware_has_feature(FW_FEATURE_PS3_LV1))
ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER); ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
#endif #endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment