Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1273309lqg; Sun, 3 Mar 2024 02:49:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUjZHQOTler++HgT+Ih30/VqjirRnpUe9dxjcCKqA8uHJCF0nH2r8xMJSiFFJeEWYcpQbOHZdl/4dFwHnNTMD37Jz9jWPyInjCHh2G5VA== X-Google-Smtp-Source: AGHT+IGkrw0eVV81vg9LNZZK3yOSRuw9CtAxkjs4VTeGpmvLuzM4Hqg9GxvrR9jqPh2J46VQCylO X-Received: by 2002:a17:903:94d:b0:1dc:fc84:edaa with SMTP id ma13-20020a170903094d00b001dcfc84edaamr4962089plb.29.1709462948633; Sun, 03 Mar 2024 02:49:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709462948; cv=pass; d=google.com; s=arc-20160816; b=hpLXRzWUsLM4cNyj5TtXvv2+N5HfUz+3EJDV5wTwrIQNNeiYlJYAWOrs+Fj7MbU4PT R64pIvDUnPWNhdvgjB2smSOOvFwGPa0yg2xlbDr0XCdXML63H2Rrzxg3fvxgCam155I4 wnVnKamfskXlfJLdiuygxzmQtlohrM4ZBe8vKXrvS4nrawmfZo38tlAm89jPzb3/aoZ3 UutCofsf/grge2avtQncLVFoCcgXcASycmDeVqGAPoFcLOy3G3LUMtrwFVEQ6DCDYcPV j3OoW+romsQ/nWA5fU1I4Y2S2gmBVZ6LvNMMdLyQ5sjYUopzZbzKgvXZa4gpBP7IwtIo o4iA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=qntDsCq8rgJuk7hdQSQYmfEUmAPY9qw4QwTul/rj/lU=; fh=ZTHYiJJBzZU2U9LVwgcGtlkiKMfdJfhjjtZPkNnO53g=; b=0nWOVMieUNYxSrBIPtLwferzzyoMJtgzrlRC1WGP5JpTAttbAPi1JoCmgMGwzT3e5e RamduwFT2690YSlqcIZye3uWNEIxdE75eTODeFZ3eYJt3fWpZUn8heDejYe9JjeNQ5+O XIKPOGqoa89yV9ul5+gzc5/3NnSVympBCwUMLZfv5xWxMiswV0Si6LZLcjXR5/Z/z/yl 6HThz0skUvvSouPkCDq50dfesRvGFVlaqSxHQT/xbPPAB7sqw77IzdsbM7AA6W2i1bkZ VORyFfJcC4AuhzkUviW2NKpUixRGC+rS3hMGb5XFbc7eqZPlTNhvGC5JORJbeQaKWZXB 72dw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b="yyGQN/T3"; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-89708-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89708-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id b7-20020a170902650700b001dcc7dbfb4esi6371412plk.636.2024.03.03.02.49.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 02:49:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89708-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b="yyGQN/T3"; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-89708-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89708-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 53AD72835C1 for ; Sun, 3 Mar 2024 10:49:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 170A1BA4B; Sun, 3 Mar 2024 10:49:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="yyGQN/T3" Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 51419B64C for ; Sun, 3 Mar 2024 10:48:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709462942; cv=none; b=QfVMazjRYbA0G6OYGBWLSgR/4QETXhDdlk5IucEkrn2d5byirH4bk8+fUuvaCp2uqo6Qx7/7x+aYUXVTvG8/WkFumWVJSyz4uSNgllm2j5kY81cHvA5i+a0dsed7CShtAelt8xIDoJb0CclktWlswBE0R0PX7tp8DOhlFjn41qI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709462942; c=relaxed/simple; bh=wdMZvlY9a5pjvdej/k7MCIk+lVgoJHMV1KhOOpZkf8I=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=PC2/BUSjIeKn+muSlrZhcEsxgQo72CTiagNIJuQYWrZ78WQV4xH32p6umfDwQs5pZANlB+qQbl8Uu8tEt3YzbUfPm+P5gEhKiMnB+oPGKZbB7LHlSxCEYlB0iO13K6xu0OLVu+O7ukmTUcTcsfQjCm/3vN24id2WjO9WxKNmcSg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl; spf=none smtp.mailfrom=bgdev.pl; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b=yyGQN/T3; arc=none smtp.client-ip=209.85.218.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Received: by mail-ej1-f51.google.com with SMTP id a640c23a62f3a-a446b5a08f0so403098666b.1 for ; Sun, 03 Mar 2024 02:48:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1709462937; x=1710067737; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=qntDsCq8rgJuk7hdQSQYmfEUmAPY9qw4QwTul/rj/lU=; b=yyGQN/T3j++gHMHFi+q96mX9ZYpLRXZHUtxxVLrSfY4jPIzs4FBiHMO7v27ugR4dAM 1UjVs383IAWeFD7qt4qIdbI8XBzLrlTtvhYvS34X01jFQLeXA4UZOpaciWbQiKWPtKey aOBLp8NkSH6Noh/5qAywHzIh4gVpnluzTbVTIySJdTjoy0fxQDknTqKVYepxt8v/Vl8z R3lvZDhnBd1I+cDwEZiQvTS+DswITDf4n/1T7UvsbT0RuvD8IVO0onooq6XKdXkGQ431 YsZWai15/A4qYLmnfVfy4mLbL8JPh7MNgpG6QLBrSVnZ6Eo8xk/P57k8mXyLpLFYIn8N VRew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709462937; x=1710067737; 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=qntDsCq8rgJuk7hdQSQYmfEUmAPY9qw4QwTul/rj/lU=; b=dTYmLpB2/ffi884BMVnJSzIwKD9stJe3XZ4kRtMi6efzjJ3LkX5aUAYbVzLiJ2g8FP mnZtMccc1LQwBAFjvCy16ukpBhzHZPsDrEPeJc3bD7lw/GZ6UfUJ0bpwnLlAgfZL9mO8 tzHYjojBD0jInFU1EaKuxtR0qz361ej41J7hGTUxQ5qxF4dndpeCMP49wHkuKBz/+xee I+CySf5NuvrnVwaP+hvOtU2qMJGkyoJICWq2ATMCo9ymNl6q+qv2uyowHtWEhCyYl5jp n54bG3+YhyoCjdbmjZY07mV1INUgAW692mgbe9mErk3/qcFzeymC1Xe4RCDFSd0Ld6lT 02iw== X-Forwarded-Encrypted: i=1; AJvYcCVQY056skEZItmD7PKa2EUVx0wTvfjTgM7tkoTogkIT3RzObpm70R6jf/vI84oE1Acrif4WVO/WGzUHwQ7OI+2Oyt3n/zNnlI2QdU6m X-Gm-Message-State: AOJu0YxfhuC9ZNtSBOfMtWoLshVHATFrTd3qsiMFi3bewYMOXvA7LMpM Kg+Yan4s5CIVC3HMfPtysnnb8aTvzYyoriO++HJOWO6ooBcmNtdHYlrgZR/veLs= X-Received: by 2002:a17:906:6c97:b0:a45:2cf3:6c65 with SMTP id s23-20020a1709066c9700b00a452cf36c65mr445528ejr.25.1709462937430; Sun, 03 Mar 2024 02:48:57 -0800 (PST) Received: from brgl-uxlite.. (5-226-109-134.static.ip.netia.com.pl. [5.226.109.134]) by smtp.gmail.com with ESMTPSA id he44-20020a1709073dac00b00a4323d1b18fsm3582303ejc.34.2024.03.03.02.48.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 02:48:57 -0800 (PST) From: Bartosz Golaszewski To: Rob Herring , Frank Rowand Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH] of: make for_each_property_of_node() available to to !OF Date: Sun, 3 Mar 2024 11:48:53 +0100 Message-Id: <20240303104853.31511-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.40.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Bartosz Golaszewski for_each_property_of_node() is a macro and so doesn't have a stub inline function for !OF. Move it out of the relevant #ifdef to make it available to all users. Fixes: 611cad720148 ("dt: add of_alias_scan and of_alias_get_id") Signed-off-by: Bartosz Golaszewski --- I have an upcoming driver that will use this but which can also be built on non-DT systems. I'd like to get that in as a fix to avoid inter-tree dependencies later. include/linux/of.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/of.h b/include/linux/of.h index 6a9ddf20e79a..a3e8e429ad7f 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -362,9 +362,6 @@ extern struct device_node *of_get_cpu_state_node(struct device_node *cpu_node, int index); extern u64 of_get_cpu_hwid(struct device_node *cpun, unsigned int thread); -#define for_each_property_of_node(dn, pp) \ - for (pp = dn->properties; pp != NULL; pp = pp->next) - extern int of_n_addr_cells(struct device_node *np); extern int of_n_size_cells(struct device_node *np); extern const struct of_device_id *of_match_node( @@ -892,6 +889,9 @@ static inline int of_prop_val_eq(struct property *p1, struct property *p2) !memcmp(p1->value, p2->value, (size_t)p1->length); } +#define for_each_property_of_node(dn, pp) \ + for (pp = dn->properties; pp != NULL; pp = pp->next) + #if defined(CONFIG_OF) && defined(CONFIG_NUMA) extern int of_node_to_nid(struct device_node *np); #else -- 2.40.1