diff options
author | Geert Uytterhoeven <geert@linux-m68k.org> | 2008-12-30 08:13:41 -0500 |
---|---|---|
committer | Geert Uytterhoeven <geert@linux-m68k.org> | 2009-01-12 14:56:39 -0500 |
commit | 5edc304f49f3b1a246a3cc4ecc248e8fe7174840 (patch) | |
tree | 9ecf14055d5b4626cf5fe54b0f4fb92b8335399b /drivers/char | |
parent | 67c53c34660c535083c4c8753e547a9338802ec6 (diff) |
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>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/amiserial.c | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/drivers/char/amiserial.c b/drivers/char/amiserial.c index 4e0cfdeab146..a58869ea8513 100644 --- a/drivers/char/amiserial.c +++ b/drivers/char/amiserial.c | |||
@@ -1963,6 +1963,7 @@ static int __init rs_init(void) | |||
1963 | { | 1963 | { |
1964 | unsigned long flags; | 1964 | unsigned long flags; |
1965 | struct serial_state * state; | 1965 | struct serial_state * state; |
1966 | int error; | ||
1966 | 1967 | ||
1967 | if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(AMI_SERIAL)) | 1968 | if (!MACH_IS_AMIGA || !AMIGAHW_PRESENT(AMI_SERIAL)) |
1968 | return -ENODEV; | 1969 | return -ENODEV; |
@@ -1975,8 +1976,11 @@ static int __init rs_init(void) | |||
1975 | * We request SERDAT and SERPER only, because the serial registers are | 1976 | * We request SERDAT and SERPER only, because the serial registers are |
1976 | * too spreaded over the custom register space | 1977 | * too spreaded over the custom register space |
1977 | */ | 1978 | */ |
1978 | if (!request_mem_region(CUSTOM_PHYSADDR+0x30, 4, "amiserial [Paula]")) | 1979 | if (!request_mem_region(CUSTOM_PHYSADDR+0x30, 4, |
1979 | return -EBUSY; | 1980 | "amiserial [Paula]")) { |
1981 | error = -EBUSY; | ||
1982 | goto fail_put_tty_driver; | ||
1983 | } | ||
1980 | 1984 | ||
1981 | IRQ_ports = NULL; | 1985 | IRQ_ports = NULL; |
1982 | 1986 | ||
@@ -1997,8 +2001,9 @@ static int __init rs_init(void) | |||
1997 | serial_driver->flags = TTY_DRIVER_REAL_RAW; | 2001 | serial_driver->flags = TTY_DRIVER_REAL_RAW; |
1998 | tty_set_operations(serial_driver, &serial_ops); | 2002 | tty_set_operations(serial_driver, &serial_ops); |
1999 | 2003 | ||
2000 | if (tty_register_driver(serial_driver)) | 2004 | error = tty_register_driver(serial_driver); |
2001 | panic("Couldn't register serial driver\n"); | 2005 | if (error) |
2006 | goto fail_release_mem_region; | ||
2002 | 2007 | ||
2003 | state = rs_table; | 2008 | state = rs_table; |
2004 | state->magic = SSTATE_MAGIC; | 2009 | state->magic = SSTATE_MAGIC; |
@@ -2024,8 +2029,14 @@ static int __init rs_init(void) | |||
2024 | local_irq_save(flags); | 2029 | local_irq_save(flags); |
2025 | 2030 | ||
2026 | /* set ISRs, and then disable the rx interrupts */ | 2031 | /* set ISRs, and then disable the rx interrupts */ |
2027 | request_irq(IRQ_AMIGA_TBE, ser_tx_int, 0, "serial TX", state); | 2032 | error = request_irq(IRQ_AMIGA_TBE, ser_tx_int, 0, "serial TX", state); |
2028 | request_irq(IRQ_AMIGA_RBF, ser_rx_int, IRQF_DISABLED, "serial RX", state); | 2033 | if (error) |
2034 | goto fail_unregister; | ||
2035 | |||
2036 | error = request_irq(IRQ_AMIGA_RBF, ser_rx_int, IRQF_DISABLED, | ||
2037 | "serial RX", state); | ||
2038 | if (error) | ||
2039 | goto fail_free_irq; | ||
2029 | 2040 | ||
2030 | /* turn off Rx and Tx interrupts */ | 2041 | /* turn off Rx and Tx interrupts */ |
2031 | custom.intena = IF_RBF | IF_TBE; | 2042 | custom.intena = IF_RBF | IF_TBE; |
@@ -2045,6 +2056,16 @@ static int __init rs_init(void) | |||
2045 | ciab.ddra &= ~(SER_DCD | SER_CTS | SER_DSR); /* inputs */ | 2056 | ciab.ddra &= ~(SER_DCD | SER_CTS | SER_DSR); /* inputs */ |
2046 | 2057 | ||
2047 | return 0; | 2058 | return 0; |
2059 | |||
2060 | fail_free_irq: | ||
2061 | free_irq(IRQ_AMIGA_TBE, state); | ||
2062 | fail_unregister: | ||
2063 | tty_unregister_driver(serial_driver); | ||
2064 | fail_release_mem_region: | ||
2065 | release_mem_region(CUSTOM_PHYSADDR+0x30, 4); | ||
2066 | fail_put_tty_driver: | ||
2067 | put_tty_driver(serial_driver); | ||
2068 | return error; | ||
2048 | } | 2069 | } |
2049 | 2070 | ||
2050 | static __exit void rs_exit(void) | 2071 | static __exit void rs_exit(void) |
@@ -2064,6 +2085,9 @@ static __exit void rs_exit(void) | |||
2064 | kfree(info); | 2085 | kfree(info); |
2065 | } | 2086 | } |
2066 | 2087 | ||
2088 | free_irq(IRQ_AMIGA_TBE, rs_table); | ||
2089 | free_irq(IRQ_AMIGA_RBF, rs_table); | ||
2090 | |||
2067 | release_mem_region(CUSTOM_PHYSADDR+0x30, 4); | 2091 | release_mem_region(CUSTOM_PHYSADDR+0x30, 4); |
2068 | } | 2092 | } |
2069 | 2093 | ||