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 BF692ECAAD8 for ; Wed, 21 Sep 2022 17:07:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=N0qF99kqR1FLwTTArvbWqsI2E+xs7rAOCkbjzz3FgTE=; b=NwikQ6S+ugZdPx taBQrZgu5s9+YDdESv/ll/HC3N71c/YifGSJjcehmp94BzR5CN+0d1tNwfHmgb29EY1RaDu+f/vh0 wtGfEY+Zw72w6ILIc5e4RGUWxXX2+h/hf5Q02fHahYD3i0NQEXxXix77BiodBCLFl0bA9oY8PbODx Wzg/17SLOU8iGYB7qkFnTlkiHjgrzFolGSeyfqH5tEf74j9O9wCcFDUg842KXve906QyXEKoKgi/I RTf73YEChLqf8gVD0gS+JJ48WSsieoKIYkV0QsGDaC252PEo60/4QWjDgZ0qzDMyg5QuvPcAIuUMV HCvWO/PvcOZuoNDNWhDQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ob3BS-00C7F4-W1; Wed, 21 Sep 2022 17:06:51 +0000 Received: from mail-ed1-x52d.google.com ([2a00:1450:4864:20::52d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ob3BP-00C7EQ-5o for linux-arm-kernel@lists.infradead.org; Wed, 21 Sep 2022 17:06:48 +0000 Received: by mail-ed1-x52d.google.com with SMTP id w28so9677175edi.7 for ; Wed, 21 Sep 2022 10:06:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=13KrUn/vK4OvwOsT1GyfzamKvbOZHawCA5zcRq7muWw=; b=K08ArTlVGsyc0SAIljgyi30InRUPlMtrNCxpDmu1hgp81UAVnxk/nCuUHorbHVEIwR 6S29osbtR09bB8cVoWs/j3VPhB4VSJ4E57HIk3O9wj/CaNvmV/GbulyUmDtlEn5gNZ4k hZFUYg6ISBFf1gJp8MwoTnpoQdlhjnm8v9Rlo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=13KrUn/vK4OvwOsT1GyfzamKvbOZHawCA5zcRq7muWw=; b=K3YsVbp4NNK/UWOIgeaSAJ4ME2kl+7UZTmQrV6/3XAhpABQQ2GztPOITcnPajlTI/9 L3J1vgDBM6w4ajp6+5MIjypdgUxM5Fo/odjDYB+sR7sMzrcgG1JWKbAo+nwizYrvKNoG o+8N1W5JTQhdVWlzI/8b8KATb1zJwwFF9zm8uI4lQLuRqra1ZXl/EpB5zyIuT0xzozOx dquX/GZTbTN/eJoT+MxmpPlPyBR8Ml+iraX5YT3z0QhCdXi7Moes1bvLZ5gCev6o4CAW vLLtE9R4xFk6lrJOU64mv8sSyaxj+RuDHjua8KqyPNpLQ+c22NuGHXv+r2s/8EMTYmKO cSkQ== X-Gm-Message-State: ACrzQf2iPdTcbfl3e0heGckOTdZjUlIoXJtDx8/WCbwgmJ+krEsMnfAH 43ficQG+UKoYMBgpbTEAx916Lw== X-Google-Smtp-Source: AMsMyM5LostbLMrQ/ZLX3Zv+Rf1hWT+t6mpBiz9T0uqd2GeK3MULwy/v1qfzz59wqxZEro4/2cgLcg== X-Received: by 2002:a05:6402:d05:b0:425:b5c8:faeb with SMTP id eb5-20020a0564020d0500b00425b5c8faebmr25420939edb.273.1663780004402; Wed, 21 Sep 2022 10:06:44 -0700 (PDT) Received: from dario-ThinkPad-T14s-Gen-2i.homenet.telecomitalia.it (host-95-232-92-192.retail.telecomitalia.it. [95.232.92.192]) by smtp.gmail.com with ESMTPSA id t15-20020a170906608f00b0077a8fa8ba55sm1468940ejj.210.2022.09.21.10.06.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Sep 2022 10:06:43 -0700 (PDT) From: Dario Binacchi To: linux-kernel@vger.kernel.org Cc: Michael Trimarchi , linux-amarula@amarulasolutions.com, Robin Murphy , Marco Felsch , Dario Binacchi , Sascha Hauer , stable@vger.kernel.org, Fabio Estevam , NXP Linux Team , Pengutronix Kernel Team , Shawn Guo , Vinod Koul , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v6] dmaengine: mxs: use platform_driver_register Date: Wed, 21 Sep 2022 19:05:56 +0200 Message-Id: <20220921170556.1055962-1-dario.binacchi@amarulasolutions.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220921_100647_256439_A3CB7850 X-CRM114-Status: GOOD ( 18.44 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- Changes in v6: - Drop __init annotation. - Drop the "dmaengine: mxs: fix section mismatch" patch. - Update the commit message. - Add Sascha Hauer's Acked-by tag. Changes in v5: - Update the commit message. - Add the patch "dmaengine: mxs: fix section mismatch" to remove the warning raised by this patch. Changes in v4: - Restore __init in front of mxs_dma_probe() definition. - Rename the mxs_dma_driver variable to mxs_dma_driver_probe. - Update the commit message. - Use builtin_platform_driver() instead of module_platform_driver(). Changes in v3: - Restore __init in front of mxs_dma_init() definition. Changes in v2: - Add the tag "Cc: stable@vger.kernel.org" in the sign-off area. drivers/dma/mxs-dma.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c index 994fc4d2aca4..dc147cc2436e 100644 --- a/drivers/dma/mxs-dma.c +++ b/drivers/dma/mxs-dma.c @@ -670,7 +670,7 @@ static enum dma_status mxs_dma_tx_status(struct dma_chan *chan, 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(struct of_phandle_args *dma_spec, 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_driver = { .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); -- 2.32.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel