* Mike Frysinger | 2011-06-09 16:29:52 [-0400]: >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 Right, >> 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. Isn't something exploding if we try to unregister a driver which was never registered? >-mike Sebastian -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html