aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIshizaki Kou <kou.ishizaki@toshiba.co.jp>2007-02-14 02:04:17 -0500
committerPaul Mackerras <paulus@samba.org>2007-02-15 22:00:20 -0500
commitc243f983a52eca8eb2a73113222887149836d45c (patch)
tree45fe3b6be83efd184b460995fc438dc5db71bcbc
parent89680a8c3c35a3e9a7e97fbe66a34b0a73e221d1 (diff)
[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: Kou Ishizaki <kou.ishizaki@toshiba.co.jp> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r--drivers/usb/host/ehci-hcd.c19
-rw-r--r--drivers/usb/host/ohci-hcd.c18
2 files changed, 26 insertions, 11 deletions
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 185721dba42b..251b5d369220 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -42,6 +42,9 @@
42#include <asm/irq.h> 42#include <asm/irq.h>
43#include <asm/system.h> 43#include <asm/system.h>
44#include <asm/unaligned.h> 44#include <asm/unaligned.h>
45#ifdef CONFIG_PPC_PS3
46#include <asm/firmware.h>
47#endif
45 48
46 49
47/*-------------------------------------------------------------------------*/ 50/*-------------------------------------------------------------------------*/
@@ -951,15 +954,18 @@ static int __init ehci_hcd_init(void)
951#endif 954#endif
952 955
953#ifdef PS3_SYSTEM_BUS_DRIVER 956#ifdef PS3_SYSTEM_BUS_DRIVER
954 retval = ps3_system_bus_driver_register(&PS3_SYSTEM_BUS_DRIVER); 957 if (firmware_has_feature(FW_FEATURE_PS3_LV1)) {
955 if (retval < 0) { 958 retval = ps3_system_bus_driver_register(
959 &PS3_SYSTEM_BUS_DRIVER);
960 if (retval < 0) {
956#ifdef PLATFORM_DRIVER 961#ifdef PLATFORM_DRIVER
957 platform_driver_unregister(&PLATFORM_DRIVER); 962 platform_driver_unregister(&PLATFORM_DRIVER);
958#endif 963#endif
959#ifdef PCI_DRIVER 964#ifdef PCI_DRIVER
960 pci_unregister_driver(&PCI_DRIVER); 965 pci_unregister_driver(&PCI_DRIVER);
961#endif 966#endif
962 return retval; 967 return retval;
968 }
963 } 969 }
964#endif 970#endif
965 971
@@ -976,7 +982,8 @@ static void __exit ehci_hcd_cleanup(void)
976 pci_unregister_driver(&PCI_DRIVER); 982 pci_unregister_driver(&PCI_DRIVER);
977#endif 983#endif
978#ifdef PS3_SYSTEM_BUS_DRIVER 984#ifdef PS3_SYSTEM_BUS_DRIVER
979 ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER); 985 if (firmware_has_feature(FW_FEATURE_PS3_LV1))
986 ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
980#endif 987#endif
981} 988}
982module_exit(ehci_hcd_cleanup); 989module_exit(ehci_hcd_cleanup);
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index fa6a7ceaa0db..f0d29eda3c6d 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -42,6 +42,9 @@
42#include <asm/system.h> 42#include <asm/system.h>
43#include <asm/unaligned.h> 43#include <asm/unaligned.h>
44#include <asm/byteorder.h> 44#include <asm/byteorder.h>
45#ifdef CONFIG_PPC_PS3
46#include <asm/firmware.h>
47#endif
45 48
46#include "../core/hcd.h" 49#include "../core/hcd.h"
47 50
@@ -944,9 +947,12 @@ static int __init ohci_hcd_mod_init(void)
944 sizeof (struct ed), sizeof (struct td)); 947 sizeof (struct ed), sizeof (struct td));
945 948
946#ifdef PS3_SYSTEM_BUS_DRIVER 949#ifdef PS3_SYSTEM_BUS_DRIVER
947 retval = ps3_system_bus_driver_register(&PS3_SYSTEM_BUS_DRIVER); 950 if (firmware_has_feature(FW_FEATURE_PS3_LV1)) {
948 if (retval < 0) 951 retval = ps3_system_bus_driver_register(
949 goto error_ps3; 952 &PS3_SYSTEM_BUS_DRIVER);
953 if (retval < 0)
954 goto error_ps3;
955 }
950#endif 956#endif
951 957
952#ifdef PLATFORM_DRIVER 958#ifdef PLATFORM_DRIVER
@@ -992,7 +998,8 @@ static int __init ohci_hcd_mod_init(void)
992 error_platform: 998 error_platform:
993#endif 999#endif
994#ifdef PS3_SYSTEM_BUS_DRIVER 1000#ifdef PS3_SYSTEM_BUS_DRIVER
995 ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER); 1001 if (firmware_has_feature(FW_FEATURE_PS3_LV1))
1002 ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
996 error_ps3: 1003 error_ps3:
997#endif 1004#endif
998 return retval; 1005 return retval;
@@ -1014,7 +1021,8 @@ static void __exit ohci_hcd_mod_exit(void)
1014 platform_driver_unregister(&PLATFORM_DRIVER); 1021 platform_driver_unregister(&PLATFORM_DRIVER);
1015#endif 1022#endif
1016#ifdef PS3_SYSTEM_BUS_DRIVER 1023#ifdef PS3_SYSTEM_BUS_DRIVER
1017 ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER); 1024 if (firmware_has_feature(FW_FEATURE_PS3_LV1))
1025 ps3_system_bus_driver_unregister(&PS3_SYSTEM_BUS_DRIVER);
1018#endif 1026#endif
1019} 1027}
1020module_exit(ohci_hcd_mod_exit); 1028module_exit(ohci_hcd_mod_exit);