From patchwork Wed Oct 19 08:22:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4654 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp212526wrs; Wed, 19 Oct 2022 02:07:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4YOnTkqleMJ+AeCUqOcBq3n3MpL2KzFVOusl/KnZdOqsQ1uRsQGMe2bsl4qI0pSH1n+KgP X-Received: by 2002:a17:907:7f25:b0:78d:e76a:ef18 with SMTP id qf37-20020a1709077f2500b0078de76aef18mr5777707ejc.378.1666170463040; Wed, 19 Oct 2022 02:07:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666170463; cv=none; d=google.com; s=arc-20160816; b=omqLg1p81HjC8OZFnrKOE0OqnxZHH+Zo8J11lvfXJvKkCv5vDVQafLTcy1XqxnAcan 6petHLE1t1lrPtUffa1SWnp/KNH2GVPjLbtLrM2YKajVzkGCB6olaxR99QpkH87iDXYF RvJuM3z/CcxmlXDE9sth0qBT+0QVry4T1nqw16pMxufmySIxpF8osKMQa8qai0/kWWMW w7oDD2jIQzOyphiecRFv78aVka+JJ+z90EW6SHLankSRotbAwvO1tE8fjJo9pJqXXmAr MhIpZprH6Ad8+emfeXPLjiBvH87QQeY3mdDZouWwYbNEAakvkIX1LO3mbp8VVeuVOp4A NrCQ== 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=vmC94njsEgL/tftie0TRrt6sP3vbMhwS5bS+IoMw8AMPpBvabGPrwrvEGgARD/fuCU RLHCIeRrvrU2mHuKgb2nj8lKkWSRCFsV3my1v+k77AlgcHHpb3iWFCmli+DRbjoIqwSL XpEsq6jb5PSG+kF6t2Gk/7FGSnhpkxIxKxvJszmNptVcl1sG+vhR8rVHIcw1QmiKwi55 3SCESVojBIo7bZtRGHbZHXhoq5GjjRI7G5i1CLkLXO7NMzErtWtCpnQ7JPcM9ernKf34 m19rwSVeaqapsRRIs4Ox9uJNi3uQUbXfqkURX2YwEDFgPaMqugycTejgJZPVGyDPetMs mq1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JQvOgoR1; 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 d1-20020a50ea81000000b00456cc6e1017si12113646edo.109.2022.10.19.02.07.13; Wed, 19 Oct 2022 02:07:43 -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=JQvOgoR1; 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 S232151AbiJSJAd (ORCPT + 99 others); Wed, 19 Oct 2022 05:00:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231904AbiJSI6t (ORCPT ); Wed, 19 Oct 2022 04:58:49 -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 5D55FA02D9; Wed, 19 Oct 2022 01:53:59 -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 E3C95617F2; Wed, 19 Oct 2022 08:42:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0242BC433D6; Wed, 19 Oct 2022 08:41:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666168920; bh=BX8VTQIPLJW77cNwpmkb/Yr53Pz0B1c4Ovk/HIEfias=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JQvOgoR1A3JjBqrZ65KmJNBqx/r5/LeLxzNXz+idzbblTXVXS/R7+9hER6J1H2B76 l22ozCwXsUikc4EMmqkKRk7LujbNH/pV0QP9KLHRd13++/MOKSvuHkRbKOn/53O93C 31A3PiAGtHriMh9wfMT5yisXWGPypuUIxM/D1JBA= 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 6.0 071/862] dmaengine: mxs: use platform_driver_register Date: Wed, 19 Oct 2022 10:22:38 +0200 Message-Id: <20221019083253.064262397@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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?1747106359123150376?= X-GMAIL-MSGID: =?utf-8?q?1747106359123150376?= 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);