From patchwork Tue Sep 25 11:01:19 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 11715 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 1FF0A23EFC for ; Tue, 25 Sep 2012 11:05:22 +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 B72EFA1906B for ; Tue, 25 Sep 2012 11:05:21 +0000 (UTC) Received: by ieje10 with SMTP id e10so12473510iej.11 for ; Tue, 25 Sep 2012 04:05:21 -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=MUknZeovgcIRFVoDzqyvhKQZRPiXvxdwO1J/nWExB9Q=; b=BD3plNo5zg72k9ywnBpGxGGIVcvyYiJ60L7xz4TDmxOmQv4y+vQafSkJqiEJ9S2V1/ pBrYu9V2joTs4vzzRXdFXlIZjaiQ7KXnUc/IGoQfzN+gO/7MbWSqBlG3XXPPZMrgQRfT qtra4L8I0f6ahkHupGr8nd2vYgmisP70QHcvDfF+TS1V5qV3nOauLOAtCSsOV2sLZFqQ WUxkjCTuLuXRMuR5BsHGtmivwRjKKxwnf8cFkceQ0MNPyQkByQZgaLt4KFM1uXXC4+wa HtydyaPWTkNHqFQKmEbpZRycZweoJR7Wu48BIMliRfHDwcE7YDVFbU+EXbOl5HKjcxz/ bE9A== Received: by 10.42.109.194 with SMTP id m2mr11568743icp.48.1348571121041; Tue, 25 Sep 2012 04:05:21 -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 ex8csp287823igc; Tue, 25 Sep 2012 04:05:20 -0700 (PDT) Received: by 10.68.194.165 with SMTP id hx5mr45733452pbc.40.1348571120196; Tue, 25 Sep 2012 04:05:20 -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 pj1si337903pbc.205.2012.09.25.04.05.19 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Sep 2012 04:05:20 -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 hz11so2165091pad.37 for ; Tue, 25 Sep 2012 04:05:19 -0700 (PDT) Received: by 10.68.203.228 with SMTP id kt4mr44526384pbc.87.1348571119151; Tue, 25 Sep 2012 04:05:19 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id te6sm177555pbc.29.2012.09.25.04.05.14 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Sep 2012 04:05:18 -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 Resend] extcon: Fix return value in extcon_register_interest() Date: Tue, 25 Sep 2012 16:31:19 +0530 Message-Id: <1348570879-24067-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQkfVN8t1ePKqU7J6A5n7/TT+NQPtQJm4j/AnRGUIrXiZ0njg2zyQ7ytJhb2BK3xh9G/rhLH Propagate the value returned from extcon_find_cable_index() instead of -ENODEV. For readability, -EINVAL is returned in place of the variable. 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..6348b64 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 -EINVAL; obj->user_nb = nb;