From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (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 89A2B16EB42 for ; Mon, 5 Jan 2026 21:33:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767648791; cv=none; b=CgrTZp1+xFL+Xtaj5cfsGk272rMewnIwAyq0bkLWxiLczaanjt2spgOrh4Flv18X5pNfyqDRj+OcNhE1czFxFvf8Ndbwxk9oZLjIFqbrTxb+3lJIAMjQR537QOkYvZJNY+S8leLF1mdomnzHBFZF0UIYK5Hor1qdfCVt78rq6XI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767648791; c=relaxed/simple; bh=hvhUDXBXFTeCKUmZ3PPiyizy7WDY2pKVeynkZQWs/3U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=f5E2zChpgqO3j3UVwbY0K7UWLHLzYqZGKKaCLYS3QSvBQGh11kxVpILanKI8FgUmmraZ/uE886aX/SZoC0XR3MzSgTJLIfy0U4rgfv8vBAuVtnfeY2InpNqF5mCVKFziRuw2Q+NJKt7bojK7XREcypBLZRIrtNVuJoxssmlFEfA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Dwmwqqwp; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Dwmwqqwp" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-2a081c163b0so3386255ad.0 for ; Mon, 05 Jan 2026 13:33:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1767648789; x=1768253589; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=p8u80z+tPf43NlNwf3gyc1tmFsPKFLQnzJ5dp6IiBCs=; b=DwmwqqwpwPrZBuZpUXL7qhjw4wuPyG8nk2goYk+zEKmmPGaTArGEtg4TnP4s8dTTA9 Md3koDwEs0IuKJ2x1HuZ4yDrnGxmsFbTd1JZ3ehy3gNgprV3AhSLog8zkqODLIa8Mggs ZPLmRZgJGF4EgM5gV1ddR98JZSvJBRWo18Km7CNEbs+l1CVXgS0xA1pnPnQ0ZNeerDCg 6oVUOUX6ceUN/C7i48wN2JyNvmohvTT5WmJgiCOjMGGNM9aI9wZODNpdgjRtLbDzN4sW yVOqXbFB4jGylzHY5+Lfx+KCPOnNoj1WhFF25j2mIch5G1r1ifjcS0y4a7uAXIk1E7CK PWLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767648789; x=1768253589; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p8u80z+tPf43NlNwf3gyc1tmFsPKFLQnzJ5dp6IiBCs=; b=nyQXuFICJQT/MRp1WkURFNuXk/Q4BGkMMoGbYoM7bAttlpABoygvJdXVA+wwWFChV8 jksdQCja7TbY8EdtTJe/HPY81AYggdyfvvL4h3So+AmPOMgOUbjCK+lD9+1PEDPiuk7S cnGdc/n/+IswsLcX1RXLeATjDKmVhK6TGUs+WmtTAD7gfrwkDNAkhZblBbpwSF2GBisJ fPPV4fVheg2T+wQtbuhtfGiSzV4MqHbGHlDB03JI4BSU+8dV8ruU3TDuoOYW7pmRlGjo NyvsroSFaJmD2wflB1ERp2ggPKB8WjH93uYbVjdYQe2hYkHEo3SU0i4to25XMcMTvZlm 6g+w== X-Forwarded-Encrypted: i=1; AJvYcCVmtTl1oJbG2ZJwBn+tgyU27/pG6gg6StC5AcCVipmLEJ+pkhfXzGA+VcITCdDVACWAXTqgP3rrShbLA5Q=@vger.kernel.org X-Gm-Message-State: AOJu0YwVp1NQ5hRU2KGHBh0EXvFggWOzTecD/S5qFwqJC27Hku7XPloG 47KE5CSBaDdxtqc93eYWfS7l71S9uXG0nldrmE+hJZejywoyY24SSiDyXHYlwTsE1ko= X-Gm-Gg: AY/fxX4LCpOS2GxtQUwRtgWFcM+eDUJDTLKJlErfVgAzIqDM+AbqUdcb46DBUPQ+bBy MTUdAENhqj+K3zMf7oIjFWtslmrcCDavhdXfyr/aGj+qDwQ/0dHKfjKJedQjpK0fKPblRk0GgtY IKNzTKD5TiKljlh3Ch08QwI4iMkKlFTCeasTJYrMJwBFe82jeVWbdZSKlJe5hDz13sZYqYBG8P3 FaNWtXG26oFxZL2YzMaiThp7Qqc19MPDsb6MJYO2cVmJNRXkFLr4/sN/W787gbPCNsjBUru/sGX 5ZUGHwlWNdMV5q21weEjbOG2m8ysk5GsKVznlCuycknWdoc24fTdtreF6lQQfp/kFhoDNkz6wjM V9tXgd6xt1NJBsaUDepxVqHt4oYC6Q51q521CmzUBB3xfhjdBIFavkyV4/V1nUPb3HI3v12gUK/ Wh3mbd5yHVfHxwRw== X-Google-Smtp-Source: AGHT+IF0bVODhApERlsNCQrrCwCXh5Bc7cgqZB6OPyCG+4xaL0MSIbArxA2Sg2gVDzhacygsGqC4xA== X-Received: by 2002:a17:902:fe04:b0:2a1:2b5f:d16b with SMTP id d9443c01a7336-2a3e2cefe5fmr6801155ad.31.1767648788754; Mon, 05 Jan 2026 13:33:08 -0800 (PST) Received: from p14s ([2604:3d09:148c:c800:3f6b:5551:220f:8f13]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a3e3c3a512sm1849275ad.10.2026.01.05.13.33.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jan 2026 13:33:07 -0800 (PST) Date: Mon, 5 Jan 2026 14:33:05 -0700 From: Mathieu Poirier To: Krzysztof Kozlowski Cc: Bjorn Andersson , Matthias Brugger , AngeloGioacchino Del Regno , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH 1/2] remoteproc: mtk_scp: Simplify with scoped for each OF child loop Message-ID: References: <20260102124827.64355-3-krzysztof.kozlowski@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260102124827.64355-3-krzysztof.kozlowski@oss.qualcomm.com> On Fri, Jan 02, 2026 at 01:48:28PM +0100, Krzysztof Kozlowski wrote: > Use scoped for-each loop when iterating over device nodes to make code a > bit simpler. > > Signed-off-by: Krzysztof Kozlowski > --- > drivers/remoteproc/mtk_scp.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) > I have applied both patches. Thanks, Mathieu > diff --git a/drivers/remoteproc/mtk_scp.c b/drivers/remoteproc/mtk_scp.c > index db8fd045468d..328541e62158 100644 > --- a/drivers/remoteproc/mtk_scp.c > +++ b/drivers/remoteproc/mtk_scp.c > @@ -1287,7 +1287,6 @@ static int scp_add_multi_core(struct platform_device *pdev, > struct device *dev = &pdev->dev; > struct device_node *np = dev_of_node(dev); > struct platform_device *cpdev; > - struct device_node *child; > struct list_head *scp_list = &scp_cluster->mtk_scp_list; > const struct mtk_scp_of_data **cluster_of_data; > struct mtk_scp *scp, *temp; > @@ -1296,11 +1295,10 @@ static int scp_add_multi_core(struct platform_device *pdev, > > cluster_of_data = (const struct mtk_scp_of_data **)of_device_get_match_data(dev); > > - for_each_available_child_of_node(np, child) { > + for_each_available_child_of_node_scoped(np, child) { > if (!cluster_of_data[core_id]) { > ret = -EINVAL; > dev_err(dev, "Not support core %d\n", core_id); > - of_node_put(child); > goto init_fail; > } > > @@ -1308,7 +1306,6 @@ static int scp_add_multi_core(struct platform_device *pdev, > if (!cpdev) { > ret = -ENODEV; > dev_err(dev, "Not found platform device for core %d\n", core_id); > - of_node_put(child); > goto init_fail; > } > > @@ -1317,14 +1314,12 @@ static int scp_add_multi_core(struct platform_device *pdev, > if (IS_ERR(scp)) { > ret = PTR_ERR(scp); > dev_err(dev, "Failed to initialize core %d rproc\n", core_id); > - of_node_put(child); > goto init_fail; > } > > ret = rproc_add(scp->rproc); > if (ret) { > dev_err(dev, "Failed to add rproc of core %d\n", core_id); > - of_node_put(child); > scp_free(scp); > goto init_fail; > } > -- > 2.51.0 >