Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Andy Shevchenko and committed by
Greg Kroah-Hartman
c99f4ebc cc710790

+5 -6
+5 -6
drivers/base/platform.c
··· 192 192 #ifdef CONFIG_SPARC 193 193 /* sparc does not have irqs represented as IORESOURCE_IRQ resources */ 194 194 if (!dev || num >= dev->archdata.num_irqs) 195 - return -ENXIO; 195 + goto out_not_found; 196 196 ret = dev->archdata.irqs[num]; 197 197 goto out; 198 198 #else ··· 223 223 struct irq_data *irqd; 224 224 225 225 irqd = irq_get_irq_data(r->start); 226 - if (!irqd) { 227 - ret = -ENXIO; 228 - goto out; 229 - } 226 + if (!irqd) 227 + goto out_not_found; 230 228 irqd_set_trigger_type(irqd, r->flags & IORESOURCE_BITS); 231 229 } 232 230 ··· 247 249 goto out; 248 250 } 249 251 250 - ret = -ENXIO; 251 252 #endif 253 + out_not_found: 254 + ret = -ENXIO; 252 255 out: 253 256 WARN(ret == 0, "0 is an invalid IRQ number\n"); 254 257 return ret;