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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76810C636D6 for ; Mon, 20 Feb 2023 05:31:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230032AbjBTFbx (ORCPT ); Mon, 20 Feb 2023 00:31:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229736AbjBTFbw (ORCPT ); Mon, 20 Feb 2023 00:31:52 -0500 Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63F52E055 for ; Sun, 19 Feb 2023 21:31:50 -0800 (PST) Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id C729384227; Mon, 20 Feb 2023 06:31:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1676871107; bh=v4Iocd2YkYzi8XSnHNbHvl8q7LRjBti+wi193d4zuyQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=IVLVrXlwIfuQAHNNIHdkdhP0fI945C4E+cpeoAnCOHuE/W0TNe54RyY1byUdRecB/ tgmuewbOTmk4ZwxxqcWNHdasLfe9hKYdmwKa+f/brQivuAOLBwpyvJPw4BV0Lu/RKC B6lSlXXuZFqGnqcGUEEvxp7NxeYPlv06P8ngFa8LAkhcAvKpAHg3i1XuGpKLDPYqXP 2gv7b7o9ZTsztZt//4grYY8LkJQsck5e31ZTYrESnafuWqwjgE9TB7g6BpO8rAaVgC Z+hhfgq+k3XwRtGgUB2UU1JXKgcWZvlZFcTCZpI0qeUB+UVE4ah2v4VxDa++f2TPxl /oLRjFTd6aK0w== Message-ID: <3d567ad3-2402-9582-657e-c92b7bddca40@denx.de> Date: Mon, 20 Feb 2023 06:31:46 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v2 3/4] soc: imx: imx8m-blk-ctrl: Scan subnodes and bind drivers to them Content-Language: en-US To: Liu Ying , linux-arm-kernel@lists.infradead.org Cc: Alexander Stein , Fabio Estevam , Krzysztof Kozlowski , Laurent Pinchart , Lucas Stach , NXP Linux Team , Paul Elder , Peng Fan , Pengutronix Kernel Team , Richard Cochran , Richard Zhu , Rob Herring , Sascha Hauer , Shawn Guo , devicetree@vger.kernel.org References: <20230220035051.327847-1-marex@denx.de> <20230220035051.327847-3-marex@denx.de> From: Marek Vasut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 2/20/23 05:34, Liu Ying wrote: [...] >> @@ -310,6 +312,13 @@ static int imx8m_blk_ctrl_probe(struct platform_device *pdev) >> >> dev_set_drvdata(dev, bc); >> >> + for_each_child_of_node(dev->of_node, np) { >> + child = of_platform_device_create(np, NULL, dev); >> + if (child) >> + continue; > > We usually check and handle abnormal cases. So, better to check > '!child" and warn in the 'if' clause. Anyway, the logic looks ok. So, > kinda > > Reviewed-by: Liu Ying The current approach reduces indentation, so I'll leave it as is. Thanks