Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2383700pxb; Mon, 20 Sep 2021 20:55:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmiPkZqkXJwWIodzcQp+RQcuqrCyh8BqCYkyRexHSwVduJVkiX/MDBYfWk/RrhtRb2LDnR X-Received: by 2002:aa7:df0a:: with SMTP id c10mr33383757edy.367.1632196551524; Mon, 20 Sep 2021 20:55:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632196551; cv=none; d=google.com; s=arc-20160816; b=bncMGPi99LzDAWBRFGrmCKeg2ZR0qEPljeYWiPGgwYEHBFBS7P0CwD5i7r92/shSf5 une55sQR84PPlFaNOgbOKxe1vTRrc9+a0v1uibFP3uCA9Wt6len5eo3F2HT5w0SpgdDl WcdmpPmCAdcuJGhbS/HIzxDdF2bvABL6Y9XpBtdveNBlsV3SGyczcJeFUkkg7SPRNbm+ D8qzCGSfUvecv6ohBSiedin2SOZSrC8ApKWveybKi11GJ7elLrDOvEAJ1cECypMHlHEb pol0TJpZTyDryHuy7nUA0t1XjyK7sUrOft3mq75TRnrxsUuMQDXRDkiejKYkWM4dNJCC 4vYg== 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=psFhvnbomh4BZTHkKL4KzrE+hE5GmzxDRBn3ytu83Jc=; b=gRbVlMFyOkW2RTg05NCqPqV4aycMcuoIR0jDcL+9nL2f82+6Orc2rXI79L02FkRJqT b6SL03WRz5X3+8PECtNZ/lK8bPl303UtKDFSGmv83n3mKTv7xrg7GUprGED4s1UqSjEM pWD69hYpxYsJ2Brh9UBCRhTZrj7jSh25zwCskDZgQ/jc+/W5nZIbpfhaFRCceBQ0i1WZ VEtERa/gfTAAQxt/cuup1pFjR/U03i+MA/uRHYYeNyth3E4HH3fhBPhOnHggK3xz5TJz he2W9fslIIUMGvZvWERgw3D18tw4f3jgbVfhMakAscLcoembeHLHS2pYyU2lcZw7LFby Uo+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="Jh5/S6Nl"; 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 n26si12086928edb.279.2021.09.20.20.55.27; Mon, 20 Sep 2021 20:55:51 -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="Jh5/S6Nl"; 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 S234302AbhIUBoZ (ORCPT + 99 others); Mon, 20 Sep 2021 21:44:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232829AbhIUBk1 (ORCPT ); Mon, 20 Sep 2021 21:40:27 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D492AC06B8E0 for ; Mon, 20 Sep 2021 13:38:10 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id 17so18582511pgp.4 for ; Mon, 20 Sep 2021 13:38:10 -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=psFhvnbomh4BZTHkKL4KzrE+hE5GmzxDRBn3ytu83Jc=; b=Jh5/S6Nlh5+moSDgJ1X+Hpv/uzVrmbgY4JdP4Iotvd1D5DO4axLaOg+hR6OHl5bh6l tRI515gAI99q7d3KNnQx/OBcGArC5zQtHf2BOHg1XUBjcjWkWa6HlZ7Yf9ZIrQxmDxoC H3XjmgptwGTgoUl8LfIHhUQZsX0NUTqMcbrocgs0RMX9HSwuNaS9W51GRVfsmPiPHw/K LMkNOWKEMRbgxX4hLzDlY1XPfwdLLdUKKVgXpkSLWFGPsrAvTKu8SPw9hYlF5M8cpQ4o ynQb30DS3W/2qDi9r37/VFXdjfEyFTwHgknpuUQ95PVfZ4807AHQ4dN4/oh0roAkczu2 X2tw== 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=psFhvnbomh4BZTHkKL4KzrE+hE5GmzxDRBn3ytu83Jc=; b=0UlxtGhNUWZnFQx3Yu7x8snhpPv/L9HzCWBmgmVIAIrzSZMxuNHK348ZN4XSh8+q8J S7omQOCVk9f25NgVVbp6x08tXJvdhuFiXEbBNS2MY/CIM2awUHXo9v/+cByZtjVeLJ4e ZVj5muRZ/qxIjI8PVFpv2sOr3ELDTI8NHrRBZpV+ggLXsDygU6+QB0XGm8PCXAi1Acq1 YIyAwmTsF7Xz3HRV+iCWGowtny8blUI+VSoW7S68ULBX6ckqKlNxaXSvQ8rg/klX1xMv jEgrMcU+jAM6nkbX6p+dJl4kqbGlIJkAp6bXaCUqXoB11GpjratmaBPLoYLnHAa0/XC7 jZ9g== X-Gm-Message-State: AOAM533x+u6g0HiOGp63cXysMojvZG0L3lbdt8RGiIy4HeBNVsGkOnWk Mhwd7RiB5siPIf7TFgZUd4NSFymR5V4qVQ== X-Received: by 2002:a63:7554:: with SMTP id f20mr24835256pgn.161.1632170290437; Mon, 20 Sep 2021 13:38:10 -0700 (PDT) Received: from archl-c2lm.. ([103.51.72.29]) by smtp.gmail.com with ESMTPSA id 18sm12904814pfh.115.2021.09.20.13.38.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Sep 2021 13:38:09 -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 , Jon Hunter Subject: [PATCHv2] regulator: pwm-regulator: Make use of the helper function dev_err_probe() Date: Mon, 20 Sep 2021 20:37:33 +0000 Message-Id: <20210920203735.675-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. Fixes: 0cd71b9a43ad ("regulator: pwm: Don't warn on probe deferral") Cc: Martin Blumenstingl Signed-off-by: Anand Moon --- V1 - Fix the wrong probe defer for devm_regulator_register. - Fix the commit message. --- drivers/regulator/pwm-regulator.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/regulator/pwm-regulator.c b/drivers/regulator/pwm-regulator.c index 7629476d94ae..3bd020641b67 100644 --- a/drivers/regulator/pwm-regulator.c +++ b/drivers/regulator/pwm-regulator.c @@ -353,13 +353,9 @@ 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 register regulator %s\n", + drvdata->desc.name); } if (init_data->constraints.boot_on || init_data->constraints.always_on) -- 2.33.0