HIS: nokia-modem: fix error handling of irq_of_parse_and_map
PATCH 1/1 HIS: nokia-modem: fix error handling of irq_of_parse_and_map
Return value of irq_of_parse_and_map() is unsigned int, with 0 indicating failure, so testing for negative result never works.
Signed-off-by Dmitry Torokhov <[email protected]>
---
Not tested, found by casual code inspection.
drivers/hsi/clients/nokia-modem.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hsi/clients/nokia-modem.c +2 -2
@@ -164,9 +164,9 @@ static int nokia_modem_probe(struct device *dev)dev_set_drvdata (dev, modem); irq =irq_of_parse_and_map (np,0 ); -if (irq <0 ) { +if (!irq) {dev_err (dev,"Invalid rst_ind interrupt (%d)\n" , irq); -return irq; +return -EINVAL ; } modem->nokia_modem_rst_ind_irq = irq; pflags =irq_get_trigger_type (irq);
Signature · 5 lines
2.1.0.rc2.206.gedb03e5 -- Dmitry
Sebastian Reichel
maintainerQuoted 4 lines · Dmitry Torokhov
Return value of
irq_of_parse_and_map()is unsigned int, with 0 indicating failure, so testing for negative result never works.Signed-off-by Dmitry Torokhov <[email protected]>
-- Sebastian
Pavel Machek
Acked-byQuoted 8 lines · Sebastian Reichel
Quoted 4 lines · Dmitry Torokhov
Return value of
irq_of_parse_and_map()is unsigned int, with 0 indicating failure, so testing for negative result never works.Signed-off-by Dmitry Torokhov <[email protected]>
Acked-by Pavel Machek <[email protected]>
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html