From patchwork Tue Nov 20 09:59:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 12980 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 751F823DFE for ; Tue, 20 Nov 2012 10:05:25 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 1F4C3A19B1A for ; Tue, 20 Nov 2012 10:05:25 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id t4so1595098iag.11 for ; Tue, 20 Nov 2012 02:05:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=l6vuEplGB0JeLL4Y4Ep7pR8AU91NYO3e8dgit+0OowQ=; b=Ca/e/1XxExMlCD4xb4K0T6wHJuciYH/0ufskYc7+FvYsLvJ7Z7vjYzelZavgh//f9C ovHJcYRPD8FEaw+CXqxA7zTPo+l5m8nwPZXVRmoO0YER904nSlvfH4xUwjL+LCFwj2KN 1xRJYg667Am618ZW0QhBt+TaxCo977YDICT7dR/AJX6oxiEZhsgx70qZe1vlHeXViOib KHdOUmB28196v6oDN49cSkU1cHk+i5Y71TphfnUugh7KnNVofzfOfaHTiMqx2/sXtJug PRrsNXtGnuX6jGKHPIdo4f7m4hKXMUOG0ggv7/bZ6rwnNInaSy/13c+oDPdc/lq3GSd4 DKBw== Received: by 10.50.173.34 with SMTP id bh2mr9329780igc.70.1353405924709; Tue, 20 Nov 2012 02:05:24 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp294574igt; Tue, 20 Nov 2012 02:05:24 -0800 (PST) Received: by 10.68.197.71 with SMTP id is7mr47274737pbc.79.1353405924185; Tue, 20 Nov 2012 02:05:24 -0800 (PST) Received: from mail-da0-f53.google.com (mail-da0-f53.google.com [209.85.210.53]) by mx.google.com with ESMTPS id m8si17261838pav.249.2012.11.20.02.05.24 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 02:05:24 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.53 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.210.53; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.53 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-da0-f53.google.com with SMTP id x6so126817dac.26 for ; Tue, 20 Nov 2012 02:05:24 -0800 (PST) Received: by 10.68.252.133 with SMTP id zs5mr41474139pbc.152.1353405923958; Tue, 20 Nov 2012 02:05:23 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id s1sm7841420paz.0.2012.11.20.02.05.17 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Nov 2012 02:05:23 -0800 (PST) From: Sachin Kamat To: linux-leds@vger.kernel.org Cc: cooloney@gmail.com, rpurdie@rpsys.net, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH 3/3] leds: lp3944: Fix return value Date: Tue, 20 Nov 2012 15:29:02 +0530 Message-Id: <1353405542-24702-3-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353405542-24702-1-git-send-email-sachin.kamat@linaro.org> References: <1353405542-24702-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQklmgJ7YhoPXH+dzuOcuzcrwgp4MgFJ1qxeXihYH4i5n2uB/WuqS7G2eMxIcDypiGMlPTQn Return the value obtained from i2c_smbus_read_byte_data() instead of -EINVAL. Silences the following smatch warning: drivers/leds/leds-lp3944.c:89 lp3944_reg_read() info: why not propagate 'tmp' from i2c_smbus_read_byte_data() instead of -22? Signed-off-by: Sachin Kamat --- drivers/leds/leds-lp3944.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/leds/leds-lp3944.c b/drivers/leds/leds-lp3944.c index c298f7d..b2d82e2 100644 --- a/drivers/leds/leds-lp3944.c +++ b/drivers/leds/leds-lp3944.c @@ -86,7 +86,7 @@ static int lp3944_reg_read(struct i2c_client *client, u8 reg, u8 *value) tmp = i2c_smbus_read_byte_data(client, reg); if (tmp < 0) - return -EINVAL; + return tmp; *value = tmp;