From patchwork Thu Jul 1 22:05:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Robinson X-Patchwork-Id: 12355175 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8CBC7C11F67 for ; Thu, 1 Jul 2021 22:08:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4953A613C2 for ; Thu, 1 Jul 2021 22:08:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4953A613C2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=xfF7y9dECXtYKGCqNWQd+nkLtBcvFBo9JrApxZYT/b4=; b=AAidBTr7ozDghi FCatVIatw65DmFliYUwlpJfX8c8SP4e1akf1N7daxIlrjEeZnVF050Oha11/GMMJqGQ7hJrMuo51x cawHPmGeAhxeuoXRQDAFaDPO5wBQ4Pehk+GGmJqRWcsbl8cQGoBIeaZWQ9KVFki3m5WljbC5KGTGF LL1x34WQzMFKBVD+sXxptDHp2ouybNTnQScKH0o1VRL+3BYNWuZNxS81MfuCJoGl0jCbgy+p5OoP9 DptEuEw51/4+n6eqweVQgq2o+mGRN3ItFMFzScq950WnQXrVYMbgFY635HIwV++b9Jvx37u2EoLrn G4ENMTnH0fxbCS0Y635w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lz4oL-001J7m-T9; Thu, 01 Jul 2021 22:05:30 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lz4oI-001J6Q-21 for linux-arm-kernel@lists.infradead.org; Thu, 01 Jul 2021 22:05:27 +0000 Received: by mail-wm1-x32f.google.com with SMTP id j34so5436195wms.5 for ; Thu, 01 Jul 2021 15:05:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QhX2Mg0CbXtX1p2YJNW9DlH0vmyssHZThE9e24bn2XY=; b=qC4jcFuA4Bhi55ztsdNvJvQHF+BThtvQZ/ZfIcAISxB+zxH6gb9pQRY6uon4ryIRpS pu92MTMmaa31U9CFyNzqZcz6q+9DBf+geiGPEGqL4HbwSgf6xifeBVHsGXTtSBFB8O2I yuyQAePWOt1oLJRmauc9oX2dqCMjzReamrH3o2tkx3VLGqu2n4ReyZ6EWPKMypg3m+Ru p4u79reBkGJvaw6wQnmoKBFmj1IpbINUTFoPN4eHT1TCsnYrun334Ae2kfndgMVMWWwF O8F93iXzVATh5NjtkKHEr/yS4qqBxtOPnfFMBY661SzhEQ617JHqgixfmjzm6OoT5ckZ Ed6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=QhX2Mg0CbXtX1p2YJNW9DlH0vmyssHZThE9e24bn2XY=; b=ownBONrAgv8l45Wdy/hP0sGvDLqUSbVoN8HtXR/+eyf1uF42lZ4FRRppF2gT29Qo0V Jr17WyYeEfOYXind6tcPt9oHAgX15kG41aIRiNjZu9TbMVwO680SylsZJ/0nRYg9Oce3 u1/a+3eyz/Wjdxskd5wJQ0/D1B96RGm2bnEkRJGNkQk44ySVjiKbYm/oC6Gtc4wk3u9s KsKWTr4qxo944Z0o+B38oP1JApJi4Waigymo7l0v3A5U8TmuuCjBF7B0kF96MfXAND0X P7hdASexuXfH7sypdkiS0GS30eAg2wTvtH6JV1C0J/z0+cs0b3DA8rdz3Bf9aHe3s+A0 MdqQ== X-Gm-Message-State: AOAM532eHxcuaNYifrHnz6QOqsOaUsf5SRYG22Gb2N7iibr9FT+BWgk2 MvQ98fRObUn2hj30+FKjGxE= X-Google-Smtp-Source: ABdhPJyStxsCl8adctqFcFb3bxlmuTOcQx/p1gHVJNFsRNqOI/pNN5KdOnbTn+NEOw2dEmI8Dbonnw== X-Received: by 2002:a05:600c:4848:: with SMTP id j8mr1959669wmo.7.1625177122419; Thu, 01 Jul 2021 15:05:22 -0700 (PDT) Received: from morpheus.roving-it.com.com (f.c.9.1.f.e.c.d.1.e.0.0.2.b.5.5.1.8.6.2.1.1.b.f.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:fb11:2681:55b2:e1:dcef:19cf]) by smtp.googlemail.com with ESMTPSA id y20sm1097340wmi.25.2021.07.01.15.05.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jul 2021 15:05:21 -0700 (PDT) From: Peter Robinson To: Tobias Schrammm , Sebastian Reichel , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Peter Robinson Subject: [PATCH] power: supply: cw2015: use dev_err_probe to allow deferred probe Date: Thu, 1 Jul 2021 23:05:16 +0100 Message-Id: <20210701220516.2738398-1-pbrobinson@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210701_150526_144773_C338F46C X-CRM114-Status: GOOD ( 12.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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); }