net: ethernet: cpsw: improve interrupt lookup logic in cpsw_probe()
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 <70806a71956ed8873ecff8522779dae1401a1b4a@gmail.com>
Acked-by: Mugunthan V N <c5344daf2e7bda9dbffd8e6718db2d989f7f4819@gmail.com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>

KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs