From patchwork Fri Aug 6 08:16:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 492814 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp90746jap; Fri, 6 Aug 2021 01:22:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvcdRfASl1L/4vvYR8uW1S8vwdA7WXv6aBRh4YSqtGy4K84ChYUKJXlHBHIYm+uEKo4iHJ X-Received: by 2002:aa7:d34b:: with SMTP id m11mr11546337edr.207.1628238124621; Fri, 06 Aug 2021 01:22:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628238124; cv=none; d=google.com; s=arc-20160816; b=OUMR8ZyJ0b8PC+YsSZJudpkDP9Opyz6A+30t7dqnEGLt8wyJGFMNkbO1GMAmhmMZBB azrbaGLlQqwH9PGqInc9uYcrlxZch6cC9qJRRxo8zuVWx6n5XKhDNTGGTfY3EHaG53fe ciks0+ajBH5Ki7aWhNDYi/Ut8xMsZUInJJ8t2hWXXQj6mX0vruaJo2h3dOWYcxoCz4cY 0Yf7AlcjW8n6gtPNsXEs2bGu16SdPbAC31R8g1NEp3rspkA2M9dWLdOHUSDgH72VYPh1 jSHaJHhAkAOtuZj4NkmIdK6/Cg85k9EiQ467LMoJGQpndeUwv/tb840cqT5S3t8IjWYz 92sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YomYflWKRw4iQ8LQdhq1DN9Is+lUqSvrk1gawqd+moY=; b=D7IwojUeOIf6n0a8QF7pwV1HKh2hfdgtAgA+3cWfjXf0nJPTKxsnivmMglCG4Yfllb UNkLsQ9CgvTMJqLZUADZnZEcWAvdY5lt969Cm1zV0COG+XY/KHdZ74VmHQLhwYQEMGD/ dqceP8jxRhvGTYVOL7kP59trL707MW//XlrI6Lc+Iv2amAWfXs63VezgFpJuGb41cL6d u/TTFHaPY0oFkSybPx3nVtKC3Tb9HcLj6SwCEjhu+FuPKSN1TBt4J2TYjk4ETy/RFBom /fjk+QZyiCOcHc6vWYQD5rjUkiGZyQtgfKZN4tb7XoXjwx2jcwP+SStQn0vmxykq5qFB +z7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="glP/Hgn1"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lk14si8051746ejb.559.2021.08.06.01.22.04; Fri, 06 Aug 2021 01:22:04 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="glP/Hgn1"; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243412AbhHFIWR (ORCPT + 12 others); Fri, 6 Aug 2021 04:22:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:51602 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243869AbhHFIU7 (ORCPT ); Fri, 6 Aug 2021 04:20:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B19BA611CE; Fri, 6 Aug 2021 08:20:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628238044; bh=uPP6pGfPKxxOWBPIuYO99gShrMMU9C+Cbh2sqJmsmPg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=glP/Hgn1aajEczknuuWNVqQ0VfIEnQV6PqnRtF8q2cI7x8DTOus3ELi/HpVy1E5VI 3v30u2Fq5n/1mUOi0+vgJL3Vj6elzNeKS99yvsJDuYiyKAmMgEqT2QUCLco+pjCrZp 5MUbq+Y/g4T9WJFTlbXYv334Q1vUtzjCQjkmniT0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Walleij , Sebastian Reichel , Sasha Levin Subject: [PATCH 5.13 03/35] power: supply: ab8500: Call battery population once Date: Fri, 6 Aug 2021 10:16:46 +0200 Message-Id: <20210806081113.827211342@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210806081113.718626745@linuxfoundation.org> References: <20210806081113.718626745@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Linus Walleij [ Upstream commit 7e2bb83c617f8fccc04db7d03f105a06b9d491a9 ] The code was calling ab8500_bm_of_probe() in four different spots effectively overwriting the same configuration three times. This was done because probe order was uncertain. Since we now used componentized probe, call it only once while probing the main charging component. Signed-off-by: Linus Walleij Signed-off-by: Sebastian Reichel Signed-off-by: Sasha Levin --- drivers/power/supply/ab8500_btemp.c | 7 ------- drivers/power/supply/ab8500_fg.c | 6 ------ drivers/power/supply/abx500_chargalg.c | 7 ------- 3 files changed, 20 deletions(-) -- 2.30.2 diff --git a/drivers/power/supply/ab8500_btemp.c b/drivers/power/supply/ab8500_btemp.c index 4df305c767c5..dbdcff32f353 100644 --- a/drivers/power/supply/ab8500_btemp.c +++ b/drivers/power/supply/ab8500_btemp.c @@ -983,7 +983,6 @@ static const struct component_ops ab8500_btemp_component_ops = { static int ab8500_btemp_probe(struct platform_device *pdev) { - struct device_node *np = pdev->dev.of_node; struct power_supply_config psy_cfg = {}; struct device *dev = &pdev->dev; struct ab8500_btemp *di; @@ -996,12 +995,6 @@ static int ab8500_btemp_probe(struct platform_device *pdev) di->bm = &ab8500_bm_data; - ret = ab8500_bm_of_probe(dev, np, di->bm); - if (ret) { - dev_err(dev, "failed to get battery information\n"); - return ret; - } - /* get parent data */ di->dev = dev; di->parent = dev_get_drvdata(pdev->dev.parent); diff --git a/drivers/power/supply/ab8500_fg.c b/drivers/power/supply/ab8500_fg.c index 46c718e9ebb7..146a5f03818f 100644 --- a/drivers/power/supply/ab8500_fg.c +++ b/drivers/power/supply/ab8500_fg.c @@ -3058,12 +3058,6 @@ static int ab8500_fg_probe(struct platform_device *pdev) di->bm = &ab8500_bm_data; - ret = ab8500_bm_of_probe(dev, np, di->bm); - if (ret) { - dev_err(dev, "failed to get battery information\n"); - return ret; - } - mutex_init(&di->cc_lock); /* get parent data */ diff --git a/drivers/power/supply/abx500_chargalg.c b/drivers/power/supply/abx500_chargalg.c index 599684ce0e4b..a17849bfacbf 100644 --- a/drivers/power/supply/abx500_chargalg.c +++ b/drivers/power/supply/abx500_chargalg.c @@ -2002,7 +2002,6 @@ static const struct component_ops abx500_chargalg_component_ops = { static int abx500_chargalg_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct device_node *np = dev->of_node; struct power_supply_config psy_cfg = {}; struct abx500_chargalg *di; int ret = 0; @@ -2013,12 +2012,6 @@ static int abx500_chargalg_probe(struct platform_device *pdev) di->bm = &ab8500_bm_data; - ret = ab8500_bm_of_probe(dev, np, di->bm); - if (ret) { - dev_err(dev, "failed to get battery information\n"); - return ret; - } - /* get device struct and parent */ di->dev = dev; di->parent = dev_get_drvdata(pdev->dev.parent);