[v2,09/11] ata: pata_ixp4xx: Remove unnecessary return value check

Message ID 20230707095513.64224-9-frank.li@vivo.com
State New
Headers
Series [v2,01/11] ata: ahci_octeon: Convert to devm_platform_ioremap_resource() |

Commit Message

李扬韬 July 7, 2023, 9:55 a.m. UTC
  As commit a85a6c86c25b ("driver core: platform: Clarify that IRQ 0
is invalid") says, there is no need to check if the platform_get_irq
return value is 0. Let's remove it.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/ata/pata_ixp4xx_cf.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
  

Comments

Sergey Shtylyov July 7, 2023, 7:43 p.m. UTC | #1
On 7/7/23 12:55 PM, Yangtao Li wrote:

> As commit a85a6c86c25b ("driver core: platform: Clarify that IRQ 0
> is invalid") says, there is no need to check if the platform_get_irq
> return value is 0. Let's remove it.

  Again, you refer to a wrong coommit, you need:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ce753ad1549cbe9ccaea4c06a1f5fa47432c8289

> Signed-off-by: Yangtao Li <frank.li@vivo.com>

   Aside from that:

Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>

[...]

MBR, Sergey
  

Patch

diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c
index 1b9f67e16864..246bb4f8f1f7 100644
--- a/drivers/ata/pata_ixp4xx_cf.c
+++ b/drivers/ata/pata_ixp4xx_cf.c
@@ -274,12 +274,9 @@  static int ixp4xx_pata_probe(struct platform_device *pdev)
 		return PTR_ERR(ixpp->ctl);
 
 	irq = platform_get_irq(pdev, 0);
-	if (irq > 0)
-		irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING);
-	else if (irq < 0)
+	if (irq < 0)
 		return irq;
-	else
-		return -EINVAL;
+	irq_set_irq_type(irq, IRQ_TYPE_EDGE_RISING);
 
 	/* Just one port to set up */
 	ixp4xx_setup_port(ixpp->host->ports[0], ixpp, cmd->start, ctl->start);