From patchwork Fri Apr 7 13:57:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shengyu Qu X-Patchwork-Id: 671760 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 6C12CC77B6F for ; Fri, 7 Apr 2023 13:58:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239568AbjDGN6k (ORCPT ); Fri, 7 Apr 2023 09:58:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239506AbjDGN62 (ORCPT ); Fri, 7 Apr 2023 09:58:28 -0400 Received: from JPN01-OS0-obe.outbound.protection.outlook.com (mail-os0jpn01olkn2037.outbound.protection.outlook.com [40.92.98.37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E8C8E60; Fri, 7 Apr 2023 06:58:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ms09a2RE6+ACR+d6cvcJqY95K+FR+uEwMv4khoRx5WJVevBvRBLyNboGB2vKSS8icjaaPg857eL//PeEq2sqDvucIrtOxwUbCcQDxU8gTKKSZ3Ggojti7a6eWaqw4+BO88+6kGXftCz6a+YQJ5VaYET0vZZExL5CtM8tBho98bhwVHBWLOtdI0DvlTyRniuSlZHtBHy0bQekGNoNVXGVlfNTCVgcx86w93gAd/K9gX9ZTCzPN+Ku0NWHcYKfWN6cNpMQ7Sh+K8zwYoKNJm5GC4XRlV93GEmFuoRqA3fkD2JSi2CKQmmDjQTPU8bBCpAr7f8MFXooV9yJwG5MW0w+5Q== 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=mFWCgLkVjwr9Ocsz1at5g0w7efdTls7pY53iLoG2219DyZLNUjOZx2oX/RNnpI4dapdwOHFw7EFm1CxBwlixKjvA45Ltv9DbKEUDmHuzzEGuvpJrUb4VWv1SBxCI7DEj7PWHXX3m4g9+ZMK5FmUKLP1ZB237H32mpIXoD+EG/x7bIBtEgAGCfB7/gbw6YDIst8sTY4tFQw1xY+APaIwPjw83j2Iygc/F9lW8Z6sF/XW8va9JoSbo9cDtlvn+KChnrbWY/NKqE9zHKd/5db3mIU1H5KfZoWHa8yMLabVXrSjcdpNbdtofDeHvK/QMhZlJDKcpzm4rsrcuLwcfh2GSQw== 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=Tb9CxNE/MHc+d9k9mzh7dgUlUAqW4b1DNdMwOYQR2UVkrFy6F+1/I8PBFyue1npJdP8RKwAgt2fWUusGz0mXKUEWJzCs7jZew5pdb03Mr27beuov54xqugj6QYyARVemquhM7BvUO0Smx+7jMWVXphf4txAnJHY4M+3dwgqN7oS4X8oYLdYKO7Nksi5gjJl6GlZ/v/L53wWuLZe98rPPSQ4Sxjeh/6cTMStcfH7VcISxL5W7Q4FKP7bLtvaWJwdq6i+Iqe/di7aKiL3JvRGgw9l7K2Zyccl65Omeds91RL6bz6Vmh4pj+F0b3a23SMrWbkL9pDzDQAvv89WJo2Nfrg== Received: from TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:252::12) by OSZP286MB2208.JPNP286.PROD.OUTLOOK.COM (2603:1096:604:18d::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.35; Fri, 7 Apr 2023 13:58:23 +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 13:58:23 +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 21:57:17 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230407135717.17381-1-wiagn233@outlook.com> References: <20230407135717.17381-1-wiagn233@outlook.com> X-TMN: [5ASSQoryS6FYig2XikeZf+LtwxXlTot1] X-ClientProxiedBy: SJ0PR05CA0050.namprd05.prod.outlook.com (2603:10b6:a03:33f::25) To TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:252::12) X-Microsoft-Original-Message-ID: <20230407135717.17381-5-wiagn233@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TY3P286MB2611:EE_|OSZP286MB2208:EE_ X-MS-Office365-Filtering-Correlation-Id: 7c052bec-f708-4899-5961-08db3770269f X-MS-Exchange-SLBlob-MailProps: AZnQBsB9Xmovywdyt6JbrF6Sw9xOtJaeu8ZRRwqj0GRz5gUysH2WYhzzjKQ5md5abvB2PUv/RO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1Uh4afxHnPXgefDfC7zpfctqQAhNtoW1FOCAaUtDECu9dTJx+r/08NP/STL3CKlOOKlLdcpRHU3UBoa5qrHkl0wh+KY9mJMIyCnmfMpAAt3XN/pPHWp2OZ90HmFpqm/8zH0a2ZfJTH5toehVx+fU6ha49lkt6r0ef/ixK5J7HEvL5T3At0vjZ8YaOpHM4XKdDsznT9hyZJy2k+XunPobIltBA7ufXnBv/urRJR5lrbfHaKfQcjwETI+Xe9O+VoG/cRpReCCSfQNNiLRHLkxMyEwcwYhjERgNYJmuOC1eEZ1PZ6eR+5btwOtODljmImBWiAD2ig7aQzizID73XO4k+XUNN5f4V0dHkHoEGNCCCOppq5Qj/2N/eVJB56x6knXuq3Oytkn+dPL+yBAzWlnCsi0X2GRfoAtdqby7PZoMTVziolMp0wezMK1S1bfx0950g+5r8xaB46TVv11gGd9e5Vz0hK+d4kr/tQ0vM26jUPHSaFcaDkmB4qpQfxpQVoW9Vzt0nRv2OFiIshCUH3GdRg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c052bec-f708-4899-5961-08db3770269f X-MS-Exchange-CrossTenant-AuthSource: TY3P286MB2611.JPNP286.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2023 13:58:23.0016 (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: OSZP286MB2208 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); }