From patchwork Wed Sep 12 06:34:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 11345 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 BAEE723EFE for ; Wed, 12 Sep 2012 06:37:14 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 1CF5D3D783D0 for ; Wed, 12 Sep 2012 06:37:14 +0000 (UTC) Received: by ieak11 with SMTP id k11so2291797iea.11 for ; Tue, 11 Sep 2012 23:37:13 -0700 (PDT) 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:x-gm-message-state; bh=xiyeCOEcDcbThM3KYSZ7NEPv0wY1KKaokNNZEBxVWdk=; b=QIGwxoVu3FWQ1D1dmdFZ7ZJCK1lTcYlWZJuq9OA5m2UfNOMwt7q9iuf8d1u+5SIJAB ykWSxxEKlz/gwUoXlXPXQWNrpjPPYe2KCXdb1PKPwFKgLHrc0K26RnkdquTwBXxo1H7l CUhyDhTnSC/fq2o6BkaNwKMGfPVtkiv1IUbd5U3GFNPWZo7esO8Zt6y9KRs7fg04ZdA4 vskV2iorWYfRs12gYB24fxwLSeVZP8Y92+6fQ5YkoS+Jv3jHCyDYHjSw7FIZIPvmMiib E5PXdpa0uJfyHNvsh6rvUAsi5nRCV+KYFpvPu0S+aCKCxjKFHKAGxciRWmJVwHnI+M0g RGmw== Received: by 10.42.60.139 with SMTP id q11mr24035045ich.53.1347431833464; Tue, 11 Sep 2012 23:37:13 -0700 (PDT) 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.184.232 with SMTP id ex8csp54054igc; Tue, 11 Sep 2012 23:37:13 -0700 (PDT) Received: by 10.68.129.73 with SMTP id nu9mr15678101pbb.59.1347431832858; Tue, 11 Sep 2012 23:37:12 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id ts2si9607888pbc.86.2012.09.11.23.37.12 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 11 Sep 2012 23:37:12 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by pbcmd12 with SMTP id md12so2086100pbc.37 for ; Tue, 11 Sep 2012 23:37:12 -0700 (PDT) Received: by 10.68.220.104 with SMTP id pv8mr15495598pbc.119.1347431832472; Tue, 11 Sep 2012 23:37:12 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id po4sm10953000pbb.13.2012.09.11.23.37.09 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 11 Sep 2012 23:37:11 -0700 (PDT) From: Sachin Kamat To: linux-leds@vger.kernel.org Cc: bryan.wu@canonical.com, fengguang.wu@intel.com, kernel-janitors@vger.kernel.org, sachin.kamat@linaro.org, patches@linaro.org, Shreshtha Kumar SAHU Subject: [PATCH Resend] leds-lm3530: Fix smatch warnings Date: Wed, 12 Sep 2012 12:04:09 +0530 Message-Id: <1347431649-3776-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQlBjdWmDOosAt1a/WY7UI3jgdKOIS6dJBYCpFrt8/u08/QAHwJ6BxhjK1BFcc0CihK7x9LX Fixes the following smatch warnings: drivers/leds/leds-lm3530.c:361 lm3530_mode_set() info: why not propagate 'mode' from lm3530_get_mode_from_str() instead of -22? drivers/leds/leds-lm3530.c:432 lm3530_probe() info: why not propagate 'err' from lm3530_init_registers() instead of -19? drivers/leds/leds-lm3530.c:438 lm3530_probe() info: why not propagate 'err' from led_classdev_register() instead of -19? Reported-by: Fengguang Wu Cc: Shreshtha Kumar SAHU Signed-off-by: Sachin Kamat --- drivers/leds/leds-lm3530.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/leds/leds-lm3530.c b/drivers/leds/leds-lm3530.c index 1e7ed2a..b26306f 100644 --- a/drivers/leds/leds-lm3530.c +++ b/drivers/leds/leds-lm3530.c @@ -150,7 +150,7 @@ static int lm3530_get_mode_from_str(const char *str) if (sysfs_streq(str, mode_map[i].mode)) return mode_map[i].mode_val; - return -1; + return -EINVAL; } static void lm3530_als_configure(struct lm3530_platform_data *pdata, @@ -358,7 +358,7 @@ static ssize_t lm3530_mode_set(struct device *dev, struct device_attribute mode = lm3530_get_mode_from_str(buf); if (mode < 0) { dev_err(dev, "Invalid mode\n"); - return -EINVAL; + return mode; } drvdata->mode = mode; @@ -429,13 +429,13 @@ static int __devinit lm3530_probe(struct i2c_client *client, if (err < 0) { dev_err(&client->dev, "Register Init failed: %d\n", err); - return -ENODEV; + return err; } } err = led_classdev_register(&client->dev, &drvdata->led_dev); if (err < 0) { dev_err(&client->dev, "Register led class failed: %d\n", err); - return -ENODEV; + return err; } err = device_create_file(drvdata->led_dev.dev, &dev_attr_mode);