From patchwork Sat Oct 15 08:26:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13007620 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD1E9C4332F for ; Sat, 15 Oct 2022 08:27:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229485AbiJOI1A (ORCPT ); Sat, 15 Oct 2022 04:27:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbiJOI07 (ORCPT ); Sat, 15 Oct 2022 04:26:59 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51FA35007D; Sat, 15 Oct 2022 01:26:56 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29F8BtIY012234; Sat, 15 Oct 2022 08:26:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : content-type : mime-version; s=corp-2022-7-12; bh=4E3hi4f0lGJNzZ0C9yluMXI76fVAAui2Gpa2AVnZ+xc=; b=ZsYGZIQ0ESFaclcI3qhXy85PYP48+TrLhyHBl4lo3m6alTrv4mYasoZxFFg+ZUSf8xt5 w4mz6vgzfyIxzb0JM0WxSndYRo0HcE3mCQttM8FtP1LLsv1KNSXwUBf4JjMVLhdjLMnt 3XEqrKPz4KIWbxEG9Fj+RPJa1ze3SUwcmhDvQUEPOBD8hEWBoPB1GmYZ/fPjoQ75l06v Yoffvv65iEvBB9IFjq4wprw8u7+yfjzXSFX+Eqm1RDhxxMRObFlw4TAplx0gq+4lCDhH 8/b9FzxGgwaPwvk5hQkHzeFjd9FRO3sP0u4mOermSdvJgGN6scBneExdcqzboC3ZZTz8 bQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k7mw38721-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 15 Oct 2022 08:26:50 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 29F3DdDl030748; Sat, 15 Oct 2022 08:26:49 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2044.outbound.protection.outlook.com [104.47.66.44]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3k7ka1d3s0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 15 Oct 2022 08:26:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=esrMv5pPYC4KLUci7hDQ1K7pUnwg9h6NHByDH6qZkHAbRaN0eHU5IkMXMTkhZ84MlmcqPk/VXGa7VbBx2dHUgZ5zoLmoKPiTqCpfA8CPmAL8vEEsk+Tf48dENjPTOwvR/wg8iShEk+uXo9CsziFNTUeSI6yzYsZx9Kn+iXJJGnAcYYp56YkaDZLzMHOHtdB5kxnpSyAPlclr7bIdNzNEwQ6R/4qaqwE7pRk06POq1KKIaYg2hXAm4Pvy0Hjb2IHP0hlqEIbyM6dyxIdyLlTbq2Rb1kim10Kk20hpZEx+qU7fXoL4C5Ltl5dRmoxpaO0JzRn+U/SE/Qfjwp95MyZSXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4E3hi4f0lGJNzZ0C9yluMXI76fVAAui2Gpa2AVnZ+xc=; b=M9NAb8M7BgpbVVzZs9miwh03x6Z6c4MQvJOnzA/mhrBBBxSVTDH8KOx3y8wvN0oKx90+NhzoEDTfSMnWa+7dN++ZEYF6Mgj5S9cokU41mtb2kXqPLyYGF67RhaEdbTjPkpZvKpRB3lj2n48/McNMIlNq8eNPNUsHFbDEDmlDLkfD9RnhQlrTv33inUBzLHG6u4clrjuHjjkonm4wgxw/Rq6Tg3Q8+kMAWBRqWnEV1WvQYediM1hk0qbz34jUKyNJRqv9p+jWx9ipfd3zz7r4Z5eoJEFVIFN64y2XHfFQI9qduFDKpZfzzlgjtch4ppGVNoh6mg4vgSGQ43qh8T2fcA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4E3hi4f0lGJNzZ0C9yluMXI76fVAAui2Gpa2AVnZ+xc=; b=hd2ayJmAEOByFEeWwBe7kmUT2IPPNQNMuJb/JpHtnPo9WNZzgW/zOtYE3K+Kgae3IuM5C/+uHU5I6xbyKX1HXVudlVCW7dryfQ5KgqOX8zuiSBGTTeQzbpogj24rnpT2QbL6CJQme3o62XU6IVxDGEKb5YTx6UnE2pV6DO/MeEM= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by PH0PR10MB5595.namprd10.prod.outlook.com (2603:10b6:510:f7::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15; Sat, 15 Oct 2022 08:26:47 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::1b8e:540e:10f0:9aec]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::1b8e:540e:10f0:9aec%4]) with mapi id 15.20.5676.031; Sat, 15 Oct 2022 08:26:47 +0000 Date: Sat, 15 Oct 2022 11:26:37 +0300 From: Dan Carpenter To: Sebastian Reichel , Chris Morgan Cc: Lee Jones , Maya Matuszczyk , linux-pm@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] power: supply: rk817: check correct variable Message-ID: Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-ClientProxiedBy: LO2P123CA0065.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1::29) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2365:EE_|PH0PR10MB5595:EE_ X-MS-Office365-Filtering-Correlation-Id: d75731ae-a54f-485c-da4c-08daae870016 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WeJSYhd67Yss9lZMBWc3urOKxUa+QuMM4RROOyuDs6/+zhMUrDpAmaJshM8HkaKZMjgZ9jF50OGY5em8tODB53nkOaxAWESI1qMBZlIlpfQm10UoutO0UjWzenrNdHK4/e7ycZImFNiaK8nE6mutOZmWgRbF/Gn2VBFd73xnqxLxh1E+EqMKu3Wrm9klJQ7I159k2XjDDBhhNghD9SZB9GXhqDE/8h0E6kZoZ22mizjD3MAHRZHqEDMLcWxtiKexae+DiuqIO3HkiXUgGtwC8ULCT4ZOWIYa7X98TEzueOBSY24WJpaX1oZs+QkdugK3LUXTjhjwUyPofMd/MpV56dwDdXDwUBdnALJfZ9Av7l9Sknczs81AnX8Eb+pqkLf81FUwysNuM3n72FQusispLBu6v89+dOYFY9Gj+afOPj+Hf3laRxPqYrco4Pb0NvCE1DDxH243hv8BzARi8/zxNsg8+2SwGe7lGx1hwB0MRduQ2HkExjJpuQHA1Rd4NHdVkwFLumBk2wf89+u73C4VrHap9xJc9vjDyPyGQEAaUtvFdWzShPcMrToIbWnrUZNXxa1XGg+s8HzRma484oUzjXjopy+jYZ9pml5SSnB4fyquyVMKGgRCGVmH9w1PKb8/3milGF4b/sBUkZixtkCYMDK/7UItJH2/Yb8IdK8zOrQ3skLsH+iQdyBM3MT+yimS4gnirSl3eUsEiRzAGrv5Iw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2365.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(7916004)(396003)(376002)(366004)(136003)(346002)(39860400002)(451199015)(66556008)(54906003)(110136005)(8936002)(38100700002)(5660300002)(6506007)(186003)(86362001)(66476007)(316002)(8676002)(9686003)(6666004)(83380400001)(4326008)(6512007)(44832011)(478600001)(6486002)(33716001)(2906002)(41300700001)(26005)(66946007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: AAnB6GrudGPOVEVxVG1wA+uTq3gcm95RizAbYU/LmuMq92OjWnna3XAvwt3f++ImyKxKQyslGfWVgB2ELBN75Ht059Cvd8chz4mioAs0Bs1+0qC6LnnUXhrs+nju4euoWa2TDCVH2vf64WGHoSCkxd9S++fElAyghWofZXt2PQk+lFRYGGyqPx7DGxfDBE/3fNUtVxJQ/DWe1LgwKXJ+50/JpqzvNNMQUYvIjMUoU2yNY2o4jXIEg62RCZuJy4SdZUB/ukF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mOJs9Nx8jWMXs5Uy5O5WaZMrxeiwiZFPDMIaf+vI9QmpEdInxcrLRXCiWVIISTC14SmNLPX/ngav8/SKslXDbc/5RgHcDaIVJxDI7IVlPgFGAKXPBZRoTcCm3eFD3dqKfJwrOaSfbs/tjQgBKzP0EfVdr6W60uf5RKtQA/Y1VutjNuFI9GcSfEQTop63a3V/+dWq+FOBllw8Nk2Cx09CxkM8pP5EgnnbN7vpsYmVk3KUlNzwulvvYwnYfHTe8CUUqV09dMHDDF/Pvw== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: d75731ae-a54f-485c-da4c-08daae870016 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2022 08:26:47.2755 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lvSvyclnPjIylAih9FBNZ+Cu8wcT8RlQUv5/EBH2lTkvdOCwJDeHcH8DiKTzk5qTL/fmeosjqSPBlIYbeYenUPPRNaEpVZg6Rq/oZ/EpIAs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5595 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-15_04,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 adultscore=0 mlxscore=0 malwarescore=0 bulkscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210150047 X-Proofpoint-ORIG-GUID: Q0VLKKuX7AMDC5FgQbNvwrZvDoF0OIF_ X-Proofpoint-GUID: Q0VLKKuX7AMDC5FgQbNvwrZvDoF0OIF_ Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This code checks "->chg_ps" twice when it was supposed to check "->bat_ps". Fixes: 11cb8da0189b ("power: supply: Add charger driver for Rockchip RK817") Signed-off-by: Dan Carpenter Tested-by: Chris Morgan --- drivers/power/supply/rk817_charger.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/power/supply/rk817_charger.c b/drivers/power/supply/rk817_charger.c index 635f051b0821..4e9c7b191266 100644 --- a/drivers/power/supply/rk817_charger.c +++ b/drivers/power/supply/rk817_charger.c @@ -1116,14 +1116,12 @@ static int rk817_charger_probe(struct platform_device *pdev) charger->bat_ps = devm_power_supply_register(&pdev->dev, &rk817_bat_desc, &pscfg); - - charger->chg_ps = devm_power_supply_register(&pdev->dev, - &rk817_chg_desc, &pscfg); - - if (IS_ERR(charger->chg_ps)) + if (IS_ERR(charger->bat_ps)) return dev_err_probe(dev, -EINVAL, "Battery failed to probe\n"); + charger->chg_ps = devm_power_supply_register(&pdev->dev, + &rk817_chg_desc, &pscfg); if (IS_ERR(charger->chg_ps)) return dev_err_probe(dev, -EINVAL, "Charger failed to probe\n");