Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 114fd183 authored by Jean Delvare's avatar Jean Delvare Committed by Greg Kroah-Hartman
Browse files

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: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 7eff82c8
Loading
Loading
Loading
Loading
+7 −2
Original line number Original line Diff line number Diff line
@@ -707,11 +707,16 @@ static int i2c_probe_address(struct i2c_adapter *adapter, int addr, int kind,


	/* Finally call the custom detection function */
	/* Finally call the custom detection function */
	err = found_proc(adapter, addr, kind);
	err = found_proc(adapter, addr, kind);

	/* -ENODEV can be returned if there is a chip at the given address
	/* -ENODEV can be returned if there is a chip at the given address
	   but it isn't supported by this chip driver. We catch it here as
	   but it isn't supported by this chip driver. We catch it here as
	   this isn't an error. */
	   this isn't an error. */
	return (err == -ENODEV) ? 0 : err;
	if (err == -ENODEV)
		err = 0;

	if (err)
		dev_warn(&adapter->dev, "Client creation failed at 0x%x (%d)\n",
			 addr, err);
	return err;
}
}


int i2c_probe(struct i2c_adapter *adapter,
int i2c_probe(struct i2c_adapter *adapter,