Message ID | 20230609183111.1765507-1-robh@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1108886vqr; Fri, 9 Jun 2023 11:38:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ778y/s/N/jtP+Oviz4/Afwb42eHo0Tjbmp6C90TCgaFmW9kgvEBF/As6AnoaymjMC55hcB X-Received: by 2002:a05:6a00:10cd:b0:64c:c841:4e8a with SMTP id d13-20020a056a0010cd00b0064cc8414e8amr2060819pfu.22.1686335885932; Fri, 09 Jun 2023 11:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686335885; cv=none; d=google.com; s=arc-20160816; b=pIZxcA6cAC56SFt8Vudc2Cxgcj8Mhrzko9R/ND6f1HHKLPTTsdrAkoh0QXD/U5uZeB mP1qS72NfXEKe0Zy1Jf3340v7X4v8mJr/krrdrYyOo0sNk/468u9tqvR1yCGHEXXoIdl LeYL+F64L851jqibc964YmGon0DeOqSWg0whpj4KqR01ifhuQdXG7Wxzonw07h4LIl7m g7ytg1nZ2Q2d3RQaYANUmAl54eIs+7DYX4f3jO04bcd76WzDsjQf8NvhDw8XFmrfm9qM D85yoktW9krMQoEruVh1oPqCJkA0iqQDOAdcMHQ/DC74/mEohinWHDwqZSa2DtGOcz9s 2UVQ== 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; bh=ZBgb9qh78ul22lTen3bNkTv5w8c6tZwoVzvuQBQLYYo=; b=leFBERzX3E+HHD0c2E7u5Y7H7yc75nVBETFKWij1baePW6nr4btPYnBSIyY7GM969q MmZh14AqOyI3mLQ0URV3lbgCsYI+StpbVAlbeZrUnLZ4eI84ISgWNg6OEhWq31sBk6zV 5G5hxLXSU0cBIZfs9jMBR+XKSGiRPfTBV6oBdZJFohXpW2Dw0Rul+m3VXQmC87JXFoN7 4fXTHJEmPlpzXhOnBYP8kgpN4heRexF3HMLYWN9SZaH7XA2X604o2B3rwxxrjNkM57x5 2oNlNzhbMlE7tCdmT6myJg3uUbHtaayBC927sPqhJx3rtDyahfcesJ42QKAMIq4/3rzV zdGg== 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y7-20020aa79ae7000000b0065fd429c444si2809213pfp.27.2023.06.09.11.37.29; Fri, 09 Jun 2023 11:38:05 -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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230219AbjFISba (ORCPT <rfc822;liningstudo@gmail.com> + 99 others); Fri, 9 Jun 2023 14:31:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230138AbjFISb1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 9 Jun 2023 14:31:27 -0400 Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B08035A3; Fri, 9 Jun 2023 11:31:26 -0700 (PDT) Received: by mail-il1-f170.google.com with SMTP id e9e14a558f8ab-33e5054ba6fso8890485ab.0; Fri, 09 Jun 2023 11:31:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686335485; x=1688927485; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZBgb9qh78ul22lTen3bNkTv5w8c6tZwoVzvuQBQLYYo=; b=EdMUrxbRRnNgFhtbppf0b9TC1fWwOXV7z4PI/81RO/NFRF22Pq7HXwmkFcO7thPBre rIcIWry1XUDvh6yffsMRx8UvMSp3xpI2u7J1JHcpRN7Ykt1NOqaPcmtgEi7VtCGsjfUx B+jJjTdoerMDExaZqAg3MaxoLj7slwdpU7/vAFmqzXDCKCHNXVbMxgU+vPqpdFWzj3a0 Fn4p5XdYudyn67VWd+PN/dfFuRNcxKk6XiNJ5JFJslLQ7X3ZvGMB5fqMcCebd8Vl5q5Y KdP4bCXV2gYUgykffZX5BE0iPhQ3qwO7GgAS8b8CUStTaA7YDalJJWCT+Bl5n7akg/wn 32fg== X-Gm-Message-State: AC+VfDzWiGxlWQzo6I1Mhd9HhFuY/WQ1Xj2KkTTvkntLaRWbBluoOXVw cXj1ZyWZzC3/hS+I4/muUQ== X-Received: by 2002:a92:cb49:0:b0:328:39a6:ed13 with SMTP id f9-20020a92cb49000000b0032839a6ed13mr2302251ilq.4.1686335485541; Fri, 09 Jun 2023 11:31:25 -0700 (PDT) Received: from robh_at_kernel.org ([64.188.179.250]) by smtp.gmail.com with ESMTPSA id h1-20020a0566380f8100b00411baa5ec5asm1073244jal.154.2023.06.09.11.31.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 11:31:24 -0700 (PDT) Received: (nullmailer pid 1765745 invoked by uid 1000); Fri, 09 Jun 2023 18:31:23 -0000 From: Rob Herring <robh@kernel.org> To: "Rafael J. Wysocki" <rafael@kernel.org>, Viresh Kumar <viresh.kumar@linaro.org>, Michael Ellerman <mpe@ellerman.id.au>, Nicholas Piggin <npiggin@gmail.com>, Christophe Leroy <christophe.leroy@csgroup.eu> Cc: linux-pm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] cpufreq: pmac32: Use of_property_read_reg() to parse "reg" Date: Fri, 9 Jun 2023 12:31:11 -0600 Message-Id: <20230609183111.1765507-1-robh@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768251338260636151?= X-GMAIL-MSGID: =?utf-8?q?1768251338260636151?= |
Series |
cpufreq: pmac32: Use of_property_read_reg() to parse "reg"
|
|
Commit Message
Rob Herring
June 9, 2023, 6:31 p.m. UTC
Use the recently added of_property_read_reg() helper to get the
untranslated "reg" address value.
Signed-off-by: Rob Herring <robh@kernel.org>
---
drivers/cpufreq/pmac32-cpufreq.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
Comments
On Fri, Jun 9, 2023 at 12:31 PM Rob Herring <robh@kernel.org> wrote: > > Use the recently added of_property_read_reg() helper to get the > untranslated "reg" address value. > > Signed-off-by: Rob Herring <robh@kernel.org> > --- > drivers/cpufreq/pmac32-cpufreq.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) Ping! > > diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c > index ec75e79659ac..f53635ba16c1 100644 > --- a/drivers/cpufreq/pmac32-cpufreq.c > +++ b/drivers/cpufreq/pmac32-cpufreq.c > @@ -378,10 +378,9 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy) > > static u32 read_gpio(struct device_node *np) > { > - const u32 *reg = of_get_property(np, "reg", NULL); > - u32 offset; > + u64 offset; > > - if (reg == NULL) > + if (of_property_read_reg(np, 0, &offset, NULL) < 0) > return 0; > /* That works for all keylargos but shall be fixed properly > * some day... The problem is that it seems we can't rely > -- > 2.39.2 >
On 09-06-23, 12:31, Rob Herring wrote: > Use the recently added of_property_read_reg() helper to get the > untranslated "reg" address value. > > Signed-off-by: Rob Herring <robh@kernel.org> > --- > drivers/cpufreq/pmac32-cpufreq.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c > index ec75e79659ac..f53635ba16c1 100644 > --- a/drivers/cpufreq/pmac32-cpufreq.c > +++ b/drivers/cpufreq/pmac32-cpufreq.c > @@ -378,10 +378,9 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy) > > static u32 read_gpio(struct device_node *np) > { > - const u32 *reg = of_get_property(np, "reg", NULL); > - u32 offset; > + u64 offset; > > - if (reg == NULL) > + if (of_property_read_reg(np, 0, &offset, NULL) < 0) > return 0; > /* That works for all keylargos but shall be fixed properly > * some day... The problem is that it seems we can't rely Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
On Sun, Jul 2, 2023 at 10:01 PM Viresh Kumar <viresh.kumar@linaro.org> wrote: > > On 09-06-23, 12:31, Rob Herring wrote: > > Use the recently added of_property_read_reg() helper to get the > > untranslated "reg" address value. > > > > Signed-off-by: Rob Herring <robh@kernel.org> > > --- > > drivers/cpufreq/pmac32-cpufreq.c | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c > > index ec75e79659ac..f53635ba16c1 100644 > > --- a/drivers/cpufreq/pmac32-cpufreq.c > > +++ b/drivers/cpufreq/pmac32-cpufreq.c > > @@ -378,10 +378,9 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy) > > > > static u32 read_gpio(struct device_node *np) > > { > > - const u32 *reg = of_get_property(np, "reg", NULL); > > - u32 offset; > > + u64 offset; > > > > - if (reg == NULL) > > + if (of_property_read_reg(np, 0, &offset, NULL) < 0) > > return 0; > > /* That works for all keylargos but shall be fixed properly > > * some day... The problem is that it seems we can't rely > > Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Is someone going to apply this? Rob
diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c index ec75e79659ac..f53635ba16c1 100644 --- a/drivers/cpufreq/pmac32-cpufreq.c +++ b/drivers/cpufreq/pmac32-cpufreq.c @@ -378,10 +378,9 @@ static int pmac_cpufreq_cpu_init(struct cpufreq_policy *policy) static u32 read_gpio(struct device_node *np) { - const u32 *reg = of_get_property(np, "reg", NULL); - u32 offset; + u64 offset; - if (reg == NULL) + if (of_property_read_reg(np, 0, &offset, NULL) < 0) return 0; /* That works for all keylargos but shall be fixed properly * some day... The problem is that it seems we can't rely