[PATCH] serial: pmac_zilog: don't init if zilog is not available
Laurent Vivier
laurent at vivier.eu
Thu Oct 22 18:16:46 AEDT 2020
Le 22/10/2020 à 05:23, Finn Thain a écrit :
> On Wed, 21 Oct 2020, Laurent Vivier wrote:
>
>> Le 21/10/2020 à 01:43, Finn Thain a écrit :
>>
>>> Laurent, can we avoid the irq == 0 warning splat like this?
>>>
>>> diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c
>>> index 96e7aa479961..7db600cd8cc7 100644
>>> --- a/drivers/tty/serial/pmac_zilog.c
>>> +++ b/drivers/tty/serial/pmac_zilog.c
>>> @@ -1701,8 +1701,10 @@ static int __init pmz_init_port(struct uart_pmac_port *uap)
>>> int irq;
>>>
>>> r_ports = platform_get_resource(uap->pdev, IORESOURCE_MEM, 0);
>>> + if (!r_ports)
>>> + return -ENODEV;
>>> irq = platform_get_irq(uap->pdev, 0);
>>> - if (!r_ports || irq <= 0)
>>> + if (irq <= 0)
>>> return -ENODEV;
>>>
>>> uap->port.mapbase = r_ports->start;
>>>
>>
>> No, this doesn't fix the problem.
>>
>
> Then I had better stop guessing and start up Aranym...
>
> The patch below seems to fix the problem for me. Does it work on your
> system(s)?
It works like a charm.
Thank you,
Laurent
More information about the Linuxppc-dev
mailing list