diff mbox

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

Message ID 1345681735-13496-1-git-send-email-linux@roeck-us.net (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Guenter Roeck Aug. 23, 2012, 12:28 a.m. UTC
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>
---
 drivers/spi/spi-sc18is602.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/drivers/spi/spi-sc18is602.c b/drivers/spi/spi-sc18is602.c
index dd98964..9eda21d 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,
 
 	if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C |
 				     I2C_FUNC_SMBUS_WRITE_BYTE_DATA))
-		return -ENODEV;
+		return -EINVAL;
 
 	master = spi_alloc_master(dev, sizeof(struct sc18is602));
 	if (!master)