All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Walker <dwalker@codeaurora.org>
To: davidb@codeaurora.org
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Daniel Walker <dwalker@codeaurora.org>
Subject: [PATCH 1/5] mmc: msm: consolidate ifdefs for BUSCLK_PWRSAVE
Date: Mon, 20 Dec 2010 15:16:47 -0800	[thread overview]
Message-ID: <1292887011-30006-1-git-send-email-dwalker@codeaurora.org> (raw)

It's cleaner to have ifdef's consolidated in one specific
area. This change pulls adds one ifdef which will swap
out of the function with a stub function if the ifdef is
false.

Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
---
 drivers/mmc/host/msm_sdcc.c |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index 1290d14..d6ac82c 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -61,7 +61,7 @@ static unsigned int msmsdcc_sdioirq;
 #define PIO_SPINMAX 30
 #define CMD_SPINMAX 20
 
-
+#ifdef BUSCLK_PWRSAVE
 static inline void
 msmsdcc_disable_clocks(struct msmsdcc_host *host, int deferr)
 {
@@ -83,6 +83,10 @@ msmsdcc_disable_clocks(struct msmsdcc_host *host, int deferr)
 		}
 	}
 }
+#else
+static inline void
+msmsdcc_disable_clocks(struct msmsdcc_host *host, int deferr) { }
+#endif
 
 static inline int
 msmsdcc_enable_clocks(struct msmsdcc_host *host)
@@ -139,9 +143,8 @@ msmsdcc_request_end(struct msmsdcc_host *host, struct mmc_request *mrq)
 	if (mrq->cmd->error == -ETIMEDOUT)
 		mdelay(5);
 
-#if BUSCLK_PWRSAVE
 	msmsdcc_disable_clocks(host, 1);
-#endif
+
 	/*
 	 * Need to drop the host lock here; mmc_request_done may call
 	 * back into the driver...
@@ -259,9 +262,9 @@ msmsdcc_dma_complete_func(struct msm_dmov_cmd *cmd,
 			mrq->data->bytes_xfered = host->curr.data_xfered;
 
 			spin_unlock_irqrestore(&host->lock, flags);
-#if BUSCLK_PWRSAVE
+
 			msmsdcc_disable_clocks(host, 1);
-#endif
+
 			mmc_request_done(host->mmc, mrq);
 			return;
 		} else
@@ -930,9 +933,9 @@ msmsdcc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		host->pwr = pwr;
 		msmsdcc_writel(host, pwr, MMCIPOWER);
 	}
-#if BUSCLK_PWRSAVE
+
 	msmsdcc_disable_clocks(host, 1);
-#endif
+
 	spin_unlock_irqrestore(&host->lock, flags);
 }
 
@@ -1256,9 +1259,8 @@ msmsdcc_probe(struct platform_device *pdev)
 	if (host->timer.function)
 		pr_info("%s: Polling status mode enabled\n", mmc_hostname(mmc));
 
-#if BUSCLK_PWRSAVE
 	msmsdcc_disable_clocks(host, 1);
-#endif
+
 	return 0;
  cmd_irq_free:
 	free_irq(cmd_irqres->start, host);
@@ -1333,9 +1335,9 @@ msmsdcc_resume(struct platform_device *dev)
 			mmc_resume_host(mmc);
 		if (host->stat_irq)
 			enable_irq(host->stat_irq);
-#if BUSCLK_PWRSAVE
+
 		msmsdcc_disable_clocks(host, 1);
-#endif
+
 	}
 	return 0;
 }
-- 
1.7.0.4

-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

             reply	other threads:[~2010-12-20 23:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-20 23:16 Daniel Walker [this message]
2010-12-20 23:16 ` [PATCH 2/5] mmc: msm: convert int bools to actual bool type Daniel Walker
2010-12-20 23:16 ` [PATCH 3/5] mmc: msm: fix msmsdcc_disable_clocks spinlock protection Daniel Walker
2010-12-20 23:16 ` [PATCH 4/5] mmc: msm: fix non-tab spacing Daniel Walker
2010-12-20 23:16 ` [PATCH 5/5] mmc: msm: fix weird spacing Daniel Walker
2010-12-20 23:35 ` [PATCH 1/5] mmc: msm: consolidate ifdefs for BUSCLK_PWRSAVE David Brown
2010-12-20 23:39   ` Daniel Walker
2010-12-20 23:42     ` David Brown
2010-12-20 23:45       ` Daniel Walker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1292887011-30006-1-git-send-email-dwalker@codeaurora.org \
    --to=dwalker@codeaurora.org \
    --cc=davidb@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.