2015-02-26 20:06:07

by Ameya Palande

[permalink] [raw]
Subject: [PATCH] mfd: kempld-core: Fix callback return value check

On success, callback function returns 0. So invert the if condition
check so that we can break out of loop.

Cc: [email protected]
Signed-off-by: Ameya Palande <[email protected]>
---
drivers/mfd/kempld-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/kempld-core.c b/drivers/mfd/kempld-core.c
index f38ec42..5615522 100644
--- a/drivers/mfd/kempld-core.c
+++ b/drivers/mfd/kempld-core.c
@@ -739,7 +739,7 @@ static int __init kempld_init(void)
for (id = kempld_dmi_table;
id->matches[0].slot != DMI_NONE; id++)
if (strstr(id->ident, force_device_id))
- if (id->callback && id->callback(id))
+ if (id->callback && !id->callback(id))
break;
if (id->matches[0].slot == DMI_NONE)
return -ENODEV;
--
1.8.3.1