From patchwork Sat Oct 22 07:19:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7236 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1090838wrr; Sat, 22 Oct 2022 00:48:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4PH1XerKb0ZC3tcH//GfQeBre7QA91CPWcvgGwpC8YI9/RPxLk/obcionITmz9JG4yUENx X-Received: by 2002:a17:903:248:b0:172:7520:db04 with SMTP id j8-20020a170903024800b001727520db04mr23478688plh.99.1666424920774; Sat, 22 Oct 2022 00:48:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666424920; cv=none; d=google.com; s=arc-20160816; b=kl/507//6eBUI40yo1OkGAExATbOe/R3hv1zJf6bJFKWpUAJ81TtV3pZN5xIysIT4c hV4pM8L+gmh9aUhfmNT5qVrPA1X3d4sbzvf/qvx03pXwroE+ppNU5CeFDCJWrsAH6aUH I4K46wO6y7OFS9Eg37Ry/ccGKxLBM7CLQW3BqsPZUMYqbvc0TdohNyceDKqnXXoUZ+IC DhUUDNSfigehcL6hYCnH6ypvRSGsCY/Mfl+638aY8fQORXqQaGt39dJGLgftJ244y4el VPCbspgNqHETV8c8621KRcMDpV791ttRuCTWWmDHnRURuM0y+RGne/sAHN4kK7DkVQgR FgeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kXABIBFDsmyIZXBdT87jf+FURDwKlr8pTsQrKynsDIE=; b=DdTQZvsj1dYbLaMVU5T0kjS/E15PmN1jwQ+XZP1x+WxkQL07lDaGTIbZGh1k9tFU7p nNaUmvQ441Xn0iMP1GEpk0g35sLTJtWPPH3UxcbPCHnb3xQ8oDeGg3UyiXuCglYvlXcu fSPqfo+DzqTPZ0x2zoEfNbeFPat9mt6Aww9VvVrfxLCyCjalpVLsolHkA57BzqeVtqw3 kx8+2y3O7j0x3qoQtLBr+MCdYcvFviAAHBdZ+/jQtH7clClg5TodUszMoZZNB5B4Dz+0 0+rNwR5rr5DJ93gCufkkx7wkFp+9OiojMbQeK7FFmX6vJZP4liflQw7O7zOg3zdL/IJh YSfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UdmnLe7o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e14-20020a056a001a8e00b0056334b72215si31371456pfv.86.2022.10.22.00.48.28; Sat, 22 Oct 2022 00:48:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UdmnLe7o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231404AbiJVHrq (ORCPT + 99 others); Sat, 22 Oct 2022 03:47:46 -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 X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747373178008177014?= X-GMAIL-MSGID: =?utf-8?q?1747373178008177014?= 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@amarulasolutions.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; } -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; @@ -741,7 +741,7 @@ static struct dma_chan *mxs_dma_xlate(st ofdma->of_node); } -static int __init mxs_dma_probe(struct platform_device *pdev) +static int mxs_dma_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; const struct mxs_dma_type *dma_type; @@ -839,10 +839,7 @@ static struct platform_driver mxs_dma_dr .name = "mxs-dma", .of_match_table = mxs_dma_dt_ids, }, + .probe = mxs_dma_probe, }; -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);