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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D46ADC61DA3 for ; Tue, 21 Feb 2023 17:10:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233675AbjBURKP convert rfc822-to-8bit (ORCPT ); Tue, 21 Feb 2023 12:10:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233749AbjBURKP (ORCPT ); Tue, 21 Feb 2023 12:10:15 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF3AC16321 for ; Tue, 21 Feb 2023 09:10:11 -0800 (PST) Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pUW9M-0003uJ-BB; Tue, 21 Feb 2023 18:09:56 +0100 Message-ID: <6181434024ae29aafe1da2088be0f48c377e303b.camel@pengutronix.de> Subject: Re: [PATCH v3 3/4] soc: imx: imx8m-blk-ctrl: Scan subnodes and bind drivers to them From: Lucas Stach To: Marek Vasut , linux-arm-kernel@lists.infradead.org Cc: Liu Ying , Alexander Stein , Fabio Estevam , Krzysztof Kozlowski , Laurent Pinchart , NXP Linux Team , Paul Elder , Peng Fan , Pengutronix Kernel Team , Richard Cochran , Richard Zhu , Rob Herring , Sascha Hauer , Shawn Guo , devicetree@vger.kernel.org Date: Tue, 21 Feb 2023 18:09:54 +0100 In-Reply-To: <20230221152804.6061-3-marex@denx.de> References: <20230221152804.6061-1-marex@denx.de> <20230221152804.6061-3-marex@denx.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.46.3 (3.46.3-1.fc37) MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:900:1d::77 X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: devicetree@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi Marek, Am Dienstag, dem 21.02.2023 um 16:28 +0100 schrieb Marek Vasut: > This particular block can have DT subnodes describing the LVDS LDB > bridge. Instead of misusing simple-bus to scan for those nodes, do > the scan within the driver. > > Reviewed-by: Liu Ying > Fixes: 94e6197dadc9 ("arm64: dts: imx8mp: Add LCDIF2 & LDB nodes") > Signed-off-by: Marek Vasut > --- > Cc: Alexander Stein > Cc: Fabio Estevam > Cc: Krzysztof Kozlowski > Cc: Laurent Pinchart > Cc: Lucas Stach > Cc: NXP Linux Team > Cc: Paul Elder > Cc: Peng Fan > Cc: Pengutronix Kernel Team > Cc: Richard Cochran > Cc: Richard Zhu > Cc: Rob Herring > Cc: Sascha Hauer > Cc: Shawn Guo > Cc: devicetree@vger.kernel.org > Cc: linux-arm-kernel@lists.infradead.org > --- > V2: - Turn this into 3/4 > - Warn and continue in case of error > V3: Add RB from Liu > --- > drivers/soc/imx/imx8m-blk-ctrl.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/soc/imx/imx8m-blk-ctrl.c b/drivers/soc/imx/imx8m-blk-ctrl.c > index 399cb85105a18..4f5736e612fb0 100644 > --- a/drivers/soc/imx/imx8m-blk-ctrl.c > +++ b/drivers/soc/imx/imx8m-blk-ctrl.c > @@ -169,7 +169,9 @@ static int imx8m_blk_ctrl_probe(struct platform_device *pdev) > { > const struct imx8m_blk_ctrl_data *bc_data; > struct device *dev = &pdev->dev; > + struct platform_device *child; > struct imx8m_blk_ctrl *bc; > + struct device_node *np; > void __iomem *base; > int i, ret; > > @@ -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; > + dev_warn(dev, "failed to create device for %pOF\n", np); > + } Any reason for not using devm_of_platform_populate() instead? Regards, Lucas > + > return 0; > > cleanup_provider: