提交 58ed90de 编写于 作者: G Guenter Roeck 提交者: Mark Brown

spi/sc18is602: Return -EINVAL for probe failures due to I2C function mismatch

If the I2C bus master driver does not support the required functionality,
the driver returns -ENODEV. This causes a silent probe failure without error
message. Since the device has to be explicitly instantiated, and the user
should know the correct bus, this event really reflects an error condition.
Replace error return value with -EINVAL to trigger an error message showing
that the probe function failed.
Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 41962f90
...@@ -275,7 +275,7 @@ static int sc18is602_probe(struct i2c_client *client, ...@@ -275,7 +275,7 @@ static int sc18is602_probe(struct i2c_client *client,
if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C | if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C |
I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) I2C_FUNC_SMBUS_WRITE_BYTE_DATA))
return -ENODEV; return -EINVAL;
master = spi_alloc_master(dev, sizeof(struct sc18is602)); master = spi_alloc_master(dev, sizeof(struct sc18is602));
if (!master) if (!master)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册