On Thursday, June 09, 2011 16:21:04 Sebastian Andrzej Siewior wrote: > +static int net2272_pci_register(void) __init > +static void net2272_pci_unregister(void) __exit or use inline on both > static int __init net2272_init(void) > { > - return pci_register_driver(&net2272_pci_driver) & > - platform_driver_register(&net2272_plat_driver); > + int ret; > + > + ret = net2272_pci_register(); > + if (ret) > + return ret; > + ret = platform_driver_register(&net2272_plat_driver); > + if (ret) > + goto err_pci; > + return ret; > + > +err_pci: > + net2272_pci_unregister(); > + return ret; > } the original code was kind of as intended. if one of the registers succeed, i'd like the over all func to succeed. -mike
Attachment:
signature.asc
Description: This is a digitally signed message part.