From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 559ECC52D7B for ; Thu, 8 Aug 2024 15:13:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To: Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=6KtF+zsK4gh5wBrd2V369YVuRxfiS/GTtNKOYSm0scE=; b=Aug4Lh71xe6Ust xuuz8/pT4J0Ju+ecQgQKqn9KlhxFtkBUNCLekYFGdonUNegnBHWe/zTHiR/4s9Iu8vbxO0wUg0k33 WSbZ9gYBgWHwbF7HHFLK1JVP6hcGiYuNIdgtzWvFcNuONzc4QaWoZ14D1R5N5SpS0U36/y/gnPQiy 4YdD/wtSfxzFnn4G/MVWNDxSga8GqnZ2RiPdJ13PIUC68a3NgUXMr9yYnhoXBNE9GNZYqfPtNTurt owLiW/Yo2RGPsFVlQkRF5P7DO21g8+msnNVZjIt88qPs4vbcLFCmfjnakL3W4/H3wqeLwnzNzsKdZ eBIEMYBjeVGfTzSevwig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc4pS-00000008g0D-0yyI; Thu, 08 Aug 2024 15:13:26 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc4os-00000008fr3-2Ndx for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2024 15:12:51 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4257d5fc9b7so10905215e9.2 for ; Thu, 08 Aug 2024 08:12:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723129968; x=1723734768; darn=lists.infradead.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=6KtF+zsK4gh5wBrd2V369YVuRxfiS/GTtNKOYSm0scE=; b=kx9XuOa9Edx3PaO1tUKZV3k2ksNpzhiNaWB1zYxJqv5CxvsUzySUqtDsC94IWDPFNE 6W89ZOL08PG1uzKBAfkAFM3DJcnAQlp4XUyEyTIInSN0BJMwWqR0futkssBvK9spIh+O 5o7BNcR2wRz+59Xu7ZHR52YAs1rGrxDH/jIzuYZ0vQc4xIBIcSoC6bwwlaUaFsz3ulVw SzYwGHOSptbrtY6WR1iRZfJhE7UmQeFslLi3P+oghYi1Fmx/rbwSadvhGjDu0PjDQWze w4sn0ohD6sFAKrQqPPLuSolxAhNpGE/shMM/qX9MNYQFp/cRKFCcbqBEgaxXrYNP4Frq BP4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723129968; x=1723734768; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=6KtF+zsK4gh5wBrd2V369YVuRxfiS/GTtNKOYSm0scE=; b=Ib1KwFRgld+XAJVeEc1nblEelmaCmsAvJKM4PTQb6ukmNFoj7eWgVkapLiqVC2EocT 4Hnf6SAJRCkNg7JOwbegKjyFsKbMZEkU2UUus139oAETPTe5H3vcOxha+xgOk3ad0x0u dElRQzI8bs6gYN5tx2LWhK43LFcTw1jqF5refQFC5jfZR4GqwOXJ6dUjRzxEsJb3D7iu w3vHzxfKP2DXoMpPIn6i4/tUPuWwH3rg+aP7aFkFgxj6g+/KY9JSkE+h97sI+Q2kgcRz SCrxU7jN9v20s6hre6cLhI7JAyBcBXi8eoVbgODnEplEDnq4gWrrPVzNVCY9Mimq734B ej4Q== X-Forwarded-Encrypted: i=1; AJvYcCV0kLnngfhudqWDMxqpn0eYOLSRHNlCzmkV2VEb208kSqHD3XiqONHk5It2l0htcP9UB+YJxqkNWODmrKWdCkiwpo3jU5ZLMIxgQWufwVfTlSezfD4= X-Gm-Message-State: AOJu0YwhStlKbPVFdTqxyfqmj0Lw7bWADmkBvaiQ9G8rwtw/EUE63E9E +r9XcmNryH0++UYhj56fD+oxOSqzxCCyFBp9dBw/M6+Txmdg2zvl X-Google-Smtp-Source: AGHT+IEmQ+Wjo1pu8wA3o8BPezfHpD/QX+EMqKP6+lIS8jhtcWqtGNQnCja/XUgJv2rBNpHXvbjTIw== X-Received: by 2002:a05:6000:1f81:b0:368:7868:2d76 with SMTP id ffacd0b85a97d-36d27590b52mr2494620f8f.51.1723129967661; Thu, 08 Aug 2024 08:12:47 -0700 (PDT) Received: from [127.0.1.1] ([213.208.157.67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36d27157145sm2179881f8f.12.2024.08.08.08.12.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Aug 2024 08:12:47 -0700 (PDT) From: Javier Carrasco Subject: [PATCH v2 0/3] use device_for_each_child_node_scoped to access device child nodes Date: Thu, 08 Aug 2024 17:12:36 +0200 Message-Id: <20240808-device_child_node_access-v2-0-fc757cc76650@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAGTgtGYC/3WNzQrCMBCEX6Xs2Uiy/VF78j2klJhs2oU2kUSKU vruxnr2+A0z36yQKDIlaIsVIi2cOPgMeCjAjNoPJNhmBpRYyRPWwuaSod6MPNneB0u9NoZSElW FdVlelNSNgzx/RHL82tW3LvPI6Rnie39a1Df9Sc9S/ZcuSkhhrdOo7uQah9dh1jwdTZih27btA 0Pd+TnAAAAA To: Suzuki K Poulose , Mike Leach , James Clark , Alexander Shishkin , Michael Hennerich , Lars-Peter Clausen , Jonathan Cameron , Anand Ashok Dumbre , Michal Simek , Sakari Ailus , Pavel Machek , Lee Jones Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-leds@vger.kernel.org, Javier Carrasco X-Mailer: b4 0.14-dev X-Developer-Signature: v=1; a=ed25519-sha256; t=1723129965; l=2074; i=javier.carrasco.cruz@gmail.com; s=20240312; h=from:subject:message-id; bh=ca0M/lgnDfsmI9N2dHuUiExLnhm74NvrG+D1yePsoeY=; b=ghu7H7XxFXYSwhyp49247Tu3pYhOgsX5bojOozYtl1FnGKmyaJQwxZjOeLEggBHab41H902Om o7omPSe2nfLDlC7/I1iY+bgxjk96KWSJ8krWFeiR/pGW4xE/53ZqP5U X-Developer-Key: i=javier.carrasco.cruz@gmail.com; a=ed25519; pk=lzSIvIzMz0JhJrzLXI0HAdPwsNPSSmEn6RbS+PTS9aQ= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_081250_643521_5D907659 X-CRM114-Status: GOOD ( 11.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This series removes accesses to the device `fwnode` to iterate over its own child nodes. Using the `device_for_each_child_node` macro provides direct access to the device child nodes, and given that in all cases they are only required within the loop, the scoped variant of the macro can be used. It has been stated in previous discussions [1] that `device_for_each_*` should be used to access device child nodes, removing the need to access its internal fwnode, and restricting `fwnode_for_each_*` to traversing subnodes when required. Note that `device_for_each_*` implies availability, which means that after this conversion, unavailable nodes will not be accessible within the loop. The affected drivers does not seem to have any reason to iterate over unavailable nodes, though. But if someone has a case where the affected drivers might require accessing unavailable nodes, please let me know. Link: https://lore.kernel.org/linux-hwmon/cffb5885-3cbc-480c-ab6d-4a442d1afb8a@gmail.com/ [1] Signed-off-by: Javier Carrasco --- Changes in v2: - Rebase onto next-20240808, drop upstreamed patches (changes for ad7768-1) - xilinx-ams.c: drop fwnode_device_is_available(child) (implicit in the loop). - Link to v1: https://lore.kernel.org/r/20240801-device_child_node_access-v1-0-ddfa21bef6f2@gmail.com --- Javier Carrasco (3): coresight: cti: use device_* to iterate over device child nodes iio: adc: xilinx-ams: use device_* to iterate over device child nodes leds: as3645a: use device_* to iterate over device child nodes drivers/hwtracing/coresight/coresight-cti-platform.c | 10 +++------- drivers/iio/adc/xilinx-ams.c | 15 +++++---------- drivers/leds/flash/leds-as3645a.c | 8 +++----- 3 files changed, 11 insertions(+), 22 deletions(-) --- base-commit: 222a3380f92b8791d4eeedf7cd750513ff428adf change-id: 20240725-device_child_node_access-442533910a6f Best regards, -- Javier Carrasco