Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp95159pxb; Mon, 13 Sep 2021 13:57:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhBD0VnCxucVG49OQK8DGwkGmZ4G8ELjJyWVKz/uacOkhgmX6DBkgaMwNgfJLGc6PqvMhg X-Received: by 2002:a17:906:d52:: with SMTP id r18mr14619414ejh.47.1631566652868; Mon, 13 Sep 2021 13:57:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631566652; cv=none; d=google.com; s=arc-20160816; b=xnelkJkcoD4KXaoXK3Ovl2XqNyaN8d/k9gwjRhbN+6B4B91XclKvCm4IT/vYe2JNcg VALfiVzMYJPMC2NTfupfOb6ojoCFi6ZST8PLkEhudls/mZBtZexbrF95fHYCkhhFBKxM Nc4arb5ZjYzUG7YA+l5C82vKUUkG4Y80DN1lT5VakAZihFluQnLQaOSDAfMxEl83BjFv rhWus+1RfObhdyzaOmQVETbJ0u33qEep4qN2eYzCIo+wz48Next3ALeoHQ0UGcDGStwg 255FxnlundWMiuGshLSr9eFdB+fHsF6BLs7MAkAqfqJQAWQ9Fwi3JKZT9Rcgt7VkjAY8 4aZg== 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=Pm/drhPy/dx2xlKiuTAC53iLrEKowbssC8CUbyBA1+E=; b=TpAgS9rwKt4cEfxlIQWGxVNIWqSSS/ktsDHkbPxAtx1Hl7TutnMm7QDCDoLFabaQ99 5m9sjmtcUloq1PMlf9fqAyPfWeu6VyO0SPaHcYDprdGn9Uedi91mjTctq3YjZol5NC4Y M6og6qs+WULy7/5o6/U082RPQkMQEbrtJWNYQTF63e3rYUxeB97ljOyxmQLVvfIbazi+ crsTUIDgwGiImd3yuY0KsPWfr4WmpNnFfHuexerBDx4l5lj6s3pKbUFj743gFN4dRG5v 1T7/S3geOdjIFAFWXTLfFWkAFGkEeAI2YviO1o1q45Lrhpus0JEUMXorhZZhZY+7zx+X Ws6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Rz4/aALa"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 e26si10555894edr.360.2021.09.13.13.57.08; Mon, 13 Sep 2021 13:57:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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="Rz4/aALa"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S244928AbhIMN4d (ORCPT + 99 others); Mon, 13 Sep 2021 09:56:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:40464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244226AbhIMNxj (ORCPT ); Mon, 13 Sep 2021 09:53:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C6F31619E0; Mon, 13 Sep 2021 13:34:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631540094; bh=kcinne14G5IndLRIRNUaom7LEpancf9khhgZghhw1YY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rz4/aALaQRdppdNB07n5UZHtjRdlgftgbHWZqfRvQEFQ45CP4CvlE4NnZWz2IN/nl VHQ+1xpgHJ2k0O2Yw/rSgtJlyER9m9+gO85F5Orl6Oax9MbOx9MdwJbyjCsSGM2j8N Yb9grrugtH5QFYKOyC17O/fsM20cyf4b/QTsD0oc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Robinson , Javier Martinez Canillas , Sebastian Reichel , Sasha Levin Subject: [PATCH 5.13 048/300] power: supply: cw2015: use dev_err_probe to allow deferred probe Date: Mon, 13 Sep 2021 15:11:49 +0200 Message-Id: <20210913131110.963350093@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131109.253835823@linuxfoundation.org> References: <20210913131109.253835823@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Robinson [ Upstream commit ad1abe476995d97bfe7546ea91bb4f3dcdfbf3ab ] Deal with deferred probe using dev_err_probe so the error is handled and avoid logging lots probe defer information like the following: [ 9.125121] cw2015 4-0062: Failed to register power supply [ 9.211131] cw2015 4-0062: Failed to register power supply Fixes: b4c7715c10c1 ("power: supply: add CellWise cw2015 fuel gauge driver") Signed-off-by: Peter Robinson Reviewed-by: Javier Martinez Canillas Signed-off-by: Sebastian Reichel Signed-off-by: Sasha Levin --- drivers/power/supply/cw2015_battery.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/power/supply/cw2015_battery.c b/drivers/power/supply/cw2015_battery.c index d110597746b0..091868e9e9e8 100644 --- a/drivers/power/supply/cw2015_battery.c +++ b/drivers/power/supply/cw2015_battery.c @@ -679,7 +679,9 @@ static int cw_bat_probe(struct i2c_client *client) &cw2015_bat_desc, &psy_cfg); if (IS_ERR(cw_bat->rk_bat)) { - dev_err(cw_bat->dev, "Failed to register power supply\n"); + /* try again if this happens */ + dev_err_probe(&client->dev, PTR_ERR(cw_bat->rk_bat), + "Failed to register power supply\n"); return PTR_ERR(cw_bat->rk_bat); } -- 2.30.2