Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp4059004rwe; Mon, 17 Apr 2023 07:25:42 -0700 (PDT) X-Google-Smtp-Source: AKy350Y2xphrqQgtlvO2hJ+ZMs0umpgRzbQMkQsM0mF5yKI2UlX+mItGBO0hCDEGMSK9kz7ShBMH X-Received: by 2002:a05:6a20:8014:b0:de:13c4:5529 with SMTP id e20-20020a056a20801400b000de13c45529mr12702692pza.62.1681741542276; Mon, 17 Apr 2023 07:25:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681741542; cv=none; d=google.com; s=arc-20160816; b=IXN1v1vdIdQUCSsb0LwEORzdVAhaSAZOLardykoap4KmNM4WHNFUlImDD2wAtQMrDx 7jRQu0L0LghBSH7AI0BShKytoQ70eQtpmH33uu1OUdYB2AiTs/Oi2xrucxKSy+qyJL4v RbpRvJokNBgHDTcfNLHnPdCu9X2F4k0RhekUukQ3JLjEYcQkl0hrVp7YQEIXqCdSqi1B JG3qVYXxxB2pFJmIu2BWqKuyDXdgvSz/trGCBZ2nnXmqwMGUy64JzOvUuWbJA2Oa2+5/ Xcp4dAzP7/ls6PdUcVOPAkJIyXso0pQD+djTMRpJgoVOw9mIgVIBYuVPu4ziyXPrjIVm dVLA== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=1kYoQi/9IGz3MPrQLHGQNi/q+ERt3ebJw/LlaJHcO4A=; b=J9Ys/vzr/+cA6cZmhT7iZ7wZccUE7EFXlavQVNqGTp5+f5CBBI+2qzbCpO7z24lygk QoW4OdNW73i89oBrYakMbeIcBZYOff56JSWCPYtBfRICvmd9U64g+G9DFCvF3H0bD4z6 6h1m6M2H+/3ySsFr22Ir8V4kgUU5bW5lbOF7sygCvgnqaD5se7VPYfQ0nokXVm0M9FIq 0QIEUQzKsgFeW+Z5pGTjF40g1Vps3nCfV1iZVUfghFmRar0n2xilFQI8gLs7KPDZC1b6 wEJ7c0F5uednsr58/H25cCbbIp+sp3K+YnhYX7QBkpk45Pq3flpgS+vrunLzVhI9XJVC Jl0w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h4-20020a635744000000b0050bd9c7bc1bsi10328766pgm.30.2023.04.17.07.25.28; Mon, 17 Apr 2023 07:25:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230006AbjDQOUa (ORCPT + 99 others); Mon, 17 Apr 2023 10:20:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230184AbjDQOU2 (ORCPT ); Mon, 17 Apr 2023 10:20:28 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9AB32188; Mon, 17 Apr 2023 07:20:24 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1B0221063; Mon, 17 Apr 2023 07:21:08 -0700 (PDT) Received: from donnerap.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 30DC93F5A1; Mon, 17 Apr 2023 07:20:23 -0700 (PDT) Date: Mon, 17 Apr 2023 15:20:20 +0100 From: Andre Przywara To: Shengyu Qu Cc: lee@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, wens@csie.org, lgirdwood@gmail.com, broonie@kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Botka Subject: Re: [PATCH v1 4/4] regulator: axp20x: Set DCDC frequency only when property exists Message-ID: <20230417152020.419bfb9c@donnerap.cambridge.arm.com> In-Reply-To: References: <20230407141813.89-1-wiagn233@outlook.com> Organization: ARM X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; aarch64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 7 Apr 2023 22:18:13 +0800 Shengyu Qu wrote: > Current axp20x regulator driver would always set DCDC frequency even if > there is no x-powers,dcdc-freq in device tree data. Causing meaningless > warning info output on variants that do not support DCDC frequency > modification. So only try to set DCDC frequency when there is frequency > property. This patch should not be needed. You should disallow the x-powers,dcdc-freq property in the binding (see [1]), then handle that like the AXP313a driver does: by explicitly checking that the property does not exist, then returning, see [2]. In general you might want to rebase your series on top of the AXP313a v10 series, as this most likely goes in before. Cheers, Andre [1] https://lore.kernel.org/linux-sunxi/20230401001850.4988-2-andre.przywara@arm.com/ [2] https://lore.kernel.org/linux-sunxi/20230401001850.4988-4-andre.przywara@arm.com/ > Signed-off-by: Shengyu Qu > --- > drivers/regulator/axp20x-regulator.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c > index ece4af93df7b..12a12923bc7b 100644 > --- a/drivers/regulator/axp20x-regulator.c > +++ b/drivers/regulator/axp20x-regulator.c > @@ -1247,10 +1247,10 @@ static int axp20x_regulator_parse_dt(struct platform_device *pdev) > if (!regulators) { > dev_warn(&pdev->dev, "regulators node not found\n"); > } else { > - of_property_read_u32(regulators, "x-powers,dcdc-freq", &dcdcfreq); > - ret = axp20x_set_dcdc_freq(pdev, dcdcfreq); > - if (ret < 0) { > - dev_err(&pdev->dev, "Error setting dcdc frequency: %d\n", ret); > + if (of_property_read_u32(regulators, "x-powers,dcdc-freq", &dcdcfreq) != -EINVAL) { > + ret = axp20x_set_dcdc_freq(pdev, dcdcfreq); > + if (ret < 0) > + dev_err(&pdev->dev, "Error setting dcdc frequency: %d\n", ret); > } > of_node_put(regulators); > }