diff options
| -rw-r--r-- | drivers/block/mtip32xx/mtip32xx.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 04f69e6da1fe..c37073ddf7d4 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c | |||
| @@ -3605,18 +3605,25 @@ MODULE_DEVICE_TABLE(pci, mtip_pci_tbl); | |||
| 3605 | */ | 3605 | */ |
| 3606 | static int __init mtip_init(void) | 3606 | static int __init mtip_init(void) |
| 3607 | { | 3607 | { |
| 3608 | int error; | ||
| 3609 | |||
| 3608 | printk(KERN_INFO MTIP_DRV_NAME " Version " MTIP_DRV_VERSION "\n"); | 3610 | printk(KERN_INFO MTIP_DRV_NAME " Version " MTIP_DRV_VERSION "\n"); |
| 3609 | 3611 | ||
| 3610 | /* Allocate a major block device number to use with this driver. */ | 3612 | /* Allocate a major block device number to use with this driver. */ |
| 3611 | mtip_major = register_blkdev(0, MTIP_DRV_NAME); | 3613 | error = register_blkdev(0, MTIP_DRV_NAME); |
| 3612 | if (mtip_major < 0) { | 3614 | if (error <= 0) { |
| 3613 | printk(KERN_ERR "Unable to register block device (%d)\n", | 3615 | printk(KERN_ERR "Unable to register block device (%d)\n", |
| 3614 | mtip_major); | 3616 | error); |
| 3615 | return -EBUSY; | 3617 | return -EBUSY; |
| 3616 | } | 3618 | } |
| 3619 | mtip_major = error; | ||
| 3617 | 3620 | ||
| 3618 | /* Register our PCI operations. */ | 3621 | /* Register our PCI operations. */ |
| 3619 | return pci_register_driver(&mtip_pci_driver); | 3622 | error = pci_register_driver(&mtip_pci_driver); |
| 3623 | if (error) | ||
| 3624 | unregister_blkdev(mtip_major, MTIP_DRV_NAME); | ||
| 3625 | |||
| 3626 | return error; | ||
| 3620 | } | 3627 | } |
| 3621 | 3628 | ||
| 3622 | /* | 3629 | /* |
