From patchwork Tue Sep 25 06:58:55 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 11700 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 07DAE23E54 for ; Tue, 25 Sep 2012 07:02:37 +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 A2449A1878B for ; Tue, 25 Sep 2012 07:02:36 +0000 (UTC) Received: by ieje10 with SMTP id e10so12091637iej.11 for ; Tue, 25 Sep 2012 00:02:36 -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=Zo5gEr72oWNi3mG7OqM7IXx6Gt1+Ykl8XdjxFPE+lbQ=; b=icJcBxol6kanjovlYeWEasSsLEDT0MbTl9neoFWnM/m5DuScXKGsS3WT4jRlo4K35f pmybJWuqdMRq+FRnXNAUjvvqqS3HuPOlLUlE+E9zK5IFFeuptyfX9trXnHBdsTuWIVdV 1elCayqZM+1n0QxqFp82FFSsLL1gtvOBHLZzjBIIJTJ7czcmbZng/AggPw5ZGSWRs1k2 2GJfTBGC5EUdUiJvkH4ojVmUZjsQc6kRl6fT12gucqVpeFb0eLTdCiO4OHyKvsZFO314 vSD2q8orn4LrPw1lbZbln3R4szoJziG+jPJnybteka2l3PEOWjkG25XY10bEBnZ92qz5 NsFA== Received: by 10.50.217.229 with SMTP id pb5mr7384345igc.28.1348556556042; Tue, 25 Sep 2012 00:02:36 -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 ex8csp279478igc; Tue, 25 Sep 2012 00:02:35 -0700 (PDT) Received: by 10.66.88.233 with SMTP id bj9mr38263432pab.72.1348556555118; Tue, 25 Sep 2012 00:02:35 -0700 (PDT) Received: from mail-pa0-f50.google.com (mail-pa0-f50.google.com [209.85.220.50]) by mx.google.com with ESMTPS id mt8si21991464pbb.75.2012.09.25.00.02.34 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Sep 2012 00:02:35 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.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 padhz11 with SMTP id hz11so2003380pad.37 for ; Tue, 25 Sep 2012 00:02:34 -0700 (PDT) Received: by 10.66.86.201 with SMTP id r9mr38581593paz.16.1348556554506; Tue, 25 Sep 2012 00:02:34 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id qb2sm10905241pbb.15.2012.09.25.00.02.31 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Sep 2012 00:02:34 -0700 (PDT) From: Sachin Kamat To: linux-kernel@vger.kernel.org Cc: myungjoo.ham@samsung.com, cw00.choi@samsung.com, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH] extcon: Fix return value in extcon_register_interest() Date: Tue, 25 Sep 2012 12:28:55 +0530 Message-Id: <1348556335-14686-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQlaKlFmJZQk0OcrJD41OqoPPp21G6g/wJXzGzYhE5BLI18TRqZNus9qj1aHwob4poVHaHZP Return the value obtained from extcon_find_cable_index() instead of -ENODEV. Fixes the following smatch info: drivers/extcon/extcon-class.c:478 extcon_register_interest() info: why not propagate 'obj->cable_index' from extcon_find_cable_index() instead of -19? Signed-off-by: Sachin Kamat --- drivers/extcon/extcon-class.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/extcon/extcon-class.c b/drivers/extcon/extcon-class.c index 946a318..e996800 100644 --- a/drivers/extcon/extcon-class.c +++ b/drivers/extcon/extcon-class.c @@ -475,7 +475,7 @@ int extcon_register_interest(struct extcon_specific_cable_nb *obj, obj->cable_index = extcon_find_cable_index(obj->edev, cable_name); if (obj->cable_index < 0) - return -ENODEV; + return obj->cable_index; obj->user_nb = nb;