diff options
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-mpath-rdac.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/md/dm-mpath-rdac.c b/drivers/md/dm-mpath-rdac.c index 16b161345775..e04eb5c697fb 100644 --- a/drivers/md/dm-mpath-rdac.c +++ b/drivers/md/dm-mpath-rdac.c | |||
@@ -664,20 +664,21 @@ static struct hw_handler_type rdac_handler = { | |||
664 | 664 | ||
665 | static int __init rdac_init(void) | 665 | static int __init rdac_init(void) |
666 | { | 666 | { |
667 | int r = dm_register_hw_handler(&rdac_handler); | 667 | int r; |
668 | |||
669 | if (r < 0) { | ||
670 | DMERR("%s: register failed %d", RDAC_DM_HWH_NAME, r); | ||
671 | return r; | ||
672 | } | ||
673 | 668 | ||
674 | rdac_wkqd = create_singlethread_workqueue("rdac_wkqd"); | 669 | rdac_wkqd = create_singlethread_workqueue("rdac_wkqd"); |
675 | if (!rdac_wkqd) { | 670 | if (!rdac_wkqd) { |
676 | DMERR("Failed to create workqueue rdac_wkqd."); | 671 | DMERR("Failed to create workqueue rdac_wkqd."); |
677 | dm_unregister_hw_handler(&rdac_handler); | ||
678 | return -ENOMEM; | 672 | return -ENOMEM; |
679 | } | 673 | } |
680 | 674 | ||
675 | r = dm_register_hw_handler(&rdac_handler); | ||
676 | if (r < 0) { | ||
677 | DMERR("%s: register failed %d", RDAC_DM_HWH_NAME, r); | ||
678 | destroy_workqueue(rdac_wkqd); | ||
679 | return r; | ||
680 | } | ||
681 | |||
681 | DMINFO("%s: version %s loaded", RDAC_DM_HWH_NAME, RDAC_DM_HWH_VER); | 682 | DMINFO("%s: version %s loaded", RDAC_DM_HWH_NAME, RDAC_DM_HWH_VER); |
682 | return 0; | 683 | return 0; |
683 | } | 684 | } |