From patchwork Fri Apr 7 14:18:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Shengyu X-Patchwork-Id: 671755 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3645C6FD1D for ; Fri, 7 Apr 2023 14:20:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232001AbjDGOT7 (ORCPT ); Fri, 7 Apr 2023 10:19:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240640AbjDGOTX (ORCPT ); Fri, 7 Apr 2023 10:19:23 -0400 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01olkn2055.outbound.protection.outlook.com [40.92.98.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E7DB8684; Fri, 7 Apr 2023 07:19:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GrhiyU+0RWWTVZlsAy9srKTqLdNvlmh6mc103qDsowt9MySIsabn70Uk5Ku1AD2NiQMIk3QTNnG5k3Jz1oobqrvhsK5UwcdDqWO+bbzwJvE7k0K+3OEEftohY9Hfmn5A/QszQojrDaK/cnhH69mZ67XT/xxN+xA3sSi0oqo5dBsREDxEaTCSRoxVk0gLH+oRJmwG7ZHjfTEA5/ezOfOX7NagAs37EzCa19LJoOf3VUR3UxGaxGM6VN2UCnT2/YKv2eSNyCXDQ1NAQ8Nf0QhOulVFrVBQGvpobBqc/iF/3F1x2CLcAgKaK0ZLCXFQw1kV6Hr5Lm1RqUNPswECzgfbpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=oY4jFFNw0M7yIh4a0N5pllOYfkbx7ClJRAnYHXblrLw=; b=aBJCyY1/xwzIe++sfnCzZabGhebdCw6bxG+Tip3DtU7WrPMkFF72MctKPa6z0XPDFYBaYCEBcGtJN3yHM04JbCU+kR+61QVAW45FAJovbWiYlJa6y8++B/WXdcvjZ7q+dyRuypEwBsObOnPpfTIa29gDlyBkct/WvjjS/UyelJgGTc0gphJhuEicvWhUQMfEHCw3jC2NVxrBBYh5yVqaXVLOaHfigJyjd+Y6hZpwcC+bR05n4hjIYyuUwTLP0Cacu7la8ZJ5B2ZAD0HHWjlC2R9rYAkIBMI5rFW+Jne8sU855lobJYI22ba64WH9B/5spitd/+63FlXPe8Yliz8M4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oY4jFFNw0M7yIh4a0N5pllOYfkbx7ClJRAnYHXblrLw=; b=swnVA5n6UkaxUrhrqcxqfcnrAnWscKclOkVxaE23NARq/BMu/wdtScMklsHQ4YwN8q4jZcwUIEg4/boC3NNH5smU4dukq7PYgMf6xAJWZz2n+/EJGCiSGj5Sxfgb06mNTkfRdYKryC4ukE7UJP9NwVZk7DoAM2kqw7wWn7WW0nmHLjUHgWdS9TDJDL9sZ8gmmk5rJ+dKuf7Z4n92DDBeE+VHfIOkMIlPwbql91qapS+d5EUW4McHO7Ra0C+c73hmA+v3o0zxGKUmPdYgIvETdSxqCibapmVhhC/4vn7L6iY+hBpiQN9ZCCCk8oLgW2dU53UFm11X6+PgDJ0ux1+TaQ== Received: from TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:252::12) by TYCP286MB2638.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:242::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.33; Fri, 7 Apr 2023 14:19:05 +0000 Received: from TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM ([fe80::d190:6e4d:5a1e:59a]) by TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM ([fe80::d190:6e4d:5a1e:59a%3]) with mapi id 15.20.6277.033; Fri, 7 Apr 2023 14:19:05 +0000 From: Shengyu Qu To: 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 Cc: Shengyu Qu Subject: [PATCH v1 4/4] regulator: axp20x: Set DCDC frequency only when property exists Date: Fri, 7 Apr 2023 22:18:13 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230407141813.89-1-wiagn233@outlook.com> References: <20230407141813.89-1-wiagn233@outlook.com> X-TMN: [c6G5peonix4uxtw3DsCWGfD+BkRlDAUP] X-ClientProxiedBy: SJ0PR13CA0083.namprd13.prod.outlook.com (2603:10b6:a03:2c4::28) To TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:252::12) X-Microsoft-Original-Message-ID: <20230407141813.89-5-wiagn233@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY3P286MB2611:EE_|TYCP286MB2638:EE_ X-MS-Office365-Filtering-Correlation-Id: 13ed14ab-e316-486b-cb6b-08db37730b15 X-MS-Exchange-SLBlob-MailProps: AZnQBsB9Xmovywdyt6JbrF6Sw9xOtJaeu8ZRRwqj0GQ5dXBxGN9mcLrponhjHeYr+TYtZ2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VFl+ayvayh0zghRKS6z27TklEzGYXCz0dJgi70u7zm0BAdvPR6fZx1SYFdsC9wnmn66Zi4ygi2DuREcR7mka3gNVRhnvfO8bBLLrDAdI4nxkEpYekcxxdzHvUrH+1f2mQohFqmzO6HCQmCocYEKjUvRfFkfh0rdx3rMtvCEOR2bqn4dhJA0aSGXmpLWltJSO4WQne71oQX+PXS0dS4Hp3TW03k99g5xBS2EEo5p6poiQ2lJIBkD3GSGnyUQual7yVtcVKUXF1PjCY9l6gQpNUkrpEfE2vgJpdCPG4p5MiYeEJVDHq2sskk0cLMulcZxWzmTwPFd9T/PcAkg/lQ4IsUyeO3DC8V698HDVBi2US/3nUWCEyo9MJDh9hIUXoR4bMWDNIu1cLZbdnZgrqnqYsJU5abBvD/sxb+0Pq0FDZr3z4JJeyeE7aKW4vPNcrYwuYE4SdDGf5dh9GKZqUfjvU3C2T7pvHXy/61IqJSRSfU0zqohxInsKx42Uj4BG4WxvFv4eUO/GKw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13ed14ab-e316-486b-cb6b-08db37730b15 X-MS-Exchange-CrossTenant-AuthSource: TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2023 14:19:05.2847 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYCP286MB2638 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org 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. 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); }