From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B6901CD54BF for ; Mon, 25 Sep 2023 19:03:55 +0000 (UTC) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=MquU9wD8; dkim-atps=neutral Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4RvXNB2pc9z3dJT for ; Tue, 26 Sep 2023 05:03:54 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=MquU9wD8; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2604:1380:4641:c500::1; helo=dfw.source.kernel.org; envelope-from=srs0=joog=fj=robh_at_kernel.org=rob@kernel.org; receiver=lists.ozlabs.org) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4RvXMC3pQVz3cBY for ; Tue, 26 Sep 2023 05:03:03 +1000 (AEST) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5D81961047; Mon, 25 Sep 2023 19:02:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50FA6C433C9; Mon, 25 Sep 2023 19:02:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695668579; bh=fXjtOigHLEJ1WJtElTztBusz+atOZCq2/IkS7MCl4mI=; h=From:To:Cc:Subject:Date:From; b=MquU9wD8hYsuyJWG2dXdLxBp2tuZNIl4+TT9klhR9RxTVPdroNxfrbZhxKeimjh4Y JfrN6BpcD6a0DJu8IW9uLq9NwYfBWzgMfBLgIyJcbP8hrirGR8PpT3IuWlzM9yKWjf 7AjkLV1PsBQAep7IecnHVy7fJJebuBwDTHWGFxUPQYfzizjByavVoA4V+bNujsVAza rzwf0ZJyGALJUb0SHKewArrjJJOopNKS51TmvMLrVkQz0FWGknyWN9SYJY3D0v3h0+ HEwZcBOe3A0Bm4BmV44LbmkXA2yecvLWHmR6iyqMajxbX8NxN3BAlg3iOmhJqXOSIy FCAD5Dx2HQCmA== Received: (nullmailer pid 1712705 invoked by uid 1000); Mon, 25 Sep 2023 19:02:57 -0000 From: Rob Herring To: "Rafael J. Wysocki" , Viresh Kumar , Michael Ellerman , Nicholas Piggin , Christophe Leroy Subject: [PATCH v2] cpufreq: pmac32: Use of_property_read_reg() to parse "reg" Date: Mon, 25 Sep 2023 14:02:35 -0500 Message-Id: <20230925190242.1712212-1-robh@kernel.org> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Use the recently added of_property_read_reg() helper to get the untranslated "reg" address value. Acked-by: Viresh Kumar Signed-off-by: Rob Herring --- v2: - Add missing include --- drivers/cpufreq/pmac32-cpufreq.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c index ec75e79659ac..df3567c1e93b 100644 --- a/drivers/cpufreq/pmac32-cpufreq.c +++ b/drivers/cpufreq/pmac32-cpufreq.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -378,10 +379,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 @@ -389,7 +389,6 @@ static u32 read_gpio(struct device_node *np) * relative to the base of KeyLargo or to the base of the * GPIO space, and the device-tree doesn't help. */ - offset = *reg; if (offset < KEYLARGO_GPIO_LEVELS0) offset += KEYLARGO_GPIO_LEVELS0; return offset; -- 2.40.1