From 6e475aad3c2ca613b1e1a9d3839c399dd177ad22 Mon Sep 17 00:00:00 2001 From: Breno Leitao Date: Thu, 25 Feb 2010 15:31:49 -0300 Subject: [PATCH] jsm: removing the uart structure and filename on error If jsm fails to load, then remove the uart stuff, otherwise, the things (as files), will be there forever (even when the module is unloaded). If you try to reload the module, the following message appears: kobject_add_internal failed for ttyn1 with -EEXIST, don't try to register things with the same name in the same directory. This patch remove the uart things when the driver fails. Signed-off-by: Breno Leitao Signed-off-by: Greg Kroah-Hartman --- drivers/serial/jsm/jsm_driver.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/serial/jsm/jsm_driver.c b/drivers/serial/jsm/jsm_driver.c index 108c3e0471fd5..12cb5e446a4f0 100644 --- a/drivers/serial/jsm/jsm_driver.c +++ b/drivers/serial/jsm/jsm_driver.c @@ -179,6 +179,7 @@ static int __devinit jsm_probe_one(struct pci_dev *pdev, const struct pci_device return 0; out_free_irq: + jsm_remove_uart_port(brd); free_irq(brd->irq, brd); out_iounmap: iounmap(brd->re_map_membase); -- 2.39.5