From: David Vrabel Date: Thu, 19 Jan 2006 17:52:27 +0000 (+0000) Subject: [PATCH] driver core: platform_get_irq*(): return -ENXIO on error X-Git-Tag: v2.6.17-rc1~1177^2~19 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=305b3228f9ff4d59f49e6d34a7034d44ee8ce2f0;p=linux-2.6 [PATCH] driver core: platform_get_irq*(): return -ENXIO on error platform_get_irq*() cannot return 0 on error as 0 is a valid IRQ on some platforms, return -ENXIO instead. Signed-off-by: David Vrabel Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 461554a025..89b2683213 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -61,7 +61,7 @@ int platform_get_irq(struct platform_device *dev, unsigned int num) { struct resource *r = platform_get_resource(dev, IORESOURCE_IRQ, num); - return r ? r->start : 0; + return r ? r->start : -ENXIO; } EXPORT_SYMBOL_GPL(platform_get_irq); @@ -98,7 +98,7 @@ int platform_get_irq_byname(struct platform_device *dev, char *name) { struct resource *r = platform_get_resource_byname(dev, IORESOURCE_IRQ, name); - return r ? r->start : 0; + return r ? r->start : -ENXIO; } EXPORT_SYMBOL_GPL(platform_get_irq_byname);