mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
ARM: OMAP1: ams-delta: Fix impossible .irq < 0
Since the very beginning, unsigned int .irq member of struct plat_serial8250_port introduced by commiteff443df67("OMAP1: AMS_DELTA: add modem support") was statically initialized to a negative value -EINVAL. Moreover, commit0812db9437("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:0812db9437("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>
This commit is contained in:
parent
1137ceee76
commit
ab6ead7d07
1 changed files with 2 additions and 6 deletions
|
|
@ -765,7 +765,7 @@ static struct plat_serial8250_port ams_delta_modem_ports[] = {
|
||||||
{
|
{
|
||||||
.membase = IOMEM(MODEM_VIRT),
|
.membase = IOMEM(MODEM_VIRT),
|
||||||
.mapbase = MODEM_PHYS,
|
.mapbase = MODEM_PHYS,
|
||||||
.irq = -EINVAL, /* changed later */
|
.irq = IRQ_NOTCONNECTED, /* changed later */
|
||||||
.flags = UPF_BOOT_AUTOCONF,
|
.flags = UPF_BOOT_AUTOCONF,
|
||||||
.irqflags = IRQF_TRIGGER_RISING,
|
.irqflags = IRQF_TRIGGER_RISING,
|
||||||
.iotype = UPIO_MEM,
|
.iotype = UPIO_MEM,
|
||||||
|
|
@ -856,8 +856,7 @@ static int __init modem_nreset_init(void)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This function expects MODEM IRQ number already assigned to the port
|
* This function expects MODEM IRQ number already assigned to the port.
|
||||||
* and fails if it's not.
|
|
||||||
* The MODEM device requires its RESET# pin kept high during probe.
|
* The MODEM device requires its RESET# pin kept high during probe.
|
||||||
* That requirement can be fulfilled in several ways:
|
* That requirement can be fulfilled in several ways:
|
||||||
* - with a descriptor of already functional modem_nreset regulator
|
* - with a descriptor of already functional modem_nreset regulator
|
||||||
|
|
@ -880,9 +879,6 @@ static int __init ams_delta_modem_init(void)
|
||||||
if (!machine_is_ams_delta())
|
if (!machine_is_ams_delta())
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
if (ams_delta_modem_ports[0].irq < 0)
|
|
||||||
return ams_delta_modem_ports[0].irq;
|
|
||||||
|
|
||||||
omap_cfg_reg(M14_1510_GPIO2);
|
omap_cfg_reg(M14_1510_GPIO2);
|
||||||
|
|
||||||
/* Initialize the modem_nreset regulator consumer before use */
|
/* Initialize the modem_nreset regulator consumer before use */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue