diff options
author | Jean Delvare <khali@linux-fr.org> | 2006-09-03 16:25:04 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-09-26 18:38:52 -0400 |
commit | 114fd18397eb0eacf51ac784f7d5c929b8499715 (patch) | |
tree | 902287737d800a5bcfa382419e48f98f7ed502fe /drivers/i2c | |
parent | 7eff82c8b1511017ae605f0c99ac275a7e21b867 (diff) |
i2c: Warn on i2c client creation failure
i2c: Warn on i2c client creation failure
Warn when an i2c client creation fails. If we don't, the user will
never know something wrong happened, as i2c client creation is
typically called through an attach_adapter callback, those return value
we currently ignore for technical reasons.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/i2c-core.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 88dd803174a1..01233f0f7771 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -707,11 +707,16 @@ static int i2c_probe_address(struct i2c_adapter *adapter, int addr, int kind, | |||
707 | 707 | ||
708 | /* Finally call the custom detection function */ | 708 | /* Finally call the custom detection function */ |
709 | err = found_proc(adapter, addr, kind); | 709 | err = found_proc(adapter, addr, kind); |
710 | |||
711 | /* -ENODEV can be returned if there is a chip at the given address | 710 | /* -ENODEV can be returned if there is a chip at the given address |
712 | but it isn't supported by this chip driver. We catch it here as | 711 | but it isn't supported by this chip driver. We catch it here as |
713 | this isn't an error. */ | 712 | this isn't an error. */ |
714 | return (err == -ENODEV) ? 0 : err; | 713 | if (err == -ENODEV) |
714 | err = 0; | ||
715 | |||
716 | if (err) | ||
717 | dev_warn(&adapter->dev, "Client creation failed at 0x%x (%d)\n", | ||
718 | addr, err); | ||
719 | return err; | ||
715 | } | 720 | } |
716 | 721 | ||
717 | int i2c_probe(struct i2c_adapter *adapter, | 722 | int i2c_probe(struct i2c_adapter *adapter, |