lkml.org 
[lkml]   [2022]   [Mar]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V3] net: mv643xx_eth: use platform_get_irq() instead of platform_get_resource()
> -	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
> - BUG_ON(!res);
> - dev->irq = res->start;
> + irq = platform_get_irq(pdev, 0);
> + if (WARN_ON(irq < 0)) {
> + if (!IS_ERR(mp->clk))
> + clk_disable_unprepare(mp->clk);
> + free_netdev(dev);
> + return irq;
> + }

Why not
goto out;

?

And FYI: You can pass an error code to clk_disable_unprepare() and it
will not care and do the right thing. So if you were to keep this
code, which you should not, you don't need the if !IS_ERR(mp->clk))


Andrew

\
 
 \ /
  Last update: 2022-03-14 14:04    [W:0.100 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site