From patchwork Fri Jun 9 18:31:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring (Arm)" X-Patchwork-Id: 13274282 X-Patchwork-Delegate: herbert@gondor.apana.org.au 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 ED28CC7EE29 for ; Fri, 9 Jun 2023 18:31:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230096AbjFISbP (ORCPT ); Fri, 9 Jun 2023 14:31:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230141AbjFISbN (ORCPT ); Fri, 9 Jun 2023 14:31:13 -0400 Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97FDA35BE; Fri, 9 Jun 2023 11:31:11 -0700 (PDT) Received: by mail-il1-f180.google.com with SMTP id e9e14a558f8ab-33e585a0ca6so8761865ab.3; Fri, 09 Jun 2023 11:31:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686335471; x=1688927471; 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=YDLRPgV5z509cyU5ssYH2N/H4F3/FnPUGl76en455c0=; b=EmbGOi/GbLCiGxvtFEK8zQGQ5eAvoIKgXr/+hwaYX1lwyM756lQwSFavMCCMml7VTZ vMYVSWDbSsPRuXB/Z1/tDaYJI1L1f2Ef0Tz34Du7z0ss0MLvbH5Ev6ruoUkveHWh/hUS HDqYgHA5w2gNX4P1uXIIvqbEi9wCh4Fqy6ZvUQwsNmCjbHSlkbFTMRmBEyUVlmVBz4Vu p0xqMOOxBY1CLkH9RmFMWNq/TMZPDj5WNz3ncyjxRxkTgrd++kk/yRUCul5kgDtPs340 S9Pz6jWRP7RjjRZbAiQKVlZ5cc9SB8ZtvHEOouKDGgIm/A9ehQo8EYcr49tHHoy9D+AQ Jtxg== X-Gm-Message-State: AC+VfDyUPzdb+Yetu43OFq93/bX7+djMEfIWizcox33QJeWrpG1cWhx9 f4JeDZHu5NrsueIJzq3uIia6wLfGbw== X-Google-Smtp-Source: ACHHUZ6gs4iUOyrEkbjPXB9yem88PDea/e9/9fQbcxT07lu5mhWFHuK2Ix5E1FnOI4GSSTpjw2qFtw== X-Received: by 2002:a92:c852:0:b0:33b:1da8:a7d0 with SMTP id b18-20020a92c852000000b0033b1da8a7d0mr2326661ilq.29.1686335470707; Fri, 09 Jun 2023 11:31:10 -0700 (PDT) Received: from robh_at_kernel.org ([64.188.179.250]) by smtp.gmail.com with ESMTPSA id k1-20020a92c9c1000000b0033c01c407fbsm1239903ilq.31.2023.06.09.11.31.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 11:31:09 -0700 (PDT) Received: (nullmailer pid 1765467 invoked by uid 1000); Fri, 09 Jun 2023 18:31:08 -0000 From: Rob Herring To: Herbert Xu , "David S. Miller" Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] crypto: n2: Use of_property_read_reg() to parse "reg" Date: Fri, 9 Jun 2023 12:31:05 -0600 Message-Id: <20230609183105.1765368-1-robh@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Use the recently added of_property_read_reg() helper to get the untranslated "reg" address value. Signed-off-by: Rob Herring --- drivers/crypto/n2_core.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/n2_core.c b/drivers/crypto/n2_core.c index 20d0dcd50344..4f6ca229ee5e 100644 --- a/drivers/crypto/n2_core.c +++ b/drivers/crypto/n2_core.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -1795,11 +1796,9 @@ static int grab_mdesc_irq_props(struct mdesc_handle *mdesc, struct spu_mdesc_info *ip, const char *node_name) { - const unsigned int *reg; - u64 node; + u64 node, reg; - reg = of_get_property(dev->dev.of_node, "reg", NULL); - if (!reg) + if (of_property_read_reg(dev->dev.of_node, 0, ®, NULL) < 0) return -ENODEV; mdesc_for_each_node_by_name(mdesc, node, "virtual-device") { @@ -1810,7 +1809,7 @@ static int grab_mdesc_irq_props(struct mdesc_handle *mdesc, if (!name || strcmp(name, node_name)) continue; chdl = mdesc_get_property(mdesc, node, "cfg-handle", NULL); - if (!chdl || (*chdl != *reg)) + if (!chdl || (*chdl != reg)) continue; ip->cfg_handle = *chdl; return get_irq_props(mdesc, node, ip);