if (!pport) {
pr_notice("no port at %x found\n", io);
result = -ENXIO;
- goto exit_device_put;
+ goto exit_device_del;
}
ppdevice = parport_register_device(pport, LIRC_DRIVER_NAME,
pf, kf, lirc_lirc_irq_handler, 0,
if (!ppdevice) {
pr_notice("parport_register_device() failed\n");
result = -ENXIO;
- goto exit_device_put;
+ goto exit_device_del;
}
if (parport_claim(ppdevice) != 0)
goto skip_init;
parport_release(pport);
parport_unregister_device(ppdevice);
result = -EIO;
- goto exit_device_put;
+ goto exit_device_del;
}
#endif
pr_notice("register_chrdev() failed\n");
parport_unregister_device(ppdevice);
result = -EIO;
- goto exit_device_put;
+ goto exit_device_del;
}
pr_info("installed using port 0x%04x irq %d\n", io, irq);
return 0;
+exit_device_del:
+ platform_device_del(lirc_parallel_dev);
exit_device_put:
platform_device_put(lirc_parallel_dev);
exit_driver_unregister: