From patchwork Wed Apr 13 08:55:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 65705 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp2381987qge; Wed, 13 Apr 2016 01:55:10 -0700 (PDT) X-Received: by 10.98.65.215 with SMTP id g84mr11246729pfd.94.1460537710147; Wed, 13 Apr 2016 01:55:10 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m21si185330pfi.150.2016.04.13.01.55.09; Wed, 13 Apr 2016 01:55:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759188AbcDMIzH (ORCPT + 29 others); Wed, 13 Apr 2016 04:55:07 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:49608 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758468AbcDMIzF (ORCPT ); Wed, 13 Apr 2016 04:55:05 -0400 Received: from beagle.diag.org (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id u3D8sV4Y029599; Wed, 13 Apr 2016 17:54:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com u3D8sV4Y029599 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1460537672; bh=UYTqFSI+qWk5N+lyQ2iM32543gFVD6VqBgkBpi70b7o=; h=From:To:Cc:Subject:Date:From; b=u0838uG/TdU3bVsNgzPX2bc5/nDESmz6tFVUwhUo6E6YExd2OCZIWQfRGpH9zAHG9 j7804cnbF+x0P7nGTEM/oK77OONmK8EyaLf2X9UNmwWIU7ZFXEalc+Vh+2fdKb8EuH dOdnrPNLX9x5FbAIN2W30iRYzQf+yMQSW3gytImD1WqTrw1KA2AmkKYBqnEZSzGoU0 FGeyiwTm5by5rAQUCEGNT7cXRglnv729oVsGt/P+SiZpguVRHhSUVDjNyNvP+XkwPw 7OHkbFeMiXT2OIb9JXGQx3TXmL8Bc5zXajTrp1ky+xhOCwITBIqQiqLxEUVfXwxUU5 1a6rGMpyk41Nw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-mmc@vger.kernel.org Cc: Masahiro Yamada , linux-kernel@vger.kernel.org, Adrian Hunter , Ulf Hansson Subject: [PATCH] mmc: sdhci: use IS_REACHABLE(CONFIG_LEDS_CLASS) to enable LED code Date: Wed, 13 Apr 2016 17:55:30 +0900 Message-Id: <1460537730-23430-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org defined(CONFIG_LEDS_CLASS) || (defined(CONFIG_LEDS_CLASS_MODULE) && \ defined(CONFIG_MMC_SDHCI_MODULE)) is equivalent to: defined(CONFIG_LEDS_CLASS) || (defined(CONFIG_LEDS_CLASS_MODULE) && \ defined(MODULE)) and it can also be written shortly as: IS_REACHABLE(CONFIG_LEDS_CLASS) Signed-off-by: Masahiro Yamada --- drivers/mmc/host/sdhci.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) -- 1.9.1 diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 6bd3d17..7a4fbe8 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -38,11 +38,6 @@ #define DBG(f, x...) \ pr_debug(DRIVER_NAME " [%s()]: " f, __func__,## x) -#if defined(CONFIG_LEDS_CLASS) || (defined(CONFIG_LEDS_CLASS_MODULE) && \ - defined(CONFIG_MMC_SDHCI_MODULE)) -#define SDHCI_USE_LEDS_CLASS -#endif - #define MAX_TUNING_LOOP 40 static unsigned int debug_quirks = 0; @@ -270,7 +265,7 @@ static void sdhci_deactivate_led(struct sdhci_host *host) sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL); } -#ifdef SDHCI_USE_LEDS_CLASS +#if IS_REACHABLE(CONFIG_LEDS_CLASS) static void sdhci_led_control(struct led_classdev *led, enum led_brightness brightness) { @@ -1328,7 +1323,7 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq) WARN_ON(host->mrq != NULL); -#ifndef SDHCI_USE_LEDS_CLASS +#if !IS_REACHABLE(CONFIG_LEDS_CLASS) sdhci_activate_led(host); #endif @@ -2214,7 +2209,7 @@ static void sdhci_tasklet_finish(unsigned long param) host->cmd = NULL; host->data = NULL; -#ifndef SDHCI_USE_LEDS_CLASS +#if !IS_REACHABLE(CONFIG_LEDS_CLASS) sdhci_deactivate_led(host); #endif @@ -3360,7 +3355,7 @@ int sdhci_add_host(struct sdhci_host *host) sdhci_dumpregs(host); #endif -#ifdef SDHCI_USE_LEDS_CLASS +#if IS_REACHABLE(CONFIG_LEDS_CLASS) snprintf(host->led_name, sizeof(host->led_name), "%s::", mmc_hostname(mmc)); host->led.name = host->led_name; @@ -3390,7 +3385,7 @@ int sdhci_add_host(struct sdhci_host *host) return 0; -#ifdef SDHCI_USE_LEDS_CLASS +#if IS_REACHABLE(CONFIG_LEDS_CLASS) reset: sdhci_do_reset(host, SDHCI_RESET_ALL); sdhci_writel(host, 0, SDHCI_INT_ENABLE); @@ -3430,7 +3425,7 @@ void sdhci_remove_host(struct sdhci_host *host, int dead) mmc_remove_host(mmc); -#ifdef SDHCI_USE_LEDS_CLASS +#if IS_REACHABLE(CONFIG_LEDS_CLASS) led_classdev_unregister(&host->led); #endif