Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4589445ybg; Mon, 21 Oct 2019 11:14:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHubQxMHakft6nWjCt0pinCDvhWSDaWgCqmz17TH6IyBWbffHF9fOLAlPEtp+Wi9G2f4eN X-Received: by 2002:a17:906:6a09:: with SMTP id o9mr23115226ejr.289.1571681670372; Mon, 21 Oct 2019 11:14:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571681670; cv=none; d=google.com; s=arc-20160816; b=F9dbeNkthkzqsyL4NE91i6svT+LsZlQwXr+ChSKpxH3FrrWEKkkVJW+aKLS90Iiisd RoZ2ZFsGsYVA+wYPvAke/oKvnoMc4MCD84UFVL+cmcbFLgNzO/TceSMizDRGsX43KrMF 5FMBQ3RQlgmtTgHRRmQMT3boYTfWLBMBTe289XkbC7akN4lLKFhfyIekNAJ4YeUIBf1b CTHGyX+YV5wkjmn0+zXPwxMge1krxy5YJOdNBhp5sH+RKbNtg8FiiIV41rJBdIqI5h6n Huzb6SQRl12MlWV+SgfIvSpxojY7MCOmPOYdaLJEGpZNHUiKzI1PKnodxeu6xJFaFDUC tvuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=mnkunLEF23UbiKstBGeBSKdC/co/nIvZTCOX/NZlbww=; b=agWSe8jSYW0/qBi3qcwT+bL9MTHtrDlnz/Mp7iBqZbzpJ84u/ojkhXcRhdy86G/KZF nyo2Q7OxVT+1AFLbXnUBZMTl3yh8GOyYLfGWbMMCBlIl9NzKA5whqfW33XvQJE4SCj+U LB0RLO0gUjHPAIsHUdANdtglzHPdgchH2UgIWbkWx7IVNS583u9Pilxlxh6z/L62UHE3 ZaMRgC7zKMu+Nr1r4V0XSmm0DBaF+sALhj58DJQAeNtK/luvOPtnmgtZRgHgTeCdzzVN nKUr+QhVtYbvyCXAZK5oD80TvHQOksiZgVKcvDlwGsjNA7FQtxq+em+aHNSEoUCpziVd DdMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@embeddedor.com header.s=default header.b=tUM3lE38; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w10si8564622eju.156.2019.10.21.11.14.04; Mon, 21 Oct 2019 11:14:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@embeddedor.com header.s=default header.b=tUM3lE38; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729894AbfJUSLh (ORCPT + 99 others); Mon, 21 Oct 2019 14:11:37 -0400 Received: from gateway30.websitewelcome.com ([192.185.197.25]:44764 "EHLO gateway30.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727211AbfJUSLh (ORCPT ); Mon, 21 Oct 2019 14:11:37 -0400 X-Greylist: delayed 1301 seconds by postgrey-1.27 at vger.kernel.org; Mon, 21 Oct 2019 14:11:36 EDT Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 275D435422 for ; Mon, 21 Oct 2019 12:49:48 -0500 (CDT) Received: from gator4166.hostgator.com ([108.167.133.22]) by cmsmtp with SMTP id MboSiKZqnOdBHMboSig39H; Mon, 21 Oct 2019 12:49:48 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=embeddedor.com; s=default; h=Content-Type:MIME-Version:Message-ID:Subject: Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=mnkunLEF23UbiKstBGeBSKdC/co/nIvZTCOX/NZlbww=; b=tUM3lE38Ag01bD4YI89LCWIkMh /iA+bY0K0sithlPdbdStN0PDu25sb/avL8AlbdrA32oPewpKZicCe4GhwAOG7fwAZEtZmCsezatIF bZ5nqIaQPnizANZDFU8wAyREhzMsQ9wPRBWwyOIF8NdSzpjuHWFmKV9DQEfwttUkp9HcdpeFSvgBZ NJi9+/i6Wyw1eOEdwaurDIFIty0dbIzxr+nkiWFzLDWo/Xlp5xaP3T+juJprPiSUdJEkNertbINah RRGHv/GlKgUW/Bu5z5c3i6m6wilxdZdv/W19BR6RZlIn6i6eB3PyQTA7kcbvzDpb+MAbaiTwPULqt WTr+a2YA==; Received: from [187.192.22.73] (port=33626 helo=embeddedor) by gator4166.hostgator.com with esmtpa (Exim 4.92) (envelope-from ) id 1iMboQ-000AL9-QC; Mon, 21 Oct 2019 12:49:47 -0500 Date: Mon, 21 Oct 2019 12:49:37 -0500 From: "Gustavo A. R. Silva" To: Sebastian Reichel , Jonathan Cameron , Linus Walleij Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" Subject: [PATCH] power: supply: ab8500_charger: Fix inconsistent IS_ERR and PTR_ERR Message-ID: <20191021174937.GA17424@embeddedor> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 187.192.22.73 X-Source-L: No X-Exim-ID: 1iMboQ-000AL9-QC X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: (embeddedor) [187.192.22.73]:33626 X-Source-Auth: gustavo@embeddedor.com X-Email-Count: 5 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= X-Local-Domain: yes Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix inconsistent IS_ERR and PTR_ERR in ab8500_charger_probe(). The proper pointer to be passed as argument is di->adc_main_charger_c This bug was detected with the help of Coccinelle. Fixes: 97ab78bac5d0 ("power: supply: ab8500_charger: Convert to IIO ADC") Signed-off-by: Gustavo A. R. Silva --- drivers/power/supply/ab8500_charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c index ff2bb4411a22..8a0f9d769690 100644 --- a/drivers/power/supply/ab8500_charger.c +++ b/drivers/power/supply/ab8500_charger.c @@ -3393,7 +3393,7 @@ static int ab8500_charger_probe(struct platform_device *pdev) if (PTR_ERR(di->adc_main_charger_c) == -ENODEV) return -EPROBE_DEFER; dev_err(&pdev->dev, "failed to get ADC main charger current\n"); - return PTR_ERR(di->adc_main_charger_v); + return PTR_ERR(di->adc_main_charger_c); } di->adc_vbus_v = devm_iio_channel_get(&pdev->dev, "vbus_v"); if (IS_ERR(di->adc_vbus_v)) { -- 2.23.0