From patchwork Tue Aug 1 17:35:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 129427 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp2868368vqg; Tue, 1 Aug 2023 11:56:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlGi4sAs/LCEE/Wpyb+94YTwpfdSvEnSWf41sKLfFTDIUcwE9leq4kyQoomgwwPPzjEjIOq+ X-Received: by 2002:a17:906:1d6:b0:973:ff8d:2a46 with SMTP id 22-20020a17090601d600b00973ff8d2a46mr3504631ejj.3.1690916184161; Tue, 01 Aug 2023 11:56:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690916184; cv=none; d=google.com; s=arc-20160816; b=cKt1LZXjP4yxYEzPFmaSD4laVVw7xWx+iUD+fGk2w+m+3OTmBAnyMf+xtj+9z6/IAL BZk4Q2nm3zGg7htsFcwNggUyZWbM0Xiq4M2dBDk6iqgMpJxQ9Je+3Ih7sN28l8xlqpdS GgV5S/I+Zy+ciLu+HbIliLkWgx9hay9hBx9M26hEWv58e8Owm68QTsV4dyxE9Pf0eHgQ yExnUcqBGk+v3za2vjWCtLaYfhQvzr9q13W3QonNNYs/eJT8OB/XDVuUjmpV/VkJ+Qdw 8TmfcLvYVHqfqQMV9XiLUbn6HFDvXVjGtD1lcSEDtFKGaqHCyoLvYiWfRAGB+G/MxT9s cgag== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TBYKzlSrBqkJCEZA7FG895w30+HjQzxC2X3fqEBml8c=; fh=5HI8xClRuvQgfwG5XWQ/y0OxSazXgHJWeupfevDts70=; b=dhu5w7TIY4cqjgBCbdR+VAA2rwW/2czddOP1gAqv5rzM2Xhw7PjZXt0mG0mDoCkbiD f7EekvXvrM7kx/aaVykQvExK9AMD7dRkVcPRH3ns9668wmX7kWJNU7NCS/J18FiZoLjX 9ABWUZZfayOhy5pNb03nHDoVatMA6goxiE6AhSGHbpDzuFOrBB12lMLmOA0ob8iBc0m+ UCwu2T8UrzjC8jangZFtOyj/8zV1trRdip5gxeqJEVrdX5wBGdj6seCO0JY6YgbFz6Tc sXrWRryqV2RnSyM1wYtYxkKsx3OlAfkdn7/kz7/MT+KzbaM/lzQhUVhiAx7cDeekGsNY enIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b="1xK/nDZZ"; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a12-20020a170906684c00b00992a91b422fsi8841081ejs.41.2023.08.01.11.55.59; Tue, 01 Aug 2023 11:56:24 -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=@infradead.org header.s=bombadil.20210309 header.b="1xK/nDZZ"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234234AbjHARgh (ORCPT + 99 others); Tue, 1 Aug 2023 13:36:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233753AbjHARgd (ORCPT ); Tue, 1 Aug 2023 13:36:33 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB1FA10EA; Tue, 1 Aug 2023 10:36:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=TBYKzlSrBqkJCEZA7FG895w30+HjQzxC2X3fqEBml8c=; b=1xK/nDZZ1R8EhDL4BBBQxTBjZE bpv6Sfx9oUYKKZ8Inc/znia9KHx+Zodbgr8BrzaFnDBv18+H1bw43OZmZMM4SoxU5gwevclaBV9yj IAHYf6kbwKZnsJaK8XHYROIRFfGKqbXtezYGspkR2wn8AKkTTRLe+fRvWCKFEsdPazAPUfjLRbd+o M7jg0/j7YRlLpo09Y5vWrW3itfs10lNc9F6Kb+SyrS7sOZUrEet1FNhNi4vLGXxkMKrHth0KToTBc p965o8sftKKd8LiZPCt+weipBBXrEtZX7v/Q8lT0uFHSCZ268TEjmw7ZP0rBDH73tLAs5vqBzBtrQ na0opyMA==; Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qQtHv-002w4Z-1b; Tue, 01 Aug 2023 17:36:19 +0000 From: Christoph Hellwig To: Luis Chamberlain , Greg Kroah-Hartman , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Ulf Hansson , Manuel Lauss , Yangbo Lu , Joshua Kinard Cc: Daniel Vetter , Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org (open list), linux-mmc@vger.kernel.org, netdev@vger.kernel.org, linux-rtc@vger.kernel.org, linux-modules@vger.kernel.org Subject: [PATCH 2/5] mmc: au1xmmc: force non-modular build and remove symbol_get usage Date: Tue, 1 Aug 2023 19:35:41 +0200 Message-Id: <20230801173544.1929519-3-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230801173544.1929519-1-hch@lst.de> References: <20230801173544.1929519-1-hch@lst.de> MIME-Version: 1.0 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=no 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: INBOX X-GMAIL-THRID: 1773054128953956255 X-GMAIL-MSGID: 1773054128953956255 au1xmmc is split somewhat awkwardly into the main mmc subsystem driver, and callbacks in platform_data that sit under arch/mips/ and are always built in. The latter than call mmc_detect_change through symbol_get. Remove the use of symbol_get by requiring the driver to be built in. In the future the interrupt handlers for card insert/eject detection should probably be moved into the main driver, and which point it can be built modular again. Signed-off-by: Christoph Hellwig Acked-by: Manuel Lauss Reviewed-by: Arnd Bergmann Acked-by: Ulf Hansson --- arch/mips/alchemy/devboards/db1000.c | 8 +------- arch/mips/alchemy/devboards/db1200.c | 19 ++----------------- arch/mips/alchemy/devboards/db1300.c | 10 +--------- drivers/mmc/host/Kconfig | 4 ++-- 4 files changed, 6 insertions(+), 35 deletions(-) diff --git a/arch/mips/alchemy/devboards/db1000.c b/arch/mips/alchemy/devboards/db1000.c index 79d66faa84828d..012da042d0a4f7 100644 --- a/arch/mips/alchemy/devboards/db1000.c +++ b/arch/mips/alchemy/devboards/db1000.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -167,12 +166,7 @@ static struct platform_device db1x00_audio_dev = { static irqreturn_t db1100_mmc_cd(int irq, void *ptr) { - void (*mmc_cd)(struct mmc_host *, unsigned long); - /* link against CONFIG_MMC=m */ - mmc_cd = symbol_get(mmc_detect_change); - mmc_cd(ptr, msecs_to_jiffies(500)); - symbol_put(mmc_detect_change); - + mmc_detect_change(ptr, msecs_to_jiffies(500)); return IRQ_HANDLED; } diff --git a/arch/mips/alchemy/devboards/db1200.c b/arch/mips/alchemy/devboards/db1200.c index 1864eb935ca57f..76080c71a2a7b6 100644 --- a/arch/mips/alchemy/devboards/db1200.c +++ b/arch/mips/alchemy/devboards/db1200.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -340,14 +339,7 @@ static irqreturn_t db1200_mmc_cd(int irq, void *ptr) static irqreturn_t db1200_mmc_cdfn(int irq, void *ptr) { - void (*mmc_cd)(struct mmc_host *, unsigned long); - - /* link against CONFIG_MMC=m */ - mmc_cd = symbol_get(mmc_detect_change); - if (mmc_cd) { - mmc_cd(ptr, msecs_to_jiffies(200)); - symbol_put(mmc_detect_change); - } + mmc_detect_change(ptr, msecs_to_jiffies(200)); msleep(100); /* debounce */ if (irq == DB1200_SD0_INSERT_INT) @@ -431,14 +423,7 @@ static irqreturn_t pb1200_mmc1_cd(int irq, void *ptr) static irqreturn_t pb1200_mmc1_cdfn(int irq, void *ptr) { - void (*mmc_cd)(struct mmc_host *, unsigned long); - - /* link against CONFIG_MMC=m */ - mmc_cd = symbol_get(mmc_detect_change); - if (mmc_cd) { - mmc_cd(ptr, msecs_to_jiffies(200)); - symbol_put(mmc_detect_change); - } + mmc_detect_change(ptr, msecs_to_jiffies(200)); msleep(100); /* debounce */ if (irq == PB1200_SD1_INSERT_INT) diff --git a/arch/mips/alchemy/devboards/db1300.c b/arch/mips/alchemy/devboards/db1300.c index e70e529ddd914d..ff61901329c626 100644 --- a/arch/mips/alchemy/devboards/db1300.c +++ b/arch/mips/alchemy/devboards/db1300.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -459,14 +458,7 @@ static irqreturn_t db1300_mmc_cd(int irq, void *ptr) static irqreturn_t db1300_mmc_cdfn(int irq, void *ptr) { - void (*mmc_cd)(struct mmc_host *, unsigned long); - - /* link against CONFIG_MMC=m. We can only be called once MMC core has - * initialized the controller, so symbol_get() should always succeed. - */ - mmc_cd = symbol_get(mmc_detect_change); - mmc_cd(ptr, msecs_to_jiffies(200)); - symbol_put(mmc_detect_change); + mmc_detect_change(ptr, msecs_to_jiffies(200)); msleep(100); /* debounce */ if (irq == DB1300_SD1_INSERT_INT) diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 159a3e9490aed8..f7afd179dd10bf 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -526,11 +526,11 @@ config MMC_ALCOR of Alcor Micro PCI-E card reader config MMC_AU1X - tristate "Alchemy AU1XX0 MMC Card Interface support" + bool "Alchemy AU1XX0 MMC Card Interface support" depends on MIPS_ALCHEMY help This selects the AMD Alchemy(R) Multimedia card interface. - If you have a Alchemy platform with a MMC slot, say Y or M here. + If you have a Alchemy platform with a MMC slot, say Y here. If unsure, say N.