From nobody Thu Dec 18 08:09:28 2025 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 79944C04A95 for ; Sat, 22 Oct 2022 07:47:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231393AbiJVHrr (ORCPT ); Sat, 22 Oct 2022 03:47:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231362AbiJVHrQ (ORCPT ); Sat, 22 Oct 2022 03:47:16 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C640237EE; Sat, 22 Oct 2022 00:44:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CF6C560B00; Sat, 22 Oct 2022 07:37:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3E86C433B5; Sat, 22 Oct 2022 07:37:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424264; bh=BX8VTQIPLJW77cNwpmkb/Yr53Pz0B1c4Ovk/HIEfias=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UdmnLe7oUh3DP8yaCBxrHQBTebUGzTTwhg0/Cfh9imjvchoqdiNTuiYF65x5KrPtp RtonvjJtA7A0MqcdXM+4Zs5gN6Ku77A2tXKJRDcfx5mxFMck+vz7Q+1r01DLe/9FQ0 10vREhwLx1CCCW6jEGElIoRsB92PFcmMJswrNWQk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michael Trimarchi , Dario Binacchi , Sascha Hauer , Vinod Koul Subject: [PATCH 5.19 064/717] dmaengine: mxs: use platform_driver_register Date: Sat, 22 Oct 2022 09:19:03 +0200 Message-Id: <20221022072426.428089076@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Dario Binacchi commit 26696d4657167112a1079f86cba1739765c1360e upstream. Driver registration fails on SOC imx8mn as its supplier, the clock control module, is probed later than subsys initcall level. This driver uses platform_driver_probe which is not compatible with deferred probing and won't be probed again later if probe function fails due to clock not being available at that time. This patch replaces the use of platform_driver_probe with platform_driver_register which will allow probing the driver later again when the clock control module will be available. The __init annotation has been dropped because it is not compatible with deferred probing. The code is not executed once and its memory cannot be freed. Fixes: a580b8c5429a ("dmaengine: mxs-dma: add dma support for i.MX23/28") Co-developed-by: Michael Trimarchi Signed-off-by: Michael Trimarchi Signed-off-by: Dario Binacchi Acked-by: Sascha Hauer Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20220921170556.1055962-1-dario.binacchi@ama= rulasolutions.com Signed-off-by: Vinod Koul --- drivers/dma/mxs-dma.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) --- a/drivers/dma/mxs-dma.c +++ b/drivers/dma/mxs-dma.c @@ -670,7 +670,7 @@ static enum dma_status mxs_dma_tx_status return mxs_chan->status; } =20 -static int __init mxs_dma_init(struct mxs_dma_engine *mxs_dma) +static int mxs_dma_init(struct mxs_dma_engine *mxs_dma) { int ret; =20 @@ -741,7 +741,7 @@ static struct dma_chan *mxs_dma_xlate(st ofdma->of_node); } =20 -static int __init mxs_dma_probe(struct platform_device *pdev) +static int mxs_dma_probe(struct platform_device *pdev) { struct device_node *np =3D pdev->dev.of_node; const struct mxs_dma_type *dma_type; @@ -839,10 +839,7 @@ static struct platform_driver mxs_dma_dr .name =3D "mxs-dma", .of_match_table =3D mxs_dma_dt_ids, }, + .probe =3D mxs_dma_probe, }; =20 -static int __init mxs_dma_module_init(void) -{ - return platform_driver_probe(&mxs_dma_driver, mxs_dma_probe); -} -subsys_initcall(mxs_dma_module_init); +builtin_platform_driver(mxs_dma_driver);