From patchwork Mon Aug 26 10:07:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13777613 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 A9A34C5321D for ; Mon, 26 Aug 2024 10:22:19 +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:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wKZlzL2NZbeJxSHQJB09JnhRjfM+R/bIijlH4cu5cME=; b=NgL/cQ5CnxEurpJ69AAFBXIubD 7TwzcLlKWbicsKU9HAmYJaaK6Ky0HS/9MbZSnXEblkus9qhw+sED3oswqpD5+B3M79d4ajH6XdL/F zlzFdh9zBeavfCYQIhDKMQDIFV6o//hzhdpDHjFDmP5Q+iatuq3I5IQL2hN7NIifNlUJDCf6mHpM7 hxt3zpBeyHVUvhl2nIEbFToNff8a0Rj3dt74GvwQwLPWCfrFfLva3korfh9vOUBzkVhwz7ROQN0vr +ELlsoAW+9j4FkyUK3XSM4l3kRXV1w+IcvmY7ertMwWDFMeHe1sUsVT9KdAV7LkCq0Ps/Tf9Qybfk VmvH1JUQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siWrT-00000006udj-1ls6; Mon, 26 Aug 2024 10:22:11 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siWdf-00000006qlR-2yZi for linux-arm-kernel@bombadil.infradead.org; Mon, 26 Aug 2024 10:07:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=wKZlzL2NZbeJxSHQJB09JnhRjfM+R/bIijlH4cu5cME=; b=qUgwnYwRo1VR81A+4IRmWwWEFK GT9Lurcltk2e1lgsDW6Hy2UHIW2jGrFurDqFConGJEb3KFwJVuCn9IH73y3t5zL2qGP6ign789T5b q4jWpogpCV7nl0EEXCcZFGjzE20ARX9WM43FKbCQgMb8GqM7/RLK/bZBUOPE2d8BfFba2hbGgRF2Q R7Hd2R4H51RXkcVqHWS4EjerldJ1GprD8pju1pY790BpjuiCz9O6olMKNrFMYoOshZ4OVpHafmm9a OZGu6rLJfTm14x3+icI/fevtsaBSAeRuwOlxx2osO3NDtGTFRa4K2n2poRO8nfO6dS9dtI4Qvg4DF wxZ9D8Hw==; Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siWdc-0000000AdDM-308F for linux-arm-kernel@lists.infradead.org; Mon, 26 Aug 2024 10:07:54 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-4280772333eso6336175e9.0 for ; Mon, 26 Aug 2024 03:07:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724666869; x=1725271669; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=wKZlzL2NZbeJxSHQJB09JnhRjfM+R/bIijlH4cu5cME=; b=aohZYMsn/HDlhvs8xBRlzv0GcR/Cp7MUJkJtvoArevol4ePbIpGJq6i2bL6N88x+tg B8BAsSFeqozrLqma4+3GcmT3Tsm4aS5fKX5urc8/EJs1QJUAxi0kNoyQ2KupDW9QrFrn A1EPKN9UYSW6Oq+45oUaUacC6T7VYCP07hpO5U+OtHO5zmqPdbAe8vFtJbAG5D4O3Zjo uNLmFeN4/SE3RhrIVFts2WPz3GLAvXFbGk4PbfQkO5fXrf9srYBK3RytVLoq3UT4JdGo vUeKXpBHsGve4XeyBoIpb8zI/NdJlbKaK3vgtNNNsKLl+hKyd2WUx1s9SjMrCfRlURhg ItDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724666869; x=1725271669; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wKZlzL2NZbeJxSHQJB09JnhRjfM+R/bIijlH4cu5cME=; b=t8rujCgra01EL6FBCC0tAwwDXq45z0NIkFn966qb+ISacq42fnSTM8kXkgfb/Fyh8Y vWsuOIYXceEwuNS8nCORqxhtIkszoUWR32ocmq+bT8UHCGqLXhEZDL2VG+YltsXIm+tf DDFt53emdyFNbQssSUqvqlmgtzsMnfZQXNDLLhGAJDBQr82ODy/Qcp2MRcX+S9pl7y1H J/WpjM5G6JmN7xcs95L+dgdW++8Sv44nQ0rk1FYcxbM7MfAQZUC3o8fDODnlI/zzOa3g ZUUoRF4Ec3R4jlKAIRJ9JL7YvoSR/2EG6/KXEcFL4SVwmfXyk3oLfJGqRvR2WlUkxRNi yPtg== X-Forwarded-Encrypted: i=1; AJvYcCXn9cSNFXWJCIhq7RlwCpHK6szb68SCbW3ptlnaw84N/DRgxxehb5u1iuV9C2WubRRGcSTrefes1y8f74zzo6Rg@lists.infradead.org X-Gm-Message-State: AOJu0YzMZtGEfy0kdWfL55vNbhsKk592+cCAH325efnO0iq9llGXpfnC 7euGHHQWivxW+Ni7M1JLHlwzJ89Tf+/AfAcI7D+TeuIwrRc3uUG50/bjxze9qHVuk19dIgzGYNv Q X-Google-Smtp-Source: AGHT+IHpsbxr2jatXOo5ggzUHc4AhIIKQUY/zOn1ZCBV5PQBOfgESp9ARtTvX8s+q9//U0p353spAQ== X-Received: by 2002:a5d:6481:0:b0:360:872b:7e03 with SMTP id ffacd0b85a97d-373117ba829mr3896712f8f.0.1724666868800; Mon, 26 Aug 2024 03:07:48 -0700 (PDT) Received: from [127.0.1.1] ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37308110009sm10324821f8f.18.2024.08.26.03.07.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Aug 2024 03:07:48 -0700 (PDT) From: Krzysztof Kozlowski Date: Mon, 26 Aug 2024 12:07:27 +0200 Subject: [PATCH 11/11] phy: ti: j721e-wiz: Simplify with scoped for each OF child loop MIME-Version: 1.0 Message-Id: <20240826-phy-of-node-scope-v1-11-5b4d82582644@linaro.org> References: <20240826-phy-of-node-scope-v1-0-5b4d82582644@linaro.org> In-Reply-To: <20240826-phy-of-node-scope-v1-0-5b4d82582644@linaro.org> To: Vinod Koul , Kishon Vijay Abraham I , Ray Jui , Scott Branden , Broadcom internal kernel review list , Chunfeng Yun , Matthias Brugger , AngeloGioacchino Del Regno Cc: linux-phy@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-msm@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1369; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=w0e0ayjuNxyXuvAWm5UI9oSMx8HCNPzhkU4MAGzlhMQ=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmzFPiG/KFFJ/l+/AwfobhDy9BkMVA4hidPlmBJ BxVdEXyoG+JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZsxT4gAKCRDBN2bmhouD 14gOD/4gnPbwGuH5BNBzq+9rK8+/r4dwG7A1IcyXYdYsWfau5R0tw2zv23PLPhzCYNA50n6txqT C4oU6FGzQV4QlgWI1kYnfzSqQc7rg4Nbfz7nqCcF3C/fDdThpmB+v3jVhkB1y9gGVsyYA0zOBYt iVU9WqZPPrtIfMWHBnMxl0/Sh26CUVyzVG5ZPow20y9RExDuAPrlJvqePRWEBPx+vPRvAccLzHB BeEfmlJPUx/fowwJgvDdGBVWbEUexJJ7JqOr2GM870FVsgCuH4/gkQrmcL5XT5FvZt+i8/yDGVn P3MN2mJLs7+gzgLsOGkre8R6zBEO5q95XUix1+S2pQyAp9oDk618h2nK06X87jmXPfm0c8Wsg4Y iRQ9GqsZh45L3QI4hsGT2nIlOYshaS1/9UQ3n2dnRVUaLgV5PG1IzZA2itCWcC+HFgvqaqIrYBI rlAS4yWLacWX1JmJ7AKfX4zwwkeZDvspdoqTZ5NS7anNEMA9TSw5PHj0iNvRr/ardFTQx/kt9Rt Uy1Yfn/QQWQCIZWYwWVopcjVmB01bpBhRV9iVoBnAWXao7pnQa4SmaZeNNupsIO/Z1wFPV7Bqjb PqeKkzw1ByOii2k+UDDiHn+jkwVSkOC/G+itzuyQ/ojBpWAgMS7kpNDOS/AeogFPFk9jrG9p/CG 8Y6+jVZpDl7Mm8w== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240826_110752_919947_B207CAD8 X-CRM114-Status: GOOD ( 11.62 ) 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 Use scoped for_each_child_of_node_scoped() when iterating over device nodes to make code a bit simpler. Signed-off-by: Krzysztof Kozlowski --- drivers/phy/ti/phy-j721e-wiz.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/phy/ti/phy-j721e-wiz.c b/drivers/phy/ti/phy-j721e-wiz.c index d0f3ead3fc80..a6c0c5607ffd 100644 --- a/drivers/phy/ti/phy-j721e-wiz.c +++ b/drivers/phy/ti/phy-j721e-wiz.c @@ -1404,7 +1404,7 @@ MODULE_DEVICE_TABLE(of, wiz_id_table); static int wiz_get_lane_phy_types(struct device *dev, struct wiz *wiz) { - struct device_node *serdes, *subnode; + struct device_node *serdes; serdes = of_get_child_by_name(dev->of_node, "serdes"); if (!serdes) { @@ -1412,7 +1412,7 @@ static int wiz_get_lane_phy_types(struct device *dev, struct wiz *wiz) return -EINVAL; } - for_each_child_of_node(serdes, subnode) { + for_each_child_of_node_scoped(serdes, subnode) { u32 reg, num_lanes = 1, phy_type = PHY_NONE; int ret, i; @@ -1422,7 +1422,6 @@ static int wiz_get_lane_phy_types(struct device *dev, struct wiz *wiz) ret = of_property_read_u32(subnode, "reg", ®); if (ret) { - of_node_put(subnode); dev_err(dev, "%s: Reading \"reg\" from \"%s\" failed: %d\n", __func__, subnode->name, ret);