Commit c795cf4f authored by Sudip Mukherjee's avatar Sudip Mukherjee Committed by Linus Torvalds

drivers/pcmcia/m32r_pcc.c: use common error path

Use a common error path for the failure.

Link: http://lkml.kernel.org/r/1474237304-897-2-git-send-email-sudipm.mukherjee@gmail.comSigned-off-by: default avatarSudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 4170a20f
...@@ -689,10 +689,8 @@ static int __init init_m32r_pcc(void) ...@@ -689,10 +689,8 @@ static int __init init_m32r_pcc(void)
return ret; return ret;
ret = platform_device_register(&pcc_device); ret = platform_device_register(&pcc_device);
if (ret){ if (ret)
platform_driver_unregister(&pcc_driver); goto unreg_driv;
return ret;
}
printk(KERN_INFO "m32r PCC probe:\n"); printk(KERN_INFO "m32r PCC probe:\n");
...@@ -706,9 +704,8 @@ static int __init init_m32r_pcc(void) ...@@ -706,9 +704,8 @@ static int __init init_m32r_pcc(void)
if (pcc_sockets == 0) { if (pcc_sockets == 0) {
printk("socket is not found.\n"); printk("socket is not found.\n");
platform_device_unregister(&pcc_device); ret = -ENODEV;
platform_driver_unregister(&pcc_driver); goto unreg_dev;
return -ENODEV;
} }
/* Set up interrupt handler(s) */ /* Set up interrupt handler(s) */
...@@ -734,6 +731,12 @@ static int __init init_m32r_pcc(void) ...@@ -734,6 +731,12 @@ static int __init init_m32r_pcc(void)
} }
return 0; return 0;
unreg_dev:
platform_device_unregister(&pcc_device);
unreg_driv:
platform_driver_unregister(&pcc_driver);
return ret;
} /* init_m32r_pcc */ } /* init_m32r_pcc */
static void __exit exit_m32r_pcc(void) static void __exit exit_m32r_pcc(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment