From patchwork Thu Aug 23 00:28:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 1363901 Return-Path: X-Original-To: patchwork-spi-devel-general@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by patchwork1.kernel.org (Postfix) with ESMTP id 157843FC71 for ; Thu, 23 Aug 2012 00:28:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1T4LI9-0004Xp-Gy; Thu, 23 Aug 2012 00:28:57 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1T4LI8-0004Xj-4j for spi-devel-general@lists.sourceforge.net; Thu, 23 Aug 2012 00:28:56 +0000 X-ACL-Warn: Received: from mail.active-venture.com ([67.228.131.205]) by sog-mx-1.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1T4LI7-0004Hv-E6 for spi-devel-general@lists.sourceforge.net; Thu, 23 Aug 2012 00:28:56 +0000 Received: (qmail 55693 invoked by uid 399); 23 Aug 2012 00:28:49 -0000 X-Virus-Scan: Scanned by ClamAV 0.97.2 (no viruses); Wed, 22 Aug 2012 19:28:49 -0500 Received: from unknown (HELO localhost) (guenter@roeck-us.net@108.223.40.66) by mail.active-venture.com with ESMTPAM; 23 Aug 2012 00:28:49 -0000 X-Originating-IP: 108.223.40.66 X-Sender: guenter@roeck-us.net From: Guenter Roeck To: spi-devel-general@lists.sourceforge.net Subject: [PATCH] spi/sc18is602: Return -EINVAL for probe failures due to I2C function mismatch Date: Wed, 22 Aug 2012 17:28:55 -0700 Message-Id: <1345681735-13496-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 1.7.9.7 X-Spam-Score: 0.1 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 0.1 AWL AWL: From: address is in the auto white-list X-Headers-End: 1T4LI7-0004Hv-E6 Cc: Mark Brown , Guenter Roeck X-BeenThere: spi-devel-general@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: Linux SPI core/device drivers discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: spi-devel-general-bounces@lists.sourceforge.net 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 --- drivers/spi/spi-sc18is602.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)