From: Daniel Mack Date: Thu, 4 Sep 2014 07:00:23 +0000 (+0200) Subject: net: ethernet: cpsw: improve interrupt lookup logic in cpsw_probe() X-Git-Tag: omap-for-v3.19/prcm-cleanup~78^2~155 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c2b32e580ccc574cf353661ee6d900947e9fdf28;p=pandora-kernel.git net: ethernet: cpsw: improve interrupt lookup logic in cpsw_probe() Simplify the interrupt resource lookup code in cpsw_probe() by the following: * Only look at the first member of the resource. As the driver only works for DT-enabled platforms anyway, a resource of type IORESOURCE_IRQ will only contain one single entry (res->start == res->end), so there is no need for the iteration. * Add a bounds check to avoid overflows if we are passed more than ARRAY_SIZE(priv->irqs_table) resources. * Assign 'ret' with the return value of devm_request_irq() so that cpsw_probe() returns the appropriate error code. * If devm_request_irq() fails, report the error code in the log message. Signed-off-by: Daniel Mack Acked-by: Mugunthan V N Signed-off-by: David S. Miller --- Reading git-diff-tree failed