static int ps3_setup_dynamic_device(const struct ps3_repository_device *repo) { int result; switch (repo->dev_type) { case PS3_DEV_TYPE_STOR_DISK: result = ps3_setup_storage_dev(repo, PS3_MATCH_ID_STOR_DISK); /* Some devices are not accessible from the Other OS lpar. */ if (result == -ENODEV) { result = 0; pr_debug("%s:%u: not accessible\n", __func__, __LINE__); } if (result) pr_debug("%s:%u ps3_setup_storage_dev failed\n", __func__, __LINE__); break; case PS3_DEV_TYPE_STOR_ROM: result = ps3_setup_storage_dev(repo, PS3_MATCH_ID_STOR_ROM); if (result) pr_debug("%s:%u ps3_setup_storage_dev failed\n", __func__, __LINE__); break; case PS3_DEV_TYPE_STOR_FLASH: result = ps3_setup_storage_dev(repo, PS3_MATCH_ID_STOR_FLASH); if (result) pr_debug("%s:%u ps3_setup_storage_dev failed\n", __func__, __LINE__); break; default: result = 0; pr_debug("%s:%u: unsupported dev_type %u\n", __func__, __LINE__, repo->dev_type); } return result; }
static int ps3_register_repository_device( const struct ps3_repository_device *repo) { int result; switch (repo->dev_type) { case PS3_DEV_TYPE_SB_GELIC: result = ps3_setup_gelic_device(repo); if (result) { pr_debug("%s:%d ps3_setup_gelic_device failed\n", __func__, __LINE__); } break; case PS3_DEV_TYPE_SB_USB: /* Each USB device has both an EHCI and an OHCI HC */ result = ps3_setup_ehci_device(repo); if (result) { pr_debug("%s:%d ps3_setup_ehci_device failed\n", __func__, __LINE__); } result = ps3_setup_ohci_device(repo); if (result) { pr_debug("%s:%d ps3_setup_ohci_device failed\n", __func__, __LINE__); } break; case PS3_DEV_TYPE_STOR_DISK: result = ps3_setup_storage_dev(repo, PS3_MATCH_ID_STOR_DISK); /* Some devices are not accessable from the Other OS lpar. */ if (result == -ENODEV) { result = 0; pr_debug("%s:%u: not accessable\n", __func__, __LINE__); } if (result) pr_debug("%s:%u ps3_setup_storage_dev failed\n", __func__, __LINE__); break; case PS3_DEV_TYPE_STOR_ROM: result = ps3_setup_storage_dev(repo, PS3_MATCH_ID_STOR_ROM); if (result) pr_debug("%s:%u ps3_setup_storage_dev failed\n", __func__, __LINE__); break; case PS3_DEV_TYPE_STOR_FLASH: result = ps3_setup_storage_dev(repo, PS3_MATCH_ID_STOR_FLASH); if (result) pr_debug("%s:%u ps3_setup_storage_dev failed\n", __func__, __LINE__); break; default: result = 0; pr_debug("%s:%u: unsupported dev_type %u\n", __func__, __LINE__, repo->dev_type); } return result; }