Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp3477249lkm; Tue, 21 Sep 2021 17:06:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDC8fJDLpaUTD/MWcBDaMkRLvQIt8KRZmVJOTjxRDwvJ3rzHQNlcpCN0p+cYUQMbZ1RtDF X-Received: by 2002:a50:9d09:: with SMTP id v9mr28544259ede.370.1632269203771; Tue, 21 Sep 2021 17:06:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632269203; cv=none; d=google.com; s=arc-20160816; b=dELqDniq2MPYomLM/Fk4dIABRfM5sUunEJ/yNTl7ani8c4YXjhwJEYhCKkR4SPyPyt hlivq+G6iu0yLQA8LboT0Cdsa5D7O+WLwUjHqDZ6fE9vsy5EwrE4TKvXon4pZeiP0Gbv HasCVQwovM9a7okWWGenRXSJdYBm0SbWbbosQzVKWurPnowRNHTve/iMGypn2UZUKk+t sSNSuStEnaJTckg34Us09II2HWwACEUHZw20k/A4QOdDDr4gzKmvuXxZpN0rfwB1IvvS lCpur6rXGK9IOFuFkzVoRsRolOiFpcDhnLGfDbTjKjGoAdFtJbKVjaZ5fUlnacd6VKLk 0mXA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Dfl+3o580a+kMNSziAD63BdB1Q2KQn9mivPlLyQZDa4=; b=qbb93QsQSj3RuDyenrBkgsclg9qEV384rBTeghoao9nKdUZl1JNBpu0uKqimrSaIMt BhewP1muRoTnMeB3OSd+JV8IY8defxfSS2z5rFuLEyNzbSWRtWIJ+Xm2nAd0Qp6uOVIB zhajiu7VbSLtVPhHZPkwfwKLociTZXcMo5EgjmUEKVRNJbfjCP3Eobz2U39CgUpMdciN Dx+bGvjqhtaX6N/b8zHdYbyKrDHxJp2hP+AEAsI1jRdbg8CMzWzWEpDBuHB02aQZnfvU jQ6Dy2hAgtvo4zXFPENvY6nVF+lfUKWX6Ez52C86cyYg1TCqrQ+LCKU7hdnBCD9AhaHx iOng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DdbDl3Ym; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id my12si523241ejc.756.2021.09.21.17.06.16; Tue, 21 Sep 2021 17:06:43 -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=@gmail.com header.s=20210112 header.b=DdbDl3Ym; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235343AbhIUV3W (ORCPT + 99 others); Tue, 21 Sep 2021 17:29:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235342AbhIUV3S (ORCPT ); Tue, 21 Sep 2021 17:29:18 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 113EAC061574 for ; Tue, 21 Sep 2021 14:27:50 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id dw14so543021pjb.1 for ; Tue, 21 Sep 2021 14:27:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Dfl+3o580a+kMNSziAD63BdB1Q2KQn9mivPlLyQZDa4=; b=DdbDl3YmnHFbEkAEzDhzvQP+q6jTeUFwWcThXjc7O+ZM0UFjjsHsiI1S9SLX2uTJFm 97wnEuXjIC0VHQs3FKZAV1FkVtxNgLiWu91/8ZbzFvRcAtZnIuT6MR6qDBNQ9Wx1jCyt 0YQwCNhNaDynhsDv7VrE+H/90q0O+1/2mJyP9zh9tZ5XSYSQUrbbvEcAY3iafXyKXsw/ I6Z5QpoVYVRV2bcapqOobErfFi/ktYmfsgCXUoo3u2dgYeped6zJg1/+LfxrKjvsqXx8 CBIXoloCbgvEyDuvBnZQe2K6xg9Tu6TTxUoAsZUPbMAbaBKS0u7cTXcZ5PUyxsPKGNGt 9tOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Dfl+3o580a+kMNSziAD63BdB1Q2KQn9mivPlLyQZDa4=; b=RFLfggQeISG2m06zTkNDGrXYsBMtF2HYuRNqzbXXVfBy7/VKCfST0F9P0eAvGN1AeJ V47U+ae9flnUOreIzW9dC74yVyKuPoLEY9FY4xIDnv3uwdsfyAdKbQigMrpxnYTzSxV9 JOT+SgR2u4IQqBiKeGh4yOl378xFAppxoFyWtbw+b6ek5LGYhPTcJIyNU/XNVyQcPLSk Ha4BPOMAKOlXaKpJrUp6FrU/D6Fqy76CeImr9qMXhKsScd57K7hrluOqTDm1A/QBgYuE WEPYFeV5+xCDwo3zTLM41+pua7hVQbvUwEEfsnoVn/AzAqtE1i4DsNtZCz1BHXudwSrq Bfxg== X-Gm-Message-State: AOAM531/0iqIlENP2qYsuzpFcFhb0AIVkoqDeIb5lKFbasxib/urNuK1 KP9LIfPLnaPKZm3VmnCGCFk= X-Received: by 2002:a17:90b:8cb:: with SMTP id ds11mr7548115pjb.66.1632259669458; Tue, 21 Sep 2021 14:27:49 -0700 (PDT) Received: from archl-c2lm.. ([103.51.72.29]) by smtp.gmail.com with ESMTPSA id q21sm61399pjg.55.2021.09.21.14.27.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Sep 2021 14:27:48 -0700 (PDT) From: Anand Moon To: linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Anand Moon , Martin Blumenstingl , Liam Girdwood , Mark Brown Subject: [PATCHv3] regulator: pwm-regulator: Make use of the helper function dev_err_probe() Date: Tue, 21 Sep 2021 21:27:31 +0000 Message-Id: <20210921212732.1334-1-linux.amoon@gmail.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org devm_pwm_get() can return -EPROBE_DEFER if the pwm regulator is not ready yet. Use dev_err_probe() for pwm regulator resources to indicate the deferral reason when waiting for the resource to come up. Cc: Martin Blumenstingl Signed-off-by: Anand Moon --- V2 - Fix the return message and drop the FIX tag in commit. V1 - Fix the wrong probe defer for devm_regulator_register. - Fix the commit message. --- drivers/regulator/pwm-regulator.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c index 7629476d94ae..9e2784ce8f67 100644 --- a/drivers/regulator/pwm-regulator.c +++ b/drivers/regulator/pwm-regulator.c @@ -353,13 +353,8 @@ static int pwm_regulator_probe(struct platform_device *pdev) drvdata->pwm = devm_pwm_get(&pdev->dev, NULL); if (IS_ERR(drvdata->pwm)) { - ret = PTR_ERR(drvdata->pwm); - if (ret == -EPROBE_DEFER) - dev_dbg(&pdev->dev, - "Failed to get PWM, deferring probe\n"); - else - dev_err(&pdev->dev, "Failed to get PWM: %d\n", ret); - return ret; + return dev_err_probe(&pdev->dev, PTR_ERR(drvdata->pwm), + "Failed to get PWM\n"); } if (init_data->constraints.boot_on || init_data->constraints.always_on) -- 2.33.0