mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-08-05 16:54:27 +00:00
driver core: platform: Make clear error code used for missed IRQ
We have few code paths where same error code is assigned and returned for missed IRQ. Unify that under single error path. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20210331145937.35980-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
cc71079023
commit
c99f4ebc68
1 changed files with 5 additions and 6 deletions
|
@ -192,7 +192,7 @@ int platform_get_irq_optional(struct platform_device *dev, unsigned int num)
|
|||
#ifdef CONFIG_SPARC
|
||||
/* sparc does not have irqs represented as IORESOURCE_IRQ resources */
|
||||
if (!dev || num >= dev->archdata.num_irqs)
|
||||
return -ENXIO;
|
||||
goto out_not_found;
|
||||
ret = dev->archdata.irqs[num];
|
||||
goto out;
|
||||
#else
|
||||
|
@ -223,10 +223,8 @@ int platform_get_irq_optional(struct platform_device *dev, unsigned int num)
|
|||
struct irq_data *irqd;
|
||||
|
||||
irqd = irq_get_irq_data(r->start);
|
||||
if (!irqd) {
|
||||
ret = -ENXIO;
|
||||
goto out;
|
||||
}
|
||||
if (!irqd)
|
||||
goto out_not_found;
|
||||
irqd_set_trigger_type(irqd, r->flags & IORESOURCE_BITS);
|
||||
}
|
||||
|
||||
|
@ -249,8 +247,9 @@ int platform_get_irq_optional(struct platform_device *dev, unsigned int num)
|
|||
goto out;
|
||||
}
|
||||
|
||||
ret = -ENXIO;
|
||||
#endif
|
||||
out_not_found:
|
||||
ret = -ENXIO;
|
||||
out:
|
||||
WARN(ret == 0, "0 is an invalid IRQ number\n");
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Reference in a new issue