From patchwork Mon Sep 13 17:39:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Cox X-Patchwork-Id: 178472 Return-path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on void.printf.net X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.9 tests=RCVD_IN_DNSWL_LOW autolearn=disabled version=3.2.5 Envelope-to: chris@printf.net Delivery-date: Mon, 13 Sep 2010 19:24:53 +0100 Received: from lists.laptop.org ([18.85.2.145] helo=mail.laptop.org) by void.printf.net with esmtp (Exim 4.69) (envelope-from ) id 1OvDi1-0000z7-03 for chris@printf.net; Mon, 13 Sep 2010 19:24:53 +0100 Received: by mail.laptop.org (Postfix) id 4538124201; Mon, 13 Sep 2010 14:24:32 -0400 (EDT) Delivered-To: cjb@laptop.org Received: from spam.laptop.org (spam.laptop.org [18.85.46.23]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.laptop.org (Postfix) with ESMTPS id 30605241FA for ; Mon, 13 Sep 2010 14:24:32 -0400 (EDT) X-ASG-Debug-ID: 1284402288-0b74d7910003-zHW3sV Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by spam.laptop.org with ESMTP id 2qaOrLd1PtqZZnhn for ; Mon, 13 Sep 2010 14:24:49 -0400 (EDT) X-Barracuda-Envelope-From: linux-mmc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752833Ab0IMSYq (ORCPT ); Mon, 13 Sep 2010 14:24:46 -0400 Received: from mga02.intel.com ([134.134.136.20]:28933 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752515Ab0IMSYq (ORCPT ); Mon, 13 Sep 2010 14:24:46 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 13 Sep 2010 11:24:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.56,360,1280732400"; d="scan'208";a="656820999" Received: from unknown (HELO localhost.localdomain) ([10.255.14.44]) by orsmga001.jf.intel.com with ESMTP; 13 Sep 2010 11:24:30 -0700 From: Alan Cox X-ASG-Orig-Subj: [PATCH 7/7] sdhci: Tidy up sdhci.c Subject: [PATCH 7/7] sdhci: Tidy up sdhci.c To: linux-mmc@vger.kernel.org, cjb@laptop.org Date: Mon, 13 Sep 2010 18:39:59 +0100 Message-ID: <20100913173958.20345.58843.stgit@localhost.localdomain> In-Reply-To: <20100913172738.20345.61119.stgit@localhost.localdomain> References: <20100913172738.20345.61119.stgit@localhost.localdomain> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Barracuda-Connect: vger.kernel.org[209.132.180.67] X-Barracuda-Start-Time: 1284402289 X-Barracuda-URL: http://18.85.46.23:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at laptop.org X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=5.5 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.40764 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 9d8047c..dcafe13 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1,5 +1,6 @@ /* - * linux/drivers/mmc/host/sdhci.c - Secure Digital Host Controller Interface driver + * linux/drivers/mmc/host/sdhci.c - Secure Digital Host Controller Interface + * driver * * Copyright (C) 2005-2008 Pierre Ossman, All Rights Reserved. * @@ -30,14 +31,14 @@ #define DRIVER_NAME "sdhci" #define DBG(f, x...) \ - pr_debug(DRIVER_NAME " [%s()]: " f, __func__,## 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 -static unsigned int debug_quirks = 0; +static unsigned int debug_quirks; static void sdhci_prepare_data(struct sdhci_host *, struct mmc_data *); static void sdhci_finish_data(struct sdhci_host *); @@ -479,7 +480,8 @@ static int sdhci_adma_table_pre(struct sdhci_host *host, if (offset) { if (data->flags & MMC_DATA_WRITE) { buffer = sdhci_kmap_atomic(sg, &flags); - WARN_ON(((long)buffer & PAGE_MASK) > (PAGE_SIZE - 3)); + WARN_ON(((long)buffer & PAGE_MASK) + > (PAGE_SIZE - 3)); memcpy(align, buffer, offset); sdhci_kunmap_atomic(buffer, &flags); } @@ -587,7 +589,8 @@ static void sdhci_adma_table_post(struct sdhci_host *host, size = 4 - (sg_dma_address(sg) & 0x3); buffer = sdhci_kmap_atomic(sg, &flags); - WARN_ON(((long)buffer & PAGE_MASK) > (PAGE_SIZE - 3)); + WARN_ON(((long)buffer & PAGE_MASK) + > (PAGE_SIZE - 3)); memcpy(buffer, align, size); sdhci_kunmap_atomic(buffer, &flags); @@ -975,7 +978,7 @@ static void sdhci_finish_command(struct sdhci_host *host) if (host->cmd->flags & MMC_RSP_PRESENT) { if (host->cmd->flags & MMC_RSP_136) { /* CRC is stripped so we need to do some shifting. */ - for (i = 0;i < 4;i++) { + for (i = 0; i < 4; i++) { host->cmd->resp[i] = sdhci_readl(host, SDHCI_RESPONSE + (3-i)*4) << 8; if (i != 3) @@ -1019,7 +1022,7 @@ static void sdhci_set_clock(struct sdhci_host *host, unsigned int clock) if (clock == 0) goto out; - for (div = 1;div < 256;div *= 2) { + for (div = 1; div < 256; div *= 2) { if ((host->max_clk / div) <= clock) break; } @@ -1215,7 +1218,7 @@ void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) * signalling timeout and CRC errors even on CMD0. Resetting * it on each ios seems to solve the problem. */ - if(host->quirks & SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS) + if (host->quirks & SDHCI_QUIRK_RESET_CMD_DATA_ON_IOS) sdhci_reset(host, SDHCI_RESET_CMD | SDHCI_RESET_DATA); out: @@ -1302,7 +1305,7 @@ static void sdhci_tasklet_card(unsigned long param) struct sdhci_host *host; unsigned long flags; - host = (struct sdhci_host*)param; + host = (struct sdhci_host *)param; spin_lock_irqsave(&host->lock, flags); @@ -1332,7 +1335,7 @@ static void sdhci_tasklet_finish(unsigned long param) unsigned long flags; struct mmc_request *mrq; - host = (struct sdhci_host*)param; + host = (struct sdhci_host *)param; spin_lock_irqsave(&host->lock, flags); @@ -1385,7 +1388,7 @@ static void sdhci_timeout_timer(unsigned long data) struct sdhci_host *host; unsigned long flags; - host = (struct sdhci_host*)data; + host = (struct sdhci_host *)data; spin_lock_irqsave(&host->lock, flags); @@ -1566,7 +1569,7 @@ static void sdhci_data_irq(struct sdhci_host *host, u32 intmask) static irqreturn_t sdhci_irq(int irq, void *dev_id) { irqreturn_t result; - struct sdhci_host* host = dev_id; + struct sdhci_host *host = dev_id; u32 intmask; int cardint = 0; @@ -1667,7 +1670,6 @@ int sdhci_suspend_host(struct sdhci_host *host, pm_message_t state) return ret; } - EXPORT_SYMBOL_GPL(sdhci_suspend_host); int sdhci_resume_host(struct sdhci_host *host) @@ -1699,7 +1701,6 @@ int sdhci_resume_host(struct sdhci_host *host) return ret; } - EXPORT_SYMBOL_GPL(sdhci_resume_host); #endif /* CONFIG_PM */ @@ -1727,7 +1728,6 @@ struct sdhci_host *sdhci_alloc_host(struct device *dev, return host; } - EXPORT_SYMBOL_GPL(sdhci_alloc_host); int sdhci_add_host(struct sdhci_host *host) @@ -1940,7 +1940,8 @@ int sdhci_add_host(struct sdhci_host *host) /* * Maximum block count. */ - mmc->max_blk_count = (host->quirks & SDHCI_QUIRK_NO_MULTIBLOCK) ? 1 : 65535; + mmc->max_blk_count = (host->quirks & SDHCI_QUIRK_NO_MULTIBLOCK) + ? 1 : 65535; /* * Init tasklets. @@ -1959,7 +1960,8 @@ int sdhci_add_host(struct sdhci_host *host) host->vmmc = regulator_get(mmc_dev(mmc), "vmmc"); if (IS_ERR(host->vmmc)) { - printk(KERN_INFO "%s: no vmmc regulator found\n", mmc_hostname(mmc)); + printk(KERN_INFO "%s: no vmmc regulator found\n", + mmc_hostname(mmc)); host->vmmc = NULL; } else { regulator_enable(host->vmmc); @@ -2008,7 +2010,6 @@ untasklet: return ret; } - EXPORT_SYMBOL_GPL(sdhci_add_host); void sdhci_remove_host(struct sdhci_host *host, int dead) @@ -2060,14 +2061,12 @@ void sdhci_remove_host(struct sdhci_host *host, int dead) host->adma_desc = NULL; host->align_buffer = NULL; } - EXPORT_SYMBOL_GPL(sdhci_remove_host); void sdhci_free_host(struct sdhci_host *host) { mmc_free_host(host->mmc); } - EXPORT_SYMBOL_GPL(sdhci_free_host); /*****************************************************************************\