Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2480847rwd; Fri, 9 Jun 2023 11:52:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ77vWppGhlVLkaDYD5N/ffG1hYI4Zqp7hcxZbXeq1Wc7HzPNII13c76YFLSt4ULzH/vIEOm X-Received: by 2002:a05:6808:13cf:b0:39a:b9ae:47fd with SMTP id d15-20020a05680813cf00b0039ab9ae47fdmr2778701oiw.11.1686336762153; Fri, 09 Jun 2023 11:52:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686336762; cv=none; d=google.com; s=arc-20160816; b=ZBDzfFy43vmHS0GNzk65/WDhAezsoWcxRuIn/YGtkhPYq3KY9W88tNp++hzP5G7WPE dPZwC6+QGIvX9DbaJkjWTie3yf44DqG5vSOo6QG52wfHkFCKKoLMvvNU9DVDN7SXIJ6N tNlvswc2B7I2qjGSHZV80uF266z0/vr+9EMeeOavBjvhWfXvprMNZ/nkI256SpdufKAD tRs5463cqcovF27OmVjJX4dj79OzKjpzRN815j07HDDxmT2LaYgG3KeAGSfbmiK1mbMN RGeU1dop/Hmiax7JSuEoop3qx+6WRVHZG85ahHBdWw5dWrAvqOxUhSSwGetnpQ53xojm Z3IQ== 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=YlNAADpNJF/mKBUJMXBQL19JyS5QP2eSc/1ncOiaJgo=; b=YYSTjdUofrRHyVKjNZ+cf83V+VwEKhRA8nIdzZphV8zLjykZW1euqptRpB33fTkz86 NahRwYae1E2aRtuGqq+bNuBy04c1eMwalHlhs0qX3VALqgfKqbzFL7rcdEFsesnVz9Ib yhawXy2sfj0P8fLT9YJdNS4UvZuZT2ChB68SPYRsKYo87cAPxwEVAIsCBYIvkVEpi+8Z QfrkBJ5i6byAkX2ka75XYohn9gdFyZzBDWP3bODKRxdnVRXYrTyggGLaEBLp6v4indLD TVK+n5M6UacJCKaQA6d0C/Ue7JvHTji6ppQa9Wa8BfGMlYU5JZUxXEdkVn9JF9A/x6Qt RgeQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r23-20020a17090b051700b0025906ab207dsi3002770pjz.64.2023.06.09.11.52.29; Fri, 09 Jun 2023 11:52:42 -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 S230499AbjFISc1 (ORCPT + 99 others); Fri, 9 Jun 2023 14:32:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230400AbjFIScZ (ORCPT ); Fri, 9 Jun 2023 14:32:25 -0400 Received: from mail-il1-f171.google.com (mail-il1-f171.google.com [209.85.166.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5CBF3A81 for ; Fri, 9 Jun 2023 11:32:13 -0700 (PDT) Received: by mail-il1-f171.google.com with SMTP id e9e14a558f8ab-33b0cae115bso9025345ab.3 for ; Fri, 09 Jun 2023 11:32:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686335533; x=1688927533; 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=YlNAADpNJF/mKBUJMXBQL19JyS5QP2eSc/1ncOiaJgo=; b=V31akDlWsyjIT7xBpjF3AeacnnttBI1toyF5AH+hGg2zQc1FiWUUvETztskHLQYlVJ z+edPBSmzIGN5ntMoPRB15yKM8QPj95kbjddpOX+yBmuEV12Ap4QwBVV+7ZUk+1FTfx7 iVmKhhg/NMKUe+IPiWG/BODYKakCVvGo01S75whu/T9w0Bm/kmuN2jUfhFFnaiZt3wUg eRXrLsAXkysVuhk0jhbwIl71yRQojIQoj5PYsCR+2KjCfLqe6XpF0ftSTBvOk8oKToFj rgpsAU07bAYZZcVj2eKBuImCzwqkOoQ5/BPc8r416EHtFEOz/gFK0OwbdCDKFq/doGRi bWvQ== X-Gm-Message-State: AC+VfDw6MhwMF58OFd7dshiqkz7pkZL0ibJvznnQKgGzvsGDVCtCjx0a dQlE5oTl7Mivgz6qwlFKrLE0OwaSQA== X-Received: by 2002:a92:cc4a:0:b0:328:6412:df0e with SMTP id t10-20020a92cc4a000000b003286412df0emr2361677ilq.29.1686335533009; Fri, 09 Jun 2023 11:32:13 -0700 (PDT) Received: from robh_at_kernel.org ([64.188.179.250]) by smtp.gmail.com with ESMTPSA id n6-20020a02a906000000b0041407c67451sm1091090jam.165.2023.06.09.11.32.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 11:32:12 -0700 (PDT) Received: (nullmailer pid 1766640 invoked by uid 1000); Fri, 09 Jun 2023 18:32:10 -0000 From: Rob Herring To: Lee Jones Cc: linux-kernel@vger.kernel.org Subject: [PATCH] mfd: Use of_property_read_reg() to parse "reg" Date: Fri, 9 Jun 2023 12:31:59 -0600 Message-Id: <20230609183159.1766429-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: X-Mailing-List: linux-kernel@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/mfd/mfd-core.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c index 695d50b3bac6..0ed7c0d7784e 100644 --- a/drivers/mfd/mfd-core.c +++ b/drivers/mfd/mfd-core.c @@ -102,7 +102,6 @@ static int mfd_match_of_node_to_dev(struct platform_device *pdev, { #if IS_ENABLED(CONFIG_OF) struct mfd_of_node_entry *of_entry; - const __be32 *reg; u64 of_node_addr; /* Skip if OF node has previously been allocated to a device */ @@ -115,13 +114,10 @@ static int mfd_match_of_node_to_dev(struct platform_device *pdev, goto allocate_of_node; /* We only care about each node's first defined address */ - reg = of_get_address(np, 0, NULL, NULL); - if (!reg) + if (of_property_read_reg(np, 0, &of_node_addr, NULL)) /* OF node does not contatin a 'reg' property to match to */ return -EAGAIN; - of_node_addr = of_read_number(reg, of_n_addr_cells(np)); - if (cell->of_reg != of_node_addr) /* No match */ return -EAGAIN; -- 2.39.2