m68k: amiserial - Kill warn_unused_result warnings
warning: ignoring return value of 'request_irq', declared with attribute warn_unused_result and clean up the error path handling. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
This commit is contained in:
parent
67c53c3466
commit
5edc304f49
1 changed files with 30 additions and 6 deletions
|
@ -1963,6 +1963,7 @@ static int __init rs_init(void)
|
||||||
{
|
{
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
struct serial_state * state;
|
struct serial_state * state;
|
||||||
|
int error;
|
||||||
|
|
||||||
if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(AMI_SERIAL))
|
if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(AMI_SERIAL))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
@ -1975,8 +1976,11 @@ static int __init rs_init(void)
|
||||||
* We request SERDAT and SERPER only, because the serial registers are
|
* We request SERDAT and SERPER only, because the serial registers are
|
||||||
* too spreaded over the custom register space
|
* too spreaded over the custom register space
|
||||||
*/
|
*/
|
||||||
if (!request_mem_region(CUSTOM_PHYSADDR+0x30, 4, "amiserial [Paula]"))
|
if (!request_mem_region(CUSTOM_PHYSADDR+0x30, 4,
|
||||||
return -EBUSY;
|
"amiserial [Paula]")) {
|
||||||
|
error = -EBUSY;
|
||||||
|
goto fail_put_tty_driver;
|
||||||
|
}
|
||||||
|
|
||||||
IRQ_ports = NULL;
|
IRQ_ports = NULL;
|
||||||
|
|
||||||
|
@ -1997,8 +2001,9 @@ static int __init rs_init(void)
|
||||||
serial_driver->flags = TTY_DRIVER_REAL_RAW;
|
serial_driver->flags = TTY_DRIVER_REAL_RAW;
|
||||||
tty_set_operations(serial_driver, &serial_ops);
|
tty_set_operations(serial_driver, &serial_ops);
|
||||||
|
|
||||||
if (tty_register_driver(serial_driver))
|
error = tty_register_driver(serial_driver);
|
||||||
panic("Couldn't register serial driver\n");
|
if (error)
|
||||||
|
goto fail_release_mem_region;
|
||||||
|
|
||||||
state = rs_table;
|
state = rs_table;
|
||||||
state->magic = SSTATE_MAGIC;
|
state->magic = SSTATE_MAGIC;
|
||||||
|
@ -2024,8 +2029,14 @@ static int __init rs_init(void)
|
||||||
local_irq_save(flags);
|
local_irq_save(flags);
|
||||||
|
|
||||||
/* set ISRs, and then disable the rx interrupts */
|
/* set ISRs, and then disable the rx interrupts */
|
||||||
request_irq(IRQ_AMIGA_TBE, ser_tx_int, 0, "serial TX", state);
|
error = request_irq(IRQ_AMIGA_TBE, ser_tx_int, 0, "serial TX", state);
|
||||||
request_irq(IRQ_AMIGA_RBF, ser_rx_int, IRQF_DISABLED, "serial RX", state);
|
if (error)
|
||||||
|
goto fail_unregister;
|
||||||
|
|
||||||
|
error = request_irq(IRQ_AMIGA_RBF, ser_rx_int, IRQF_DISABLED,
|
||||||
|
"serial RX", state);
|
||||||
|
if (error)
|
||||||
|
goto fail_free_irq;
|
||||||
|
|
||||||
/* turn off Rx and Tx interrupts */
|
/* turn off Rx and Tx interrupts */
|
||||||
custom.intena = IF_RBF | IF_TBE;
|
custom.intena = IF_RBF | IF_TBE;
|
||||||
|
@ -2045,6 +2056,16 @@ static int __init rs_init(void)
|
||||||
ciab.ddra &= ~(SER_DCD | SER_CTS | SER_DSR); /* inputs */
|
ciab.ddra &= ~(SER_DCD | SER_CTS | SER_DSR); /* inputs */
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
fail_free_irq:
|
||||||
|
free_irq(IRQ_AMIGA_TBE, state);
|
||||||
|
fail_unregister:
|
||||||
|
tty_unregister_driver(serial_driver);
|
||||||
|
fail_release_mem_region:
|
||||||
|
release_mem_region(CUSTOM_PHYSADDR+0x30, 4);
|
||||||
|
fail_put_tty_driver:
|
||||||
|
put_tty_driver(serial_driver);
|
||||||
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
static __exit void rs_exit(void)
|
static __exit void rs_exit(void)
|
||||||
|
@ -2064,6 +2085,9 @@ static __exit void rs_exit(void)
|
||||||
kfree(info);
|
kfree(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free_irq(IRQ_AMIGA_TBE, rs_table);
|
||||||
|
free_irq(IRQ_AMIGA_RBF, rs_table);
|
||||||
|
|
||||||
release_mem_region(CUSTOM_PHYSADDR+0x30, 4);
|
release_mem_region(CUSTOM_PHYSADDR+0x30, 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue