* [PATCH] ARM: OMAP1: ams-delta: Fix impossible .irq < 0
[not found] <20181001102453.GA18947@mwanda>
@ 2018-10-02 9:45 ` Janusz Krzysztofik
0 siblings, 0 replies; 7+ messages in thread
From: Janusz Krzysztofik @ 2018-10-02 9:45 UTC (permalink / raw)
To: Tony Lindgren
Cc: Aaro Koskinen, linux-arm-kernel, Dan Carpenter, linux-omap,
linux-kernel, Janusz Krzysztofik
Since the very beginning, unsigned int .irq member of struct
plat_serial8250_port introduced by commit eff443df679e ("OMAP1:
AMS_DELTA: add modem support") was statically initialized to a negative
value -EINVAL. Moreover, commit 0812db943748 ("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: 0812db943748 ("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>
---
arch/arm/mach-omap1/board-ams-delta.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index af318d958fd2..3d191fd52910 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -773,7 +773,7 @@ static struct plat_serial8250_port ams_delta_modem_ports[] = {
{
.membase = IOMEM(MODEM_VIRT),
.mapbase = MODEM_PHYS,
- .irq = -EINVAL, /* changed later */
+ .irq = IRQ_NOTCONNECTED, /* changed later */
.flags = UPF_BOOT_AUTOCONF,
.irqflags = IRQF_TRIGGER_RISING,
.iotype = UPIO_MEM,
@@ -864,8 +864,7 @@ static int __init modem_nreset_init(void)
/*
- * This function expects MODEM IRQ number already assigned to the port
- * and fails if it's not.
+ * This function expects MODEM IRQ number already assigned to the port.
* The MODEM device requires its RESET# pin kept high during probe.
* That requirement can be fulfilled in several ways:
* - with a descriptor of already functional modem_nreset regulator
@@ -888,9 +887,6 @@ static int __init ams_delta_modem_init(void)
if (!machine_is_ams_delta())
return -ENODEV;
- if (ams_delta_modem_ports[0].irq < 0)
- return ams_delta_modem_ports[0].irq;
-
omap_cfg_reg(M14_1510_GPIO2);
/* Initialize the modem_nreset regulator consumer before use */
--
2.16.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] ARM: OMAP1: ams-delta: Fix impossible .irq < 0
@ 2018-10-02 9:45 ` Janusz Krzysztofik
0 siblings, 0 replies; 7+ messages in thread
From: Janusz Krzysztofik @ 2018-10-02 9:45 UTC (permalink / raw)
To: linux-arm-kernel
Since the very beginning, unsigned int .irq member of struct
plat_serial8250_port introduced by commit eff443df679e ("OMAP1:
AMS_DELTA: add modem support") was statically initialized to a negative
value -EINVAL. Moreover, commit 0812db943748 ("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: 0812db943748 ("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>
---
arch/arm/mach-omap1/board-ams-delta.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-omap1/board-ams-delta.c b/arch/arm/mach-omap1/board-ams-delta.c
index af318d958fd2..3d191fd52910 100644
--- a/arch/arm/mach-omap1/board-ams-delta.c
+++ b/arch/arm/mach-omap1/board-ams-delta.c
@@ -773,7 +773,7 @@ static struct plat_serial8250_port ams_delta_modem_ports[] = {
{
.membase = IOMEM(MODEM_VIRT),
.mapbase = MODEM_PHYS,
- .irq = -EINVAL, /* changed later */
+ .irq = IRQ_NOTCONNECTED, /* changed later */
.flags = UPF_BOOT_AUTOCONF,
.irqflags = IRQF_TRIGGER_RISING,
.iotype = UPIO_MEM,
@@ -864,8 +864,7 @@ static int __init modem_nreset_init(void)
/*
- * This function expects MODEM IRQ number already assigned to the port
- * and fails if it's not.
+ * This function expects MODEM IRQ number already assigned to the port.
* The MODEM device requires its RESET# pin kept high during probe.
* That requirement can be fulfilled in several ways:
* - with a descriptor of already functional modem_nreset regulator
@@ -888,9 +887,6 @@ static int __init ams_delta_modem_init(void)
if (!machine_is_ams_delta())
return -ENODEV;
- if (ams_delta_modem_ports[0].irq < 0)
- return ams_delta_modem_ports[0].irq;
-
omap_cfg_reg(M14_1510_GPIO2);
/* Initialize the modem_nreset regulator consumer before use */
--
2.16.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] ARM: OMAP1: ams-delta: Fix impossible .irq < 0
2018-10-02 9:45 ` Janusz Krzysztofik
(?)
@ 2018-10-02 17:47 ` Aaro Koskinen
-1 siblings, 0 replies; 7+ messages in thread
From: Aaro Koskinen @ 2018-10-02 17:47 UTC (permalink / raw)
To: Janusz Krzysztofik
Cc: Tony Lindgren, linux-arm-kernel, Dan Carpenter, linux-omap, linux-kernel
Hi,
On Tue, Oct 02, 2018 at 11:45:29AM +0200, Janusz Krzysztofik wrote:
> Since the very beginning, unsigned int .irq member of struct
> plat_serial8250_port introduced by commit eff443df679e ("OMAP1:
> AMS_DELTA: add modem support") was statically initialized to a negative
> value -EINVAL. Moreover, commit 0812db943748 ("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: 0812db943748 ("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>
A.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ARM: OMAP1: ams-delta: Fix impossible .irq < 0
@ 2018-10-02 17:47 ` Aaro Koskinen
0 siblings, 0 replies; 7+ messages in thread
From: Aaro Koskinen @ 2018-10-02 17:47 UTC (permalink / raw)
To: Janusz Krzysztofik
Cc: Tony Lindgren, linux-omap, Dan Carpenter, linux-arm-kernel, linux-kernel
Hi,
On Tue, Oct 02, 2018 at 11:45:29AM +0200, Janusz Krzysztofik wrote:
> Since the very beginning, unsigned int .irq member of struct
> plat_serial8250_port introduced by commit eff443df679e ("OMAP1:
> AMS_DELTA: add modem support") was statically initialized to a negative
> value -EINVAL. Moreover, commit 0812db943748 ("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: 0812db943748 ("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>
A.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] ARM: OMAP1: ams-delta: Fix impossible .irq < 0
@ 2018-10-02 17:47 ` Aaro Koskinen
0 siblings, 0 replies; 7+ messages in thread
From: Aaro Koskinen @ 2018-10-02 17:47 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On Tue, Oct 02, 2018 at 11:45:29AM +0200, Janusz Krzysztofik wrote:
> Since the very beginning, unsigned int .irq member of struct
> plat_serial8250_port introduced by commit eff443df679e ("OMAP1:
> AMS_DELTA: add modem support") was statically initialized to a negative
> value -EINVAL. Moreover, commit 0812db943748 ("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: 0812db943748 ("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>
A.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] ARM: OMAP1: ams-delta: Fix impossible .irq < 0
2018-10-02 17:47 ` Aaro Koskinen
@ 2018-10-04 14:30 ` Tony Lindgren
-1 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2018-10-04 14:30 UTC (permalink / raw)
To: Aaro Koskinen
Cc: Janusz Krzysztofik, linux-arm-kernel, Dan Carpenter, linux-omap,
linux-kernel
* Aaro Koskinen <aaro.koskinen@iki.fi> [181002 17:52]:
> Hi,
>
> On Tue, Oct 02, 2018 at 11:45:29AM +0200, Janusz Krzysztofik wrote:
> > Since the very beginning, unsigned int .irq member of struct
> > plat_serial8250_port introduced by commit eff443df679e ("OMAP1:
> > AMS_DELTA: add modem support") was statically initialized to a negative
> > value -EINVAL. Moreover, commit 0812db943748 ("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: 0812db943748 ("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>
Applying into omap-for-v4.20/omap1 thanks.
Regards,
Tony
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] ARM: OMAP1: ams-delta: Fix impossible .irq < 0
@ 2018-10-04 14:30 ` Tony Lindgren
0 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2018-10-04 14:30 UTC (permalink / raw)
To: linux-arm-kernel
* Aaro Koskinen <aaro.koskinen@iki.fi> [181002 17:52]:
> Hi,
>
> On Tue, Oct 02, 2018 at 11:45:29AM +0200, Janusz Krzysztofik wrote:
> > Since the very beginning, unsigned int .irq member of struct
> > plat_serial8250_port introduced by commit eff443df679e ("OMAP1:
> > AMS_DELTA: add modem support") was statically initialized to a negative
> > value -EINVAL. Moreover, commit 0812db943748 ("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: 0812db943748 ("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>
Applying into omap-for-v4.20/omap1 thanks.
Regards,
Tony
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-10-04 14:30 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20181001102453.GA18947@mwanda>
2018-10-02 9:45 ` [PATCH] ARM: OMAP1: ams-delta: Fix impossible .irq < 0 Janusz Krzysztofik
2018-10-02 9:45 ` Janusz Krzysztofik
2018-10-02 17:47 ` Aaro Koskinen
2018-10-02 17:47 ` Aaro Koskinen
2018-10-02 17:47 ` Aaro Koskinen
2018-10-04 14:30 ` Tony Lindgren
2018-10-04 14:30 ` Tony Lindgren
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.