Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp593760lqi; Thu, 7 Mar 2024 06:27:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWLXbUw7CY8bUZ4A0XfjLOL3l4Rr5FsCYgSTnrQfiq/5eRlkSaFp1AjT+H/+sFiXnUM8Ze+RYxFD3shRdsu2ZtqPYoEqyyNYBT93KD9og== X-Google-Smtp-Source: AGHT+IHIEOL8zsc/SKHYrKm/3ehZkIOVwxK6XhWk7zfnEpV00uooM4iGfxELpJS9nekGk4KKDW3b X-Received: by 2002:a05:6358:6f07:b0:178:6c79:6ccf with SMTP id r7-20020a0563586f0700b001786c796ccfmr8525180rwn.17.1709821645888; Thu, 07 Mar 2024 06:27:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709821645; cv=pass; d=google.com; s=arc-20160816; b=vzb1+bCRvH5tQo7vbc65+un3JohIkBE2jG3Os9Dw2HWPhbRHMkUdu5asbrM3AiDQSZ qCz1j3wFfcsQQc3jqB9PMEUabtDAGpGjX+FbBjIuUtDfjNeWTjw1FwsInn2IHB3+WjRj fER9TIWIymyNnLNotpN6/hz4vt4grTdUIMHwdRSDIby66OB1IkpJRVXNRn4PVTXis0VI 4WVNOQSEkiRfUWA4m8Lccc0XFRTR9YarOmGAmpUDcVsXjD8rfrvQ5oxi/vP+8yLHJj1f 82iF7z0kTOQpihwDrkhgMti4gwZ+/RhXEiyp8PMfsbynCmMedORsMz6/wTtS7/5qmuKG RINw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=RVEZ+dft9R/KhC9oPPIZ2jMLs62xUpkamwQZ5BNpAPE=; fh=SA3r96eYFFPiiXGFt05U+p2LnR5/MmbW8M45+w5XNn8=; b=HaK7w+VyWwbvde9UuXD5L7U4zo49t/PQxqX6FxJihiuOhovEgpMx21hVyvTCrIQwHR tcq7fDBDuHM9wP1W0AvjytqpRgGAixOGITTCFhfJav4vzc7Pg0XkZWbtgcq10VCbopjC 1Ln64Vpej4PoCu7UlhogS+i4I038LPmtyUqMGU3IgMr/ekIyGCiPSe1vW3o5ri1YnF07 6/yYm/TyvGgv67xURXPJRJXo+asjDEpXt1bUyAa4MmtM7VM25BIp6dNgcKmk99+CNFRu WDBGYT/PX6nUHtqD8vZDIbMLaF847rqWGvG/KfDtho0+StpSJrVq1mSJTxY8b+2Yv24a EpnQ==; 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=mUz6ukVh; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-95730-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95730-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id a8-20020a056214062800b0068cc3b0f1e4si16586811qvx.411.2024.03.07.06.27.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 06:27:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95730-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=mUz6ukVh; arc=pass (i=1 dkim=pass dkdomain=bgdev-pl.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-95730-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95730-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 8D5621C22151 for ; Thu, 7 Mar 2024 14:27:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8D15D12EBDD; Thu, 7 Mar 2024 14:26:27 +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="mUz6ukVh" Received: from mail-yb1-f177.google.com (mail-yb1-f177.google.com [209.85.219.177]) (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 2D12E12C80A for ; Thu, 7 Mar 2024 14:26:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709821586; cv=none; b=AUmx09/IvxzJvg3Wptx2B/LCN28ZNdJ2sA3FJ8SQp9KeoPPvGE5JZTfFs9HcrO/9b3ow4WRGfssAULV9fqQYjtMd9DPJ6oOJdSfki83e+beWmz3mynW/R2x7WQRz6cLLIVJqSLipTYoasG+L2zbh6in5MCAn5whZwDB038jZnL8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709821586; c=relaxed/simple; bh=RVEZ+dft9R/KhC9oPPIZ2jMLs62xUpkamwQZ5BNpAPE=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=DSfjlzYiE70QEpjGqvaTzNlo3a5p8yHBKRaet5tBURuSJ5fsY83LUKew9LFPD4tRU+u9QsvsSojD0GxWjuaC9VQY2Cu8Fo/bOYocRu/ojA1xmHPSqnm8pj/9yxRGhJY7ff+9eDtdqfKZspZjEWotatpc6BX5XgI60avP/mLhgTU= 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=mUz6ukVh; arc=none smtp.client-ip=209.85.219.177 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-yb1-f177.google.com with SMTP id 3f1490d57ef6-dcbf82cdf05so931776276.2 for ; Thu, 07 Mar 2024 06:26:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1709821584; x=1710426384; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=RVEZ+dft9R/KhC9oPPIZ2jMLs62xUpkamwQZ5BNpAPE=; b=mUz6ukVhcxePJds8RHQjtGXUbnLE2wHk+yeM3ONqQfUR7ZooBksU1RBlaCDgWXFNlZ UMIf7hjZfV7ePhZgUxpUD5iT2ILPur9FpYCo1JBEaWa4V38M3bSOFumECZPbkJ30Ktf6 PyP+Gs5JWC7DFyyBAmuU2ohkQhpJ08uAeILYvgt2omBFxxb60eePDcZ09/JAdKzHPeHx UeCwzF1kJ56jnFBFDGVEQoCPHj/p/nUCY0mhIoZRSA0N/cOHlmim8GYJrPhK49WFbURi DVRb6/F9mPG9pGK6GZUYuq4e294FLCfTrvhlx9UXMva6mfyZwXrsJvaUSbzW243GJ+gy Fx+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709821584; x=1710426384; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RVEZ+dft9R/KhC9oPPIZ2jMLs62xUpkamwQZ5BNpAPE=; b=hMcaI4pVHJHAfvxkkFPuzUpA2koWzBQtANO4YlfE7l1Giec+8EVHFKk4jY5X6lMYcX kQhrsovb+OyyxrUGgsY29EUXnXqJlq8yzKMwRVo3gEkJDQ4e+ayGP2crLuAtEvvEKbbC lBDUOuXsUVgp7bmxdBUYyQ+bE00DfKUQLaMHUPGWBX8xXHvNC+fafkTCz3yBP9YQ+TJI Nk+4LzCE/pvvwcwulL4SbNaCoQ2Q4quTIZhPbF/4jEEtNFNmQnvzkPD+1FN/UmOhnmKl IsOT/pJIKlH5mYBLAohgD2RT/qBJHKAwRNsB/ApXZ/YxpDSvQzfkYWJUNcWRP4Ume+Cv HP+g== X-Forwarded-Encrypted: i=1; AJvYcCWzBAgDSN8LHpthINVBQeRj39Dc/Tu7YUnMyXmi1UzGgkvBfo/oqIM53ndLioBkwwy5KzosogwGlziCQiLRAAzi9Uc/3o8l132c06AK X-Gm-Message-State: AOJu0YxZFf2uZkYfx/vCJwgdcbsyo3OVO8Nxc2DHI+Eb2zkLzMN2Iuy4 j2vuZJHCU4bOVN3CUnjAevXz56dLaKeXX6aGJipwxCgHoioE388NfwYG+KCEy0TVvLb4bWBtei3 NP9DjqaRHawKzzXOAduQNSW3YaLrQGH5JhQAuRA== X-Received: by 2002:a5b:146:0:b0:dcb:cdce:3902 with SMTP id c6-20020a5b0146000000b00dcbcdce3902mr15663626ybp.55.1709821584085; Thu, 07 Mar 2024 06:26:24 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240303104853.31511-1-brgl@bgdev.pl> In-Reply-To: From: Bartosz Golaszewski Date: Thu, 7 Mar 2024 15:26:12 +0100 Message-ID: Subject: Re: [PATCH] of: make for_each_property_of_node() available to to !OF To: Rob Herring Cc: Frank Rowand , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , Geert Uytterhoeven Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Mar 6, 2024 at 8:34=E2=80=AFPM Rob Herring wro= te: > > On Tue, Mar 5, 2024 at 12:46=E2=80=AFPM Bartosz Golaszewski wrote: > > > > On Tue, 5 Mar 2024 18:56:04 +0100, Rob Herring sai= d: > > > > > > Long term, I want to make struct device_node opaque. So if we really > > > want to fix this, I think we'd want to convert this to use an iterato= r > > > function. Though I guess any user would be mucking with struct > > > property too, so the whole loop would need to be reworked. So in > > > conclusion, don't use for_each_property_of_node(). :) Shrug. > > > > > > > I basically just need to get the list of all properties of a node. Even= just > > names. I'm working on a testing driver that needs to request all GPIOs = assigned > > to it over DT so it must find all `foo-gpios` properties. > > > > How about: > > > > int of_node_for_each_property(struct device_node *dn, int > > (*func)(struct property *, void *), void *data) > > > > as the iterator? > > Why would we make the caller provide the iterator? We just need a > function call like the other iterators rather than directly > dereferencing the pointers: of_next_property_iter(node, last_prop) > > > You didn't say if you want to make struct property opaque as > > well but even then it can be used with provided interfaces. > > Yes, I'd like to make struct property opaque as well. That's probably > the first step. > > Rob Or maybe we should implement it at the fwnode_operations level? Although not sure how to handle it as fwnode doesn't have a separate structure for properties. Bart