Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp745844rwb; Tue, 29 Nov 2022 05:01:20 -0800 (PST) X-Google-Smtp-Source: AA0mqf4unYWCD7ulWcFFvPUekOOHwW3/IRwprae8OkXVlHYQ2c9DSLTK30ZTp6jav1KKtI9xXbms X-Received: by 2002:a17:902:7fc3:b0:189:4d89:a442 with SMTP id t3-20020a1709027fc300b001894d89a442mr29784098plb.151.1669726875611; Tue, 29 Nov 2022 05:01:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669726875; cv=none; d=google.com; s=arc-20160816; b=epEOUJhFgi1OusLzBtSm72SEtPOy6olPmHUDhXXl9JLKu3lx4TQeuALxyRul0NUayk z+Ld8Iej6FMLug3xyjEC9jSFPNcPz66QiJ00d0BGMErfBfUhDgikxO+Vhl6rXReQ71T1 0we+EUeJ80zQJjXxGX+Uyyv0GmTATt7F0mvnIIxHXKYGklH2jBmef5ajKR2YXJBJqVXc rHBg1GrDs0fqyUXqggjh6VXKUpyPxB6dRKvg/pNvtTjKQsPCHNujobtMosEjG6Z3MLQL GWxXDiI/uPMUvlzxTaayl9KN98Df1zeXLH7RxdT0el47hOsqUtCfWKBC7nIwBi0envd4 DCCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=QgBSalTxeyU/L1VicCBC3Zk4McvknVBPub5NGVaaxho=; b=P1BhqUZrxJfLyDUvutqANcUhw9YCYkan2AtHADeTymXa45J/ZXOZS1HiKTcNN/PBnB 9e8k6vr90+DSPYz/JvoMCWEGjS0jUGDlZdEMX4nCC8U/iDPO4bopRwJ+cDdc8W4bgUz7 Ed2fdww5fIMuo0nQUxy2/ilr5ZIsmtY25pwAvsisis9ku8hJDs2yb7pPgqM2HY5hCd/2 L9rcDsnR6qoU0qikX170Nijkql1tQZPTusFDTGOtmz0Gzhe4PKwtnB3b0lZ3aV9/CuaD w8zoAhwuMIej6tq/vE+3JwiXwVkW4aF/1gKkgcsjdjMoWudE1I62OVX+Rt3A+Y0NZtC5 KHwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Bp+DEBKG; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nl9-20020a17090b384900b00209b6044d31si1738044pjb.51.2022.11.29.05.01.03; Tue, 29 Nov 2022 05:01:15 -0800 (PST) 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=@linaro.org header.s=google header.b=Bp+DEBKG; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234822AbiK2MzX (ORCPT + 84 others); Tue, 29 Nov 2022 07:55:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234854AbiK2MzH (ORCPT ); Tue, 29 Nov 2022 07:55:07 -0500 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AB7C61517 for ; Tue, 29 Nov 2022 04:55:06 -0800 (PST) Received: by mail-pg1-x530.google.com with SMTP id s196so12923864pgs.3 for ; Tue, 29 Nov 2022 04:55:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=QgBSalTxeyU/L1VicCBC3Zk4McvknVBPub5NGVaaxho=; b=Bp+DEBKGs64ElSYn9C9YFF/Rp8hsCLQydOSCcpJ4ejzaw88N30CtZFqxNi4yZeU/SY 9KFoPwSM6jFFBC9iiYTuZQimpFcR6BXa4XNJZWEbEkr5LArJVCoVAGpXKNODGEvI/PVT AJ1yWfAOyNjxNYsSCt/LBxOyDce7sHII0EV33UDfrbhLUMZEChGi2+H5BlG8WC9MWmby 2qhoEwYVUmElxpGgvnRF6bVBwLYO6ICpoHfLQojV4RUajOEUVLigp6++lPN0E60aBkgm ev5uezNidJ5Xo2XAk9zGek3/ZQvKO6aNXzUwajeR8XKrvJhAoxs1ewqXy1KBcBjszxd9 /PNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QgBSalTxeyU/L1VicCBC3Zk4McvknVBPub5NGVaaxho=; b=mqAqp+bh5NCoU+fvICMdqDQykI47l9DxY6VAB0pJloNPJCrQN5WH3nDdmMxqrUZy4+ uH3UGWUd3q+ENaRjKCVtVCXW+mnmK4NzRHHobAv44RZtpmXMdXyA2xKNINlc02IquW6S gpuf24NgZs8mrcGdopWtl5N+39kwkpBNIGkrsQT3RKHfBeMK5uWGXaaj6BWfypxScLte xj46EUn6Icw3FqwaPJnpZm/psI7PatjTx6FSuIjX8u+wJWyh+cQjGmYipN0B6h4TiTNi wa89W9UbAQd2MBurPACk7gIYyAdC8H+GTZchBFqBR3gralX/bSd1ucWxaje3GnpYi68X QvXg== X-Gm-Message-State: ANoB5pncyKgC0ZChEXldhLqLM+xzQmNu06JIpslSSRBxlDFIGeJjJevV ++UrXTHivyIkoysivU073D93/aQwE71IvPBnx2kuuw== X-Received: by 2002:a65:4688:0:b0:477:7aee:a464 with SMTP id h8-20020a654688000000b004777aeea464mr35902018pgr.595.1669726505363; Tue, 29 Nov 2022 04:55:05 -0800 (PST) MIME-Version: 1.0 References: <20221126102520.2824574-1-yebin@huaweicloud.com> In-Reply-To: <20221126102520.2824574-1-yebin@huaweicloud.com> From: Ulf Hansson Date: Tue, 29 Nov 2022 13:54:29 +0100 Message-ID: Subject: Re: [PATCH] mmc: core: refactor debugfs code To: Ye Bin Cc: wsa+renesas@sang-engineering.com, kvalo@kernel.org, adrian.hunter@intel.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, yebin10@huawei.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, 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 On Sat, 26 Nov 2022 at 11:04, Ye Bin wrote: > > From: Ye Bin > > Now, CONFIG_DEBUG_FS is scattered in various functions, to make code > clean centralized processing CONFIG_DEBUG_FS in mmc debugfs module. > > Signed-off-by: Ye Bin Applied for next, thanks! Kind regards Uffe > --- > drivers/mmc/core/bus.c | 4 ---- > drivers/mmc/core/core.h | 15 +++++++++++++++ > drivers/mmc/core/host.c | 4 ---- > 3 files changed, 15 insertions(+), 8 deletions(-) > > diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c > index d8762fa3d5cd..36679f4e9acc 100644 > --- a/drivers/mmc/core/bus.c > +++ b/drivers/mmc/core/bus.c > @@ -359,9 +359,7 @@ int mmc_add_card(struct mmc_card *card) > uhs_bus_speed_mode, type, card->rca); > } > > -#ifdef CONFIG_DEBUG_FS > mmc_add_card_debugfs(card); > -#endif > card->dev.of_node = mmc_of_find_child_device(card->host, 0); > > device_enable_async_suspend(&card->dev); > @@ -383,9 +381,7 @@ void mmc_remove_card(struct mmc_card *card) > { > struct mmc_host *host = card->host; > > -#ifdef CONFIG_DEBUG_FS > mmc_remove_card_debugfs(card); > -#endif > > if (mmc_card_present(card)) { > if (mmc_host_is_spi(card->host)) { > diff --git a/drivers/mmc/core/core.h b/drivers/mmc/core/core.h > index f5f3f623ea49..37091a6589ed 100644 > --- a/drivers/mmc/core/core.h > +++ b/drivers/mmc/core/core.h > @@ -86,11 +86,26 @@ int mmc_attach_sdio(struct mmc_host *host); > extern bool use_spi_crc; > > /* Debugfs information for hosts and cards */ > +#ifdef CONFIG_DEBUG_FS > void mmc_add_host_debugfs(struct mmc_host *host); > void mmc_remove_host_debugfs(struct mmc_host *host); > > void mmc_add_card_debugfs(struct mmc_card *card); > void mmc_remove_card_debugfs(struct mmc_card *card); > +#else > +static inline void mmc_add_host_debugfs(struct mmc_host *host) > +{ > +} > +static inline void mmc_remove_host_debugfs(struct mmc_host *host) > +{ > +} > +static inline void mmc_add_card_debugfs(struct mmc_card *card) > +{ > +} > +static inline void mmc_remove_card_debugfs(struct mmc_card *card) > +{ > +} > +#endif > > int mmc_execute_tuning(struct mmc_card *card); > int mmc_hs200_to_hs400(struct mmc_card *card); > diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c > index 5457c8aeeea1..d17eda753b7e 100644 > --- a/drivers/mmc/core/host.c > +++ b/drivers/mmc/core/host.c > @@ -629,9 +629,7 @@ int mmc_add_host(struct mmc_host *host) > > led_trigger_register_simple(dev_name(&host->class_dev), &host->led); > > -#ifdef CONFIG_DEBUG_FS > mmc_add_host_debugfs(host); > -#endif > > mmc_start_host(host); > return 0; > @@ -651,9 +649,7 @@ void mmc_remove_host(struct mmc_host *host) > { > mmc_stop_host(host); > > -#ifdef CONFIG_DEBUG_FS > mmc_remove_host_debugfs(host); > -#endif > > device_del(&host->class_dev); > > -- > 2.31.1 >