Skip to content

Commit ab6ead7

Browse files
jkrzyszttmlind
authored andcommitted
ARM: OMAP1: ams-delta: Fix impossible .irq < 0
Since the very beginning, unsigned int .irq member of struct plat_serial8250_port introduced by commit eff443d ("OMAP1: AMS_DELTA: add modem support") was statically initialized to a negative value -EINVAL. Moreover, commit 0812db9 ("ARM: OMAP1: ams-delta: assign MODEM IRQ from GPIO descriptor") has introduced some new code which checks for that member carrying a negative value which is impossible. Use IRQ_NOTCONNECTED instead of -EINVAL. Also, drop the valueless check and let the modem device be registered regardless of .irq value, and the value handled by "serial8250" driver. Fixes: 0812db9 ("ARM: OMAP1: ams-delta: assign MODEM IRQ from GPIO descriptor") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com> Acked-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Tony Lindgren <tony@atomide.com>
1 parent 1137cee commit ab6ead7

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

arch/arm/mach-omap1/board-ams-delta.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ static struct plat_serial8250_port ams_delta_modem_ports[] = {
765765
{
766766
.membase = IOMEM(MODEM_VIRT),
767767
.mapbase = MODEM_PHYS,
768-
.irq = -EINVAL, /* changed later */
768+
.irq = IRQ_NOTCONNECTED, /* changed later */
769769
.flags = UPF_BOOT_AUTOCONF,
770770
.irqflags = IRQF_TRIGGER_RISING,
771771
.iotype = UPIO_MEM,
@@ -856,8 +856,7 @@ static int __init modem_nreset_init(void)
856856

857857

858858
/*
859-
* This function expects MODEM IRQ number already assigned to the port
860-
* and fails if it's not.
859+
* This function expects MODEM IRQ number already assigned to the port.
861860
* The MODEM device requires its RESET# pin kept high during probe.
862861
* That requirement can be fulfilled in several ways:
863862
* - with a descriptor of already functional modem_nreset regulator
@@ -880,9 +879,6 @@ static int __init ams_delta_modem_init(void)
880879
if (!machine_is_ams_delta())
881880
return -ENODEV;
882881

883-
if (ams_delta_modem_ports[0].irq < 0)
884-
return ams_delta_modem_ports[0].irq;
885-
886882
omap_cfg_reg(M14_1510_GPIO2);
887883

888884
/* Initialize the modem_nreset regulator consumer before use */

0 commit comments

Comments
 (0)