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 579BCC83F2D for ; Thu, 29 Aug 2024 15:59:48 +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:In-Reply-To:Content-Type: MIME-Version:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=lhPD/kfMojMsiZuoWrSaNbTJbgUBxkxmEH5S95zw+WE=; b=VO4mOgTSV2EoZu SZW58m//ZNPUQdLujsDVCfHlslGeH3azhtyRC0K9LiaHq/6pZIZORKq36QWDk4CGSh12lUKHg7QvV RhsVvvSymYHc6KyNxSZ9xY+AnMqZFESocO5PfvgL9ra3PwXg8Ma09G9b+2150/XXh7Rt36o3hvVSq +AitUTIGXo2y3N9YZ7W4dtjRJ+O+PTaR/lSaspmCqkYFqP4cAskglUPiSm/svEBumRorgyCZN1Hls 3P//XQVhacVtfzuO91nZ2hLZ1PaqA8wx5gebxyNrzvBiP/RkyH1QR5ECkokf4rBfzi5zgiPKAKS28 HqLuyRY/+WNZGEmD7P0g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjhYc-00000002j5n-1BNp; Thu, 29 Aug 2024 15:59:34 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sjhXj-00000002ire-38J9 for linux-arm-kernel@lists.infradead.org; Thu, 29 Aug 2024 15:58:41 +0000 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-201fbd0d7c2so7609855ad.0 for ; Thu, 29 Aug 2024 08:58:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724947118; x=1725551918; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=lhPD/kfMojMsiZuoWrSaNbTJbgUBxkxmEH5S95zw+WE=; b=HkYUtcXVjKDNlpoExesswEdiboLkxxEJ8Moin2F5f7jZcxMugjORZ/gVuX2nYMwx4r HHN8hHVW6bFgqGF0WBLdtHcDRRIMhIkukCVTxV1OQ2FPudINaXzmZ373R/hY/QfrVWu1 qBO9wRy+Z6wsO6VJNy71uH6mZkyfzyDD1601RpgEMkD45LYCkI1GoCwkfazPVBOwklf8 J84W+bYXDt8mOYKfXPy57dgEVLaxhXrN9gMoFxmvxFkSgiWI2yrUpA5z3TiewrFMyBgw Teov0gHshReBs/XTKrjmD37yLcpP9xL+MvWQKg1qGNKAd3GN7THv5SdT0J2FKteSoLwT inyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724947118; x=1725551918; h=in-reply-to:content-disposition:mime-version:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lhPD/kfMojMsiZuoWrSaNbTJbgUBxkxmEH5S95zw+WE=; b=S9hW4YAW9dD0RwK9bnYOJF5B0EVcSGJhFo9l5lP4iLj3eOGqvZzQHpCGpLj67SAb81 j44G9xd47txBB+DJWtxlMBwhSQbEZyTGHAoXXHqEbK9/xDu987Tqab/3JCxSCYDzHt9N OWf7augL9SKeij4hjuqxYWgyoUK8W6nPrcNFq3TwKJ7dk2oO9sJ9k5k+SKimFeXALntl 6Yqo2wDteZTze3ACGWspGOBOdLDJ4o1iDt5/O4cvRF4p8icbQwxermBPpSL3LDnrGjE6 xSZaqZnIZ4fFEVTeAmWvLtTmVTMnxrYEMKNoRIT4jWXMtWI4AC5MrJpW+9Xpz483yzyk 65xA== X-Forwarded-Encrypted: i=1; AJvYcCXfBNPHNvPCm/Dz7gWM0mhQIVq1UBzh9D1LZlXSOuDsUSK9O8EHXi/THwLxhGSgZMox7d6AbdISWgzxcgOH2cy+@lists.infradead.org X-Gm-Message-State: AOJu0Yw3Ccj3u4w/xcSs9tFoqDa1ox51YpQheDHpOUNN7EQ7L4LlSYNh 2kk1CHp/6pkWLWl0OTJnsUeTYfWcL3sVqeWvUZ43yjobvlSPGWPy X-Google-Smtp-Source: AGHT+IG1iOySf3RBBJ3oZsxcckYR+heTF1O3pcq0NqbDD6cG8BqQV54k0HoaRzIYQMYUSXNS5l1OAA== X-Received: by 2002:a17:902:d2ce:b0:202:4b65:65c0 with SMTP id d9443c01a7336-2050c3a9497mr33986965ad.32.1724947118265; Thu, 29 Aug 2024 08:58:38 -0700 (PDT) Received: from five231003 ([2405:201:c006:3236:1c28:fa2a:bb62:6e9]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-205152b3546sm13110165ad.17.2024.08.29.08.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Aug 2024 08:58:37 -0700 (PDT) Date: Thu, 29 Aug 2024 21:28:28 +0530 From: Kousik Sanagavarapu To: Jinjie Ruan Cc: andrew@lunn.ch, sebastian.hesselbarth@gmail.com, gregory.clement@bootlin.com, herve.codina@bootlin.com, qiang.zhao@nxp.com, christophe.leroy@csgroup.eu, thierry.reding@gmail.com, jonathanh@nvidia.com, nm@ti.com, ssantosh@kernel.org, petlozup@nvidia.com, pshete@nvidia.com, ruanjinjie@huawei.com, christophe.jaillet@wanadoo.fr, ulf.hansson@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-tegra@vger.kernel.org, krzk@kernel.org, jic23@kernel.org Subject: Re: [PATCH -next 8/8] soc: ti: knav_qmss_queue: Simplify with scoped for each OF child loop Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240827114607.4019972-9-ruanjinjie@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240829_085840_047596_254DFD8A X-CRM114-Status: GOOD ( 13.06 ) 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 Jinjie Ruan writes: > @@ -1080,17 +1080,13 @@ static int knav_queue_setup_regions(struct knav_device *kdev, > { > struct device *dev = kdev->dev; > struct knav_region *region; > - struct device_node *child; > u32 temp[2]; > int ret; > > - for_each_child_of_node(regions, child) { > + for_each_child_of_node_scoped(regions, child) { Are you sure using *_scoped() is better here? Since it seems that we need the memory pointed to by "child" in cases where we don't go into an error path. > region = devm_kzalloc(dev, sizeof(*region), GFP_KERNEL); > - if (!region) { > - of_node_put(child); > - dev_err(dev, "out of memory allocating region\n"); > - return -ENOMEM; > - } > + if (!region) > + return dev_err_probe(dev, -ENOMEM, "out of memory allocating region\n"); > > region->name = knav_queue_find_name(child); > of_property_read_u32(child, "id", ®ion->id); Similarly in most of the other cases in this series where a similar change is done. Also FYI, as for dev_err_probe(), I think I covered all of them in this file and a patch for it is currently sitting in ti-drivers-soc-next. Thanks