diff options
-rw-r--r-- | arch/powerpc/platforms/ps3/device-init.c | 78 |
1 files changed, 46 insertions, 32 deletions
diff --git a/arch/powerpc/platforms/ps3/device-init.c b/arch/powerpc/platforms/ps3/device-init.c index 9d251d0ca8c6..3866debfa3c4 100644 --- a/arch/powerpc/platforms/ps3/device-init.c +++ b/arch/powerpc/platforms/ps3/device-init.c | |||
@@ -499,41 +499,14 @@ static int __init ps3_register_graphics_devices(void) | |||
499 | } | 499 | } |
500 | 500 | ||
501 | /** | 501 | /** |
502 | * ps3_register_repository_device - Register a device from the repositiory info. | 502 | * ps3_setup_dynamic_device - Setup a dynamic device from the repository |
503 | * | ||
504 | */ | 503 | */ |
505 | 504 | ||
506 | static int ps3_register_repository_device( | 505 | static int ps3_setup_dynamic_device(const struct ps3_repository_device *repo) |
507 | const struct ps3_repository_device *repo) | ||
508 | { | 506 | { |
509 | int result; | 507 | int result; |
510 | 508 | ||
511 | switch (repo->dev_type) { | 509 | switch (repo->dev_type) { |
512 | case PS3_DEV_TYPE_SB_GELIC: | ||
513 | result = ps3_setup_gelic_device(repo); | ||
514 | if (result) { | ||
515 | pr_debug("%s:%d ps3_setup_gelic_device failed\n", | ||
516 | __func__, __LINE__); | ||
517 | } | ||
518 | break; | ||
519 | case PS3_DEV_TYPE_SB_USB: | ||
520 | |||
521 | /* Each USB device has both an EHCI and an OHCI HC */ | ||
522 | |||
523 | result = ps3_setup_ehci_device(repo); | ||
524 | |||
525 | if (result) { | ||
526 | pr_debug("%s:%d ps3_setup_ehci_device failed\n", | ||
527 | __func__, __LINE__); | ||
528 | } | ||
529 | |||
530 | result = ps3_setup_ohci_device(repo); | ||
531 | |||
532 | if (result) { | ||
533 | pr_debug("%s:%d ps3_setup_ohci_device failed\n", | ||
534 | __func__, __LINE__); | ||
535 | } | ||
536 | break; | ||
537 | case PS3_DEV_TYPE_STOR_DISK: | 510 | case PS3_DEV_TYPE_STOR_DISK: |
538 | result = ps3_setup_storage_dev(repo, PS3_MATCH_ID_STOR_DISK); | 511 | result = ps3_setup_storage_dev(repo, PS3_MATCH_ID_STOR_DISK); |
539 | 512 | ||
@@ -572,6 +545,48 @@ static int ps3_register_repository_device( | |||
572 | return result; | 545 | return result; |
573 | } | 546 | } |
574 | 547 | ||
548 | /** | ||
549 | * ps3_setup_static_device - Setup a static device from the repository | ||
550 | */ | ||
551 | |||
552 | static int __init ps3_setup_static_device(const struct ps3_repository_device *repo) | ||
553 | { | ||
554 | int result; | ||
555 | |||
556 | switch (repo->dev_type) { | ||
557 | case PS3_DEV_TYPE_SB_GELIC: | ||
558 | result = ps3_setup_gelic_device(repo); | ||
559 | if (result) { | ||
560 | pr_debug("%s:%d ps3_setup_gelic_device failed\n", | ||
561 | __func__, __LINE__); | ||
562 | } | ||
563 | break; | ||
564 | case PS3_DEV_TYPE_SB_USB: | ||
565 | |||
566 | /* Each USB device has both an EHCI and an OHCI HC */ | ||
567 | |||
568 | result = ps3_setup_ehci_device(repo); | ||
569 | |||
570 | if (result) { | ||
571 | pr_debug("%s:%d ps3_setup_ehci_device failed\n", | ||
572 | __func__, __LINE__); | ||
573 | } | ||
574 | |||
575 | result = ps3_setup_ohci_device(repo); | ||
576 | |||
577 | if (result) { | ||
578 | pr_debug("%s:%d ps3_setup_ohci_device failed\n", | ||
579 | __func__, __LINE__); | ||
580 | } | ||
581 | break; | ||
582 | |||
583 | default: | ||
584 | return ps3_setup_dynamic_device(repo); | ||
585 | } | ||
586 | |||
587 | return result; | ||
588 | } | ||
589 | |||
575 | static void ps3_find_and_add_device(u64 bus_id, u64 dev_id) | 590 | static void ps3_find_and_add_device(u64 bus_id, u64 dev_id) |
576 | { | 591 | { |
577 | struct ps3_repository_device repo; | 592 | struct ps3_repository_device repo; |
@@ -601,7 +616,7 @@ found: | |||
601 | pr_debug("%s:%u: device %lu:%lu found after %u retries\n", | 616 | pr_debug("%s:%u: device %lu:%lu found after %u retries\n", |
602 | __func__, __LINE__, bus_id, dev_id, retries); | 617 | __func__, __LINE__, bus_id, dev_id, retries); |
603 | 618 | ||
604 | ps3_register_repository_device(&repo); | 619 | ps3_setup_dynamic_device(&repo); |
605 | return; | 620 | return; |
606 | } | 621 | } |
607 | 622 | ||
@@ -905,8 +920,7 @@ static int __init ps3_register_devices(void) | |||
905 | 920 | ||
906 | ps3_register_graphics_devices(); | 921 | ps3_register_graphics_devices(); |
907 | 922 | ||
908 | ps3_repository_find_devices(PS3_BUS_TYPE_SB, | 923 | ps3_repository_find_devices(PS3_BUS_TYPE_SB, ps3_setup_static_device); |
909 | ps3_register_repository_device); | ||
910 | 924 | ||
911 | ps3_register_sound_devices(); | 925 | ps3_register_sound_devices(); |
912 | 926 | ||