diff options
Diffstat (limited to 'arch/powerpc/platforms/ps3/device-init.c')
-rw-r--r-- | arch/powerpc/platforms/ps3/device-init.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/ps3/device-init.c b/arch/powerpc/platforms/ps3/device-init.c index dbc124e05646..ca71a12b764c 100644 --- a/arch/powerpc/platforms/ps3/device-init.c +++ b/arch/powerpc/platforms/ps3/device-init.c | |||
@@ -518,6 +518,41 @@ fail_device_register: | |||
518 | return result; | 518 | return result; |
519 | } | 519 | } |
520 | 520 | ||
521 | static int __init ps3_register_ramdisk_device(void) | ||
522 | { | ||
523 | int result; | ||
524 | struct layout { | ||
525 | struct ps3_system_bus_device dev; | ||
526 | } *p; | ||
527 | |||
528 | pr_debug(" -> %s:%d\n", __func__, __LINE__); | ||
529 | |||
530 | p = kzalloc(sizeof(struct layout), GFP_KERNEL); | ||
531 | |||
532 | if (!p) | ||
533 | return -ENOMEM; | ||
534 | |||
535 | p->dev.match_id = PS3_MATCH_ID_GPU; | ||
536 | p->dev.match_sub_id = PS3_MATCH_SUB_ID_GPU_RAMDISK; | ||
537 | p->dev.dev_type = PS3_DEVICE_TYPE_IOC0; | ||
538 | |||
539 | result = ps3_system_bus_device_register(&p->dev); | ||
540 | |||
541 | if (result) { | ||
542 | pr_debug("%s:%d ps3_system_bus_device_register failed\n", | ||
543 | __func__, __LINE__); | ||
544 | goto fail_device_register; | ||
545 | } | ||
546 | |||
547 | pr_debug(" <- %s:%d\n", __func__, __LINE__); | ||
548 | return 0; | ||
549 | |||
550 | fail_device_register: | ||
551 | kfree(p); | ||
552 | pr_debug(" <- %s:%d failed\n", __func__, __LINE__); | ||
553 | return result; | ||
554 | } | ||
555 | |||
521 | /** | 556 | /** |
522 | * ps3_setup_dynamic_device - Setup a dynamic device from the repository | 557 | * ps3_setup_dynamic_device - Setup a dynamic device from the repository |
523 | */ | 558 | */ |
@@ -946,6 +981,8 @@ static int __init ps3_register_devices(void) | |||
946 | 981 | ||
947 | ps3_register_lpm_devices(); | 982 | ps3_register_lpm_devices(); |
948 | 983 | ||
984 | ps3_register_ramdisk_device(); | ||
985 | |||
949 | pr_debug(" <- %s:%d\n", __func__, __LINE__); | 986 | pr_debug(" <- %s:%d\n", __func__, __LINE__); |
950 | return 0; | 987 | return 0; |
951 | } | 988 | } |