diff options
author | Guenter Roeck <linux@roeck-us.net> | 2012-08-22 20:28:55 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2012-08-23 07:13:54 -0400 |
commit | 58ed90de3ef58a19c035355a4a0cd6dfef6d6b0c (patch) | |
tree | 41dd44c2d22f365d9d7f2cb4b1335cf9d3180952 | |
parent | 41962f90c605983fb04c23bab9c060c9f49ee4c3 (diff) |
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: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r-- | drivers/spi/spi-sc18is602.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-sc18is602.c b/drivers/spi/spi-sc18is602.c index dd9896423f0b..9eda21d739c6 100644 --- a/drivers/spi/spi-sc18is602.c +++ b/drivers/spi/spi-sc18is602.c | |||
@@ -275,7 +275,7 @@ static int sc18is602_probe(struct i2c_client *client, | |||
275 | 275 | ||
276 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C | | 276 | if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C | |
277 | I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) | 277 | I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) |
278 | return -ENODEV; | 278 | return -EINVAL; |
279 | 279 | ||
280 | master = spi_alloc_master(dev, sizeof(struct sc18is602)); | 280 | master = spi_alloc_master(dev, sizeof(struct sc18is602)); |
281 | if (!master) | 281 | if (!master) |