Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2467886rwd; Fri, 9 Jun 2023 11:37:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5gUUZps87Jz2l9CWAnQSVDoIOwGxjvWeewLELtK9AQsdOm55tDHsrXi60Xi5CyJlDO62m7 X-Received: by 2002:a17:902:b945:b0:1af:d724:63ed with SMTP id h5-20020a170902b94500b001afd72463edmr2018358pls.42.1686335866273; Fri, 09 Jun 2023 11:37:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686335866; cv=none; d=google.com; s=arc-20160816; b=rTWY5P5QkcF3HgOG8W8H6U7ux5x99qEFR/ILkH7i4FzshJclE7Yp/c60e4GvKL1yXy +2biZi4gwzL9iJIg1EEJWR/LmU/1PkgzSM4zXkHEE6vvQLS37L2IMU3RkpphlgLCK5BW PRPglFlz+YhF+N/l2dcSBmsqX3Gb1vR8oNS6QFeIUDWok444VKTmdson65nYZcv6RQXz ZGnOMB3l13/TbmL2jfdA5HvZmig1CH1+2Sb3EGtd2EdsLdopR1nsOugeE/7yT9iQRgo/ 8f/q7vjYnauxZTzJevxP+xzoRg1UsRUgTlzAdb1AIRgxFI3/WkihEpTs68L/mA5dGpaD HvQw== 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=xJw31UEMSDw/4lxj847WRV5dzWgZULa7uFBez8wvxto=; b=o9SpRe1KFlEvCa20IEffv1gc8yKL8RUa4Cg3lK6KNXWmHWriV4e06yXQkHkuSfTqAp KdkaX9VivoguOlq49ofosURd0jqcUtzMjteTLT/qFi8J6JmOJ0GNTsOOh8tDDSoUjbkt TQityzQnDm6aSKfIbyzXxzK5ijK9PM4uojJLjUquxleLrA6t0HIMZdmWzMlxgEKpg8gP 0ZILXrsPUK53OpJbBV0X5MpsI7Ym8muATkz1OIazqAifd6dkZP0XbH03tKyKhEt2DhuP EPpVeYi/+ihFbceBsHOBJvHLh5GJ2l8eDPbRKiTPjtrs6bsSuInVBAK01dn8kY4KXEB1 y9Wg== 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 y15-20020a17090322cf00b001b055bd62f6si3148331plg.431.2023.06.09.11.37.34; Fri, 09 Jun 2023 11:37:46 -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 S230056AbjFISbB (ORCPT + 99 others); Fri, 9 Jun 2023 14:31:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230071AbjFISa7 (ORCPT ); Fri, 9 Jun 2023 14:30:59 -0400 Received: from mail-io1-f41.google.com (mail-io1-f41.google.com [209.85.166.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 281C93A8C; Fri, 9 Jun 2023 11:30:56 -0700 (PDT) Received: by mail-io1-f41.google.com with SMTP id ca18e2360f4ac-777b0dd72d8so86815239f.1; Fri, 09 Jun 2023 11:30:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686335455; x=1688927455; 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=xJw31UEMSDw/4lxj847WRV5dzWgZULa7uFBez8wvxto=; b=XRLgB/q8ZkYQ9wWg8nNexQhn0930cuuWzoHgMj6gIXnECxkymSoHsAhZaandmotfxy 4pxW1ZbLgY3/YX/M635ACp8cLFQh+XcthmqxgoX1vWAg5eVE3GmwxVkTfDQzke52HMPM 9XHMt/Unqy+5tZYO6UGBpSwq/wj8v3Ubj2JLh1T6RFBjEfWiIgIz8EU+gcyolQw2qEmo lcROd6Bxrcb3+z8kcNs1NVYathO5937sxNGlQZkBKWps1YbSobRib1YFbFSHblMiL4qo f53CqLbobe8CoSOwtGkEfhwGZBHB0i+fmArd8+8wPoT8fjX5fragSfQrOTd+mKww87Q5 ksaA== X-Gm-Message-State: AC+VfDybBu2V0k/IMDWqu386uZG3XrhSvWrIC94NLcGZMrA1oaly8Daj MZ5hLhwCkzNVoaoE19yYhRweKxP+Yg== X-Received: by 2002:a6b:dc14:0:b0:774:9c2e:4ef5 with SMTP id s20-20020a6bdc14000000b007749c2e4ef5mr2227096ioc.6.1686335455180; Fri, 09 Jun 2023 11:30:55 -0700 (PDT) Received: from robh_at_kernel.org ([64.188.179.250]) by smtp.gmail.com with ESMTPSA id f7-20020a056638118700b00420d2a27e27sm1097043jas.84.2023.06.09.11.30.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Jun 2023 11:30:54 -0700 (PDT) Received: (nullmailer pid 1765126 invoked by uid 1000); Fri, 09 Jun 2023 18:30:53 -0000 From: Rob Herring To: Chris Packham Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] i2c: mpc: Use of_property_read_reg() to parse "reg" Date: Fri, 9 Jun 2023 12:30:44 -0600 Message-Id: <20230609183044.1764951-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/i2c/busses/i2c-mpc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index cfd074ee6d54..595dce9218ad 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c @@ -316,9 +316,10 @@ static void mpc_i2c_setup_512x(struct device_node *node, if (node_ctrl) { ctrl = of_iomap(node_ctrl, 0); if (ctrl) { + u64 addr; /* Interrupt enable bits for i2c-0/1/2: bit 24/26/28 */ - pval = of_get_property(node, "reg", NULL); - idx = (*pval & 0xff) / 0x20; + of_property_read_reg(node, 0, &addr, NULL); + idx = (addr & 0xff) / 0x20; setbits32(ctrl, 1 << (24 + idx * 2)); iounmap(ctrl); } -- 2.39.2