lkml.org 
[lkml]   [2021]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] ptp: ixp46x: Fix error handling in ptp_ixp_probe()
From
Date
Hi

On 2021/11/26 9:26, Linus Walleij wrote:
> On Fri, Nov 26, 2021 at 2:10 AM Tang Bin <tangbin@cmss.chinamobile.com> wrote:
>
>> In the function ptp_ixp_probe(), when get irq failed
>> after executing platform_get_irq(), the negative value
>> returned will not be detected here. So fix error handling
>> in this place.
>>
>> Fixes: 9055a2f591629 ("ixp4xx_eth: make ptp support a platform driver")
>> Signed-off-by: Tang Bin <tangbin@cmss.chinamobile.com>
> OK the intention is right but:
>
>> - !ixp_clock.master_irq || !ixp_clock.slave_irq)
>> + (ixp_clock.master_irq < 0) || (ixp_clock.slave_irq < 0))
> Keep disallowing 0. Because that is not a valid IRQ.
>
> ... <= 0 ...

Please look at the function platform_get_irq() in the file
drivers/base/platform.c,

the example is :

    * int irq = platform_get_irq(pdev, 0);

    * if (irq < 0)

    *        return irq;

Thanks

Tang Bin



\
 
 \ /
  Last update: 2021-11-26 02:42    [W:0.497 / U:0.304 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site