Skip to content

Commit

Permalink
drivers/pcmcia/m32r_pcc.c: use common error path
Browse files Browse the repository at this point in the history
Use a common error path for the failure.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Sudip Mukherjee <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
sudipm-mukherjee authored and torvalds committed Dec 13, 2016
1 parent 4170a20 commit c795cf4
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions drivers/pcmcia/m32r_pcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -689,10 +689,8 @@ static int __init init_m32r_pcc(void)
return ret;

ret = platform_device_register(&pcc_device);
if (ret){
platform_driver_unregister(&pcc_driver);
return ret;
}
if (ret)
goto unreg_driv;

printk(KERN_INFO "m32r PCC probe:\n");

Expand All @@ -706,9 +704,8 @@ static int __init init_m32r_pcc(void)

if (pcc_sockets == 0) {
printk("socket is not found.\n");
platform_device_unregister(&pcc_device);
platform_driver_unregister(&pcc_driver);
return -ENODEV;
ret = -ENODEV;
goto unreg_dev;
}

/* Set up interrupt handler(s) */
Expand All @@ -734,6 +731,12 @@ static int __init init_m32r_pcc(void)
}

return 0;

unreg_dev:
platform_device_unregister(&pcc_device);
unreg_driv:
platform_driver_unregister(&pcc_driver);
return ret;
} /* init_m32r_pcc */

static void __exit exit_m32r_pcc(void)
Expand Down

0 comments on commit c795cf4

Please sign in to comment.