The patch titled mmc-driver-for-ti-flashmedia-card-reader-source-tidy has been added to the -mm tree. Its filename is mmc-driver-for-ti-flashmedia-card-reader-source-tidy.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: mmc-driver-for-ti-flashmedia-card-reader-source-tidy From: Andrew Morton <akpm@xxxxxxxx> - casts of void* - 80-column fixes Cc: Alex Dubov <oakad@xxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/misc/tifm_7xx1.c | 67 +++++++----- drivers/misc/tifm_core.c | 25 ++-- drivers/mmc/tifm_sd.c | 202 +++++++++++++++++++++++-------------- 3 files changed, 181 insertions(+), 113 deletions(-) diff -puN drivers/misc/tifm_7xx1.c~mmc-driver-for-ti-flashmedia-card-reader-source-tidy drivers/misc/tifm_7xx1.c --- a/drivers/misc/tifm_7xx1.c~mmc-driver-for-ti-flashmedia-card-reader-source-tidy +++ a/drivers/misc/tifm_7xx1.c @@ -34,7 +34,7 @@ static void tifm_7xx1_eject(struct tifm_ static void tifm_7xx1_remove_media(void *adapter) { - struct tifm_adapter *fm = (struct tifm_adapter*)adapter; + struct tifm_adapter *fm = adapter; unsigned long flags; int cnt; struct tifm_dev *sock; @@ -68,8 +68,7 @@ static void tifm_7xx1_remove_media(void static irqreturn_t tifm_7xx1_isr(int irq, void *dev_id, struct pt_regs *regs) { - struct tifm_adapter *fm = (struct tifm_adapter*)dev_id; - + struct tifm_adapter *fm = dev_id; unsigned int irq_status; unsigned int sock_irq_status, cnt; @@ -84,14 +83,15 @@ static irqreturn_t tifm_7xx1_isr(int irq writel(TIFM_IRQ_ENABLE, fm->addr + FM_CLEAR_INTERRUPT_ENABLE); for (cnt = 0; cnt < fm->max_sockets; cnt++) { - sock_irq_status = (irq_status >> cnt) - & (TIFM_IRQ_FIFOMASK | TIFM_IRQ_CARDMASK); + sock_irq_status = (irq_status >> cnt) & + (TIFM_IRQ_FIFOMASK | TIFM_IRQ_CARDMASK); if (fm->sockets[cnt]) { - if (sock_irq_status && fm->sockets[cnt]->signal_irq) - sock_irq_status = fm->sockets[cnt] - ->signal_irq(fm->sockets[cnt], - sock_irq_status); + if (sock_irq_status && + fm->sockets[cnt]->signal_irq) + sock_irq_status = fm->sockets[cnt]-> + signal_irq(fm->sockets[cnt], + sock_irq_status); if (irq_status & (1 << cnt)) fm->remove_mask |= 1 << cnt; @@ -104,9 +104,10 @@ static irqreturn_t tifm_7xx1_isr(int irq writel(irq_status, fm->addr + FM_INTERRUPT_STATUS); if (!fm->inhibit_new_cards) { - if (!fm->remove_mask && !fm->insert_mask) - writel(TIFM_IRQ_ENABLE, fm->addr + FM_SET_INTERRUPT_ENABLE); - else { + if (!fm->remove_mask && !fm->insert_mask) { + writel(TIFM_IRQ_ENABLE, + fm->addr + FM_SET_INTERRUPT_ENABLE); + } else { queue_work(fm->wq, &fm->media_remover); queue_work(fm->wq, &fm->media_inserter); } @@ -124,7 +125,8 @@ static tifm_media_id tifm_7xx1_toggle_so writel(0x0e00, sock_addr + SOCK_CONTROL); for (cnt = 0; cnt < 100; cnt++) { - if (!(TIFM_SOCK_STATE_POWERED & readl(sock_addr + SOCK_PRESENT_STATE))) + if (!(TIFM_SOCK_STATE_POWERED & + readl(sock_addr + SOCK_PRESENT_STATE))) break; msleep(10); } @@ -137,16 +139,18 @@ static tifm_media_id tifm_7xx1_toggle_so writel((s_state & 7) | 0x0c00, sock_addr + SOCK_CONTROL); } else { // SmartMedia cards need extra 40 msec - if (1 == ((readl(sock_addr + SOCK_PRESENT_STATE) >> 4) & 7)) + if (((readl(sock_addr + SOCK_PRESENT_STATE) >> 4) & 7) == 1) msleep(40); writel(readl(sock_addr + SOCK_CONTROL) | TIFM_CTRL_LED, sock_addr + SOCK_CONTROL); msleep(10); - writel((s_state & 0x7) | 0x0c00 | TIFM_CTRL_LED, sock_addr + SOCK_CONTROL); + writel((s_state & 0x7) | 0x0c00 | TIFM_CTRL_LED, + sock_addr + SOCK_CONTROL); } for (cnt = 0; cnt < 100; cnt++) { - if ((TIFM_SOCK_STATE_POWERED & readl(sock_addr + SOCK_PRESENT_STATE))) + if ((TIFM_SOCK_STATE_POWERED & + readl(sock_addr + SOCK_PRESENT_STATE))) break; msleep(10); } @@ -165,7 +169,7 @@ inline static char *tifm_7xx1_sock_addr( static void tifm_7xx1_insert_media(void *adapter) { - struct tifm_adapter *fm = (struct tifm_adapter*)adapter; + struct tifm_adapter *fm = adapter; unsigned long flags; tifm_media_id media_id; char *card_name = "xx"; @@ -195,7 +199,8 @@ static void tifm_7xx1_insert_media(void ok_to_register = 0; new_sock = tifm_alloc_device(fm, cnt); if (new_sock) { - new_sock->addr = tifm_7xx1_sock_addr(fm->addr, cnt); + new_sock->addr = tifm_7xx1_sock_addr(fm->addr, + cnt); new_sock->media_id = media_id; switch (media_id) { case 1: @@ -211,19 +216,22 @@ static void tifm_7xx1_insert_media(void break; } snprintf(new_sock->dev.bus_id, BUS_ID_SIZE, - "tifm_%s%u:%u", card_name, fm->id, cnt); + "tifm_%s%u:%u", card_name, fm->id, cnt); printk(KERN_INFO DRIVER_NAME - ": %s card detected in socket %d\n", card_name, cnt); + ": %s card detected in socket %d\n", + card_name, cnt); spin_lock_irqsave(&fm->lock, flags); if (!fm->sockets[cnt]) { fm->sockets[cnt] = new_sock; ok_to_register = 1; } spin_unlock_irqrestore(&fm->lock, flags); - if (!ok_to_register || device_register(&new_sock->dev)) { + if (!ok_to_register || + device_register(&new_sock->dev)) { spin_lock_irqsave(&fm->lock, flags); fm->sockets[cnt] = 0; - spin_unlock_irqrestore(&fm->lock, flags); + spin_unlock_irqrestore(&fm->lock, + flags); tifm_free_device(&new_sock->dev); } } @@ -273,13 +281,15 @@ static int tifm_7xx1_resume(struct pci_d fm->inhibit_new_cards = 0; writel(TIFM_IRQ_SETALL, fm->addr + FM_INTERRUPT_STATUS); writel(TIFM_IRQ_SETALL, fm->addr + FM_CLEAR_INTERRUPT_ENABLE); - writel(TIFM_IRQ_ENABLE | TIFM_IRQ_SETALLSOCK, fm->addr + FM_SET_INTERRUPT_ENABLE); + writel(TIFM_IRQ_ENABLE | TIFM_IRQ_SETALLSOCK, + fm->addr + FM_SET_INTERRUPT_ENABLE); fm->insert_mask = 0xf; spin_unlock_irqrestore(&fm->lock, flags); return 0; } -static int tifm_7xx1_probe(struct pci_dev *dev, const struct pci_device_id *dev_id) +static int tifm_7xx1_probe(struct pci_dev *dev, + const struct pci_device_id *dev_id) { struct tifm_adapter *fm; int pci_dev_busy = 0; @@ -311,7 +321,8 @@ static int tifm_7xx1_probe(struct pci_de fm->dev = &dev->dev; fm->max_sockets = (dev->device == 0x803B) ? 2 : 4; - fm->sockets = kzalloc(sizeof(struct tifm_dev*) * fm->max_sockets, GFP_KERNEL); + fm->sockets = kzalloc(sizeof(struct tifm_dev*) * fm->max_sockets, + GFP_KERNEL); if (!fm->sockets) goto err_out_free; @@ -320,7 +331,8 @@ static int tifm_7xx1_probe(struct pci_de fm->eject = tifm_7xx1_eject; pci_set_drvdata(dev, fm); - fm->addr = ioremap(pci_resource_start(dev, 0), pci_resource_len(dev, 0)); + fm->addr = ioremap(pci_resource_start(dev, 0), + pci_resource_len(dev, 0)); if (!fm->addr) goto err_out_free; @@ -333,7 +345,8 @@ static int tifm_7xx1_probe(struct pci_de goto err_out_irq; writel(TIFM_IRQ_SETALL, fm->addr + FM_CLEAR_INTERRUPT_ENABLE); - writel(TIFM_IRQ_ENABLE | TIFM_IRQ_SETALLSOCK, fm->addr + FM_SET_INTERRUPT_ENABLE); + writel(TIFM_IRQ_ENABLE | TIFM_IRQ_SETALLSOCK, + fm->addr + FM_SET_INTERRUPT_ENABLE); fm->insert_mask = 0xf; diff -puN drivers/misc/tifm_core.c~mmc-driver-for-ti-flashmedia-card-reader-source-tidy drivers/misc/tifm_core.c --- a/drivers/misc/tifm_core.c~mmc-driver-for-ti-flashmedia-card-reader-source-tidy +++ a/drivers/misc/tifm_core.c @@ -19,21 +19,23 @@ static DEFINE_IDR(tifm_adapter_idr); static DEFINE_SPINLOCK(tifm_adapter_lock); -static tifm_media_id *tifm_device_match(tifm_media_id *ids, struct tifm_dev *dev) +static tifm_media_id *tifm_device_match(tifm_media_id *ids, + struct tifm_dev *dev) { while (*ids) { if (dev->media_id == *ids) return ids; ids++; } - return 0; + return NULL; } static int tifm_match(struct device *dev, struct device_driver *drv) { struct tifm_dev *fm_dev = container_of(dev, struct tifm_dev, dev); - struct tifm_driver *fm_drv = container_of(drv, struct tifm_driver, driver); + struct tifm_driver *fm_drv; + fm_drv = container_of(drv, struct tifm_driver, driver); if (!fm_drv->id_table) return -EINVAL; if (tifm_device_match(fm_drv->id_table, fm_dev)) @@ -52,7 +54,7 @@ static int tifm_uevent(struct device *de if (!dev || !(fm_dev = container_of(dev, struct tifm_dev, dev))) return -ENODEV; if (add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length, - "TIFM_CARD_TYPE=%s", card_type_name[fm_dev->media_id])) + "TIFM_CARD_TYPE=%s", card_type_name[fm_dev->media_id])) return -ENOMEM; return 0; @@ -68,8 +70,7 @@ static void tifm_free(struct class_devic { struct tifm_adapter *fm = container_of(cdev, struct tifm_adapter, cdev); - if (fm->sockets) - kfree(fm->sockets); + kfree(fm->sockets); if (fm->wq) destroy_workqueue(fm->wq); kfree(fm); @@ -82,8 +83,9 @@ static struct class tifm_adapter_class = struct tifm_adapter *tifm_alloc_adapter(void) { - struct tifm_adapter *fm = kzalloc(sizeof(struct tifm_adapter), GFP_KERNEL); + struct tifm_adapter *fm; + fm = kzalloc(sizeof(struct tifm_adapter), GFP_KERNEL); if (fm) { fm->cdev.class = &tifm_adapter_class; spin_lock_init(&fm->lock); @@ -136,7 +138,6 @@ void tifm_remove_adapter(struct tifm_ada } EXPORT_SYMBOL(tifm_remove_adapter); - void tifm_free_device(struct device *dev) { struct tifm_dev *fm_dev = container_of(dev, struct tifm_dev, dev); @@ -168,7 +169,7 @@ EXPORT_SYMBOL(tifm_alloc_device); void tifm_eject(struct tifm_dev *sock) { - struct tifm_adapter *fm = (struct tifm_adapter*)dev_get_drvdata(sock->dev.parent); + struct tifm_adapter *fm = dev_get_drvdata(sock->dev.parent); fm->eject(fm, sock); } EXPORT_SYMBOL(tifm_eject); @@ -189,11 +190,13 @@ EXPORT_SYMBOL(tifm_unmap_sg); static int tifm_device_probe(struct device *dev) { - struct tifm_driver *drv = container_of(dev->driver, struct tifm_driver, driver); - struct tifm_dev *fm_dev = container_of(dev, struct tifm_dev, dev); + struct tifm_driver *drv; + struct tifm_dev *fm_dev; int rc = 0; const tifm_media_id *id; + drv = container_of(dev->driver, struct tifm_driver, driver); + fm_dev = container_of(dev, struct tifm_dev, dev); get_device(dev); if (!fm_dev->drv && drv->probe && drv->id_table) { rc = -ENODEV; diff -puN drivers/mmc/tifm_sd.c~mmc-driver-for-ti-flashmedia-card-reader-source-tidy drivers/mmc/tifm_sd.c --- a/drivers/mmc/tifm_sd.c~mmc-driver-for-ti-flashmedia-card-reader-source-tidy +++ a/drivers/mmc/tifm_sd.c @@ -120,27 +120,32 @@ static int tifm_sd_transfer_data(struct while (host->buffer_size > host->buffer_pos) { t_val = readl(sock->addr + SOCK_MMCSD_DATA); host->buffer[host->buffer_pos++] = t_val & 0xff; - host->buffer[host->buffer_pos++] = (t_val >> 8) & 0xff; + host->buffer[host->buffer_pos++] = + (t_val >> 8) & 0xff; } } return 1; } else if (host->buffer) { - if ((cmd->data->flags & MMC_DATA_READ) && (host_status & TIFM_MMCSD_AF)) { + if ((cmd->data->flags & MMC_DATA_READ) && + (host_status & TIFM_MMCSD_AF)) { for (cnt = 0; cnt < TIFM_MMCSD_FIFO_SIZE; cnt++) { t_val = readl(sock->addr + SOCK_MMCSD_DATA); if (host->buffer_size > host->buffer_pos) { - host->buffer[host->buffer_pos++] = t_val & 0xff; - host->buffer[host->buffer_pos++] = (t_val >> 8) & 0xff; + host->buffer[host->buffer_pos++] = + t_val & 0xff; + host->buffer[host->buffer_pos++] = + (t_val >> 8) & 0xff; } } } else if ((cmd->data->flags & MMC_DATA_WRITE) && (host_status & TIFM_MMCSD_AE)) { - for(cnt = 0; cnt < TIFM_MMCSD_FIFO_SIZE; cnt++) { + for (cnt = 0; cnt < TIFM_MMCSD_FIFO_SIZE; cnt++) { if (host->buffer_size > host->buffer_pos) { t_val = host->buffer[host->buffer_pos++] & 0x00ff; t_val |= ((host->buffer[host->buffer_pos++]) << 8) & 0xff00; - writel(t_val, sock->addr + SOCK_MMCSD_DATA); + writel(t_val, + sock->addr + SOCK_MMCSD_DATA); } } } @@ -196,13 +201,14 @@ static unsigned int tifm_sd_op_flags(str static void tifm_sd_exec(struct tifm_sd *host, struct mmc_command *cmd) { struct tifm_dev *sock = host->dev; - unsigned int cmd_mask = tifm_sd_op_flags(cmd) | (host->flags & OPENDRAIN); + unsigned int cmd_mask = tifm_sd_op_flags(cmd) | + (host->flags & OPENDRAIN); if (cmd->data && (cmd->data->flags & MMC_DATA_READ)) cmd_mask |= TIFM_MMCSD_READ; - dev_dbg(&sock->dev, "executing opcode 0x%x, arg: 0x%x, mask: 0x%x\n", cmd->opcode, - cmd->arg, cmd_mask); + dev_dbg(&sock->dev, "executing opcode 0x%x, arg: 0x%x, mask: 0x%x\n", + cmd->opcode, cmd->arg, cmd_mask); writel((cmd->arg >> 16) & 0xffff, sock->addr + SOCK_MMCSD_ARG_HIGH); writel(cmd->arg & 0xffff, sock->addr + SOCK_MMCSD_ARG_LOW); @@ -246,7 +252,8 @@ change_state: if (cmd->data->flags & MMC_DATA_WRITE) { host->state = CARD; } else { - host->state = host->buffer ? READY : FIFO; + host->state = + host->buffer ? READY : FIFO; } goto change_state; } @@ -286,11 +293,13 @@ change_state: return; } - queue_delayed_work(sock->wq, &host->abort_handler, host->timeout_jiffies); + queue_delayed_work(sock->wq, &host->abort_handler, + host->timeout_jiffies); } /* Called from interrupt handler */ -static unsigned int tifm_sd_signal_irq(struct tifm_dev *sock, unsigned int sock_irq_status) +static unsigned int tifm_sd_signal_irq(struct tifm_dev *sock, + unsigned int sock_irq_status) { struct tifm_sd *host; unsigned int host_status = 0, fifo_status = 0; @@ -319,9 +328,11 @@ static unsigned int tifm_sd_signal_irq(s if (host_status & TIFM_MMCSD_ERRMASK) { if (host_status & TIFM_MMCSD_CERR) error_code = MMC_ERR_FAILED; - else if (host_status & (TIFM_MMCSD_CTO | TIFM_MMCSD_DTO)) + else if (host_status & + (TIFM_MMCSD_CTO | TIFM_MMCSD_DTO)) error_code = MMC_ERR_TIMEOUT; - else if (host_status & (TIFM_MMCSD_CCRC | TIFM_MMCSD_DCRC)) + else if (host_status & + (TIFM_MMCSD_CCRC | TIFM_MMCSD_DCRC)) error_code = MMC_ERR_BADCRC; writel(TIFM_FIFO_INT_SETALL, @@ -334,8 +345,9 @@ static unsigned int tifm_sd_signal_irq(s } else if(host->state == BRS) { host->req->cmd->error = error_code; tifm_sd_exec(host, host->req->stop); - queue_delayed_work(sock->wq, &host->abort_handler, - host->timeout_jiffies); + queue_delayed_work(sock->wq, + &host->abort_handler, + host->timeout_jiffies); host->state = SCMD; goto done; } else { @@ -349,7 +361,8 @@ static unsigned int tifm_sd_signal_irq(s if (host_status & TIFM_MMCSD_CB) host->flags |= CARD_BUSY; - if ((host_status & TIFM_MMCSD_EOFB) && (host->flags & CARD_BUSY)) { + if ((host_status & TIFM_MMCSD_EOFB) && + (host->flags & CARD_BUSY)) { host->written_blocks++; host->flags &= ~CARD_BUSY; } @@ -358,7 +371,8 @@ static unsigned int tifm_sd_signal_irq(s if (host->req) tifm_sd_process_cmd(sock, host, host_status); done: - dev_dbg(&sock->dev, "host_status %x, fifo_status %x\n", host_status, fifo_status); + dev_dbg(&sock->dev, "host_status %x, fifo_status %x\n", + host_status, fifo_status); spin_unlock(&sock->lock); return sock_irq_status; } @@ -370,7 +384,8 @@ static void tifm_sd_prepare_data(struct /* DMA style IO */ - writel(TIFM_FIFO_INT_SETALL, sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR); + writel(TIFM_FIFO_INT_SETALL, + sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR); writel(cmd->data->blksz_bits - 2, sock->addr + SOCK_FIFO_PAGE_SIZE); writel(TIFM_FIFO_ENABLE, sock->addr + SOCK_FIFO_CONTROL); writel(TIFM_FIFO_INTMASK, sock->addr + SOCK_DMA_FIFO_INT_ENABLE_SET); @@ -380,18 +395,21 @@ static void tifm_sd_prepare_data(struct writel(sg_dma_address(cmd->data->sg), sock->addr + SOCK_DMA_ADDRESS); writel(cmd->data->blocks - 1, sock->addr + SOCK_MMCSD_NUM_BLOCKS); - writel((1 << cmd->data->blksz_bits) - 1, sock->addr + SOCK_MMCSD_BLOCK_LEN); + writel((1 << cmd->data->blksz_bits) - 1, + sock->addr + SOCK_MMCSD_BLOCK_LEN); if (cmd->data->flags & MMC_DATA_WRITE) { writel(TIFM_MMCSD_TXDE, sock->addr + SOCK_MMCSD_BUFFER_CONFIG); - writel(dest_cnt | TIFM_DMA_TX | TIFM_DMA_EN, sock->addr + SOCK_DMA_CONTROL); + writel(dest_cnt | TIFM_DMA_TX | TIFM_DMA_EN, + sock->addr + SOCK_DMA_CONTROL); } else { writel(TIFM_MMCSD_RXDE, sock->addr + SOCK_MMCSD_BUFFER_CONFIG); writel(dest_cnt | TIFM_DMA_EN, sock->addr + SOCK_DMA_CONTROL); } } -static void tifm_sd_set_data_timeout(struct tifm_sd *host, struct mmc_data *data) +static void tifm_sd_set_data_timeout(struct tifm_sd *host, + struct mmc_data *data) { struct tifm_dev *sock = host->dev; unsigned int data_timeout = data->timeout_clks; @@ -399,23 +417,26 @@ static void tifm_sd_set_data_timeout(str if (fixed_timeout) return; - data_timeout += data->timeout_ns / ((1000000000 / host->clk_freq) * host->clk_div); + data_timeout += data->timeout_ns / + ((1000000000 / host->clk_freq) * host->clk_div); data_timeout *= 10; // call it fudge factor for now if (data_timeout < 0xffff) { - writel((~TIFM_MMCSD_DPE) & readl(sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG), + writel((~TIFM_MMCSD_DPE) & + readl(sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG), sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG); writel(data_timeout, sock->addr + SOCK_MMCSD_DATA_TO); } else { - writel(TIFM_MMCSD_DPE | readl(sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG), - sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG); + writel(TIFM_MMCSD_DPE | + readl(sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG), + sock->addr + SOCK_MMCSD_SDIO_MODE_CONFIG); data_timeout = (data_timeout >> 10) + 1; - if(data_timeout > 0xffff) data_timeout = 0; // set to unlimited + if(data_timeout > 0xffff) + data_timeout = 0; /* set to unlimited */ writel(data_timeout, sock->addr + SOCK_MMCSD_DATA_TO); } } - static void tifm_sd_request(struct mmc_host *mmc, struct mmc_request *mrq) { struct tifm_sd *host = mmc_priv(mmc); @@ -443,7 +464,8 @@ static void tifm_sd_request(struct mmc_h mrq->cmd->flags & MMC_DATA_WRITE ? PCI_DMA_TODEVICE : PCI_DMA_FROMDEVICE); if (sg_count != 1) { - printk(KERN_ERR DRIVER_NAME ": scatterlist map failed\n"); + printk(KERN_ERR DRIVER_NAME + ": scatterlist map failed\n"); spin_unlock_irqrestore(&sock->lock, flags); goto err_out; } @@ -455,8 +477,10 @@ static void tifm_sd_request(struct mmc_h host->req = mrq; host->state = CMD; - queue_delayed_work(sock->wq, &host->abort_handler, host->timeout_jiffies); - writel(TIFM_CTRL_LED | readl(sock->addr + SOCK_CONTROL), sock->addr + SOCK_CONTROL); + queue_delayed_work(sock->wq, &host->abort_handler, + host->timeout_jiffies); + writel(TIFM_CTRL_LED | readl(sock->addr + SOCK_CONTROL), + sock->addr + SOCK_CONTROL); tifm_sd_exec(host, mrq->cmd); spin_unlock_irqrestore(&sock->lock, flags); return; @@ -473,7 +497,7 @@ err_out: static void tifm_sd_end_cmd(void *data) { - struct tifm_sd *host = (struct tifm_sd*)data; + struct tifm_sd *host = data; struct tifm_dev *sock = host->dev; struct mmc_host *mmc = tifm_get_drvdata(sock); struct mmc_request *mrq; @@ -495,20 +519,22 @@ static void tifm_sd_end_cmd(void *data) r_data = mrq->cmd->data; if (r_data) { if (r_data->flags & MMC_DATA_WRITE) { - r_data->bytes_xfered = host->written_blocks << r_data->blksz_bits; + r_data->bytes_xfered = host->written_blocks << + r_data->blksz_bits; } else { - r_data->bytes_xfered = r_data->blocks - - readl(sock->addr + SOCK_MMCSD_NUM_BLOCKS) - 1; + r_data->bytes_xfered = r_data->blocks - + readl(sock->addr + SOCK_MMCSD_NUM_BLOCKS) - 1; r_data->bytes_xfered <<= r_data->blksz_bits; - r_data->bytes_xfered += (1 << r_data->blksz_bits) - - readl(sock->addr + SOCK_MMCSD_BLOCK_LEN) + 1; + r_data->bytes_xfered += (1 << r_data->blksz_bits) - + readl(sock->addr + SOCK_MMCSD_BLOCK_LEN) + 1; } tifm_unmap_sg(sock, r_data->sg, r_data->sg_len, (r_data->flags & MMC_DATA_WRITE) ? PCI_DMA_TODEVICE : PCI_DMA_FROMDEVICE); } - writel((~TIFM_CTRL_LED) & readl(sock->addr + SOCK_CONTROL), sock->addr + SOCK_CONTROL); + writel((~TIFM_CTRL_LED) & readl(sock->addr + SOCK_CONTROL), + sock->addr + SOCK_CONTROL); spin_unlock_irqrestore(&sock->lock, flags); mmc_request_done(mmc, mrq); @@ -546,24 +572,30 @@ static void tifm_sd_request_nodma(struct tifm_sd_set_data_timeout(host, r_data); host->buffer = t_buffer + r_data->sg->offset; - host->buffer_size = mrq->cmd->data->blocks << mrq->cmd->data->blksz_bits; + host->buffer_size = mrq->cmd->data->blocks << + mrq->cmd->data->blksz_bits; - writel(TIFM_MMCSD_BUFINT | readl(sock->addr + SOCK_MMCSD_INT_ENABLE), + writel(TIFM_MMCSD_BUFINT | + readl(sock->addr + SOCK_MMCSD_INT_ENABLE), sock->addr + SOCK_MMCSD_INT_ENABLE); - writel(((TIFM_MMCSD_FIFO_SIZE - 1) << 8) | (TIFM_MMCSD_FIFO_SIZE - 1), + writel(((TIFM_MMCSD_FIFO_SIZE - 1) << 8) | + (TIFM_MMCSD_FIFO_SIZE - 1), sock->addr + SOCK_MMCSD_BUFFER_CONFIG); host->written_blocks = 0; host->flags &= ~CARD_BUSY; host->buffer_pos = 0; writel(r_data->blocks - 1, sock->addr + SOCK_MMCSD_NUM_BLOCKS); - writel((1 << r_data->blksz_bits) - 1, sock->addr + SOCK_MMCSD_BLOCK_LEN); + writel((1 << r_data->blksz_bits) - 1, + sock->addr + SOCK_MMCSD_BLOCK_LEN); } host->req = mrq; host->state = CMD; - queue_delayed_work(sock->wq, &host->abort_handler, host->timeout_jiffies); - writel(TIFM_CTRL_LED | readl(sock->addr + SOCK_CONTROL), sock->addr + SOCK_CONTROL); + queue_delayed_work(sock->wq, &host->abort_handler, + host->timeout_jiffies); + writel(TIFM_CTRL_LED | readl(sock->addr + SOCK_CONTROL), + sock->addr + SOCK_CONTROL); tifm_sd_exec(host, mrq->cmd); spin_unlock_irqrestore(&sock->lock, flags); return; @@ -599,24 +631,27 @@ static void tifm_sd_end_cmd_nodma(void * r_data = mrq->cmd->data; if (r_data) { - writel((~TIFM_MMCSD_BUFINT) & readl(sock->addr + SOCK_MMCSD_INT_ENABLE), - sock->addr + SOCK_MMCSD_INT_ENABLE); + writel((~TIFM_MMCSD_BUFINT) & + readl(sock->addr + SOCK_MMCSD_INT_ENABLE), + sock->addr + SOCK_MMCSD_INT_ENABLE); if (r_data->flags & MMC_DATA_WRITE) { - r_data->bytes_xfered = host->written_blocks << r_data->blksz_bits; + r_data->bytes_xfered = host->written_blocks << + r_data->blksz_bits; } else { - r_data->bytes_xfered = r_data->blocks - - readl(sock->addr + SOCK_MMCSD_NUM_BLOCKS) - 1; + r_data->bytes_xfered = r_data->blocks - + readl(sock->addr + SOCK_MMCSD_NUM_BLOCKS) - 1; r_data->bytes_xfered <<= r_data->blksz_bits; - r_data->bytes_xfered += (1 << r_data->blksz_bits) - - readl(sock->addr + SOCK_MMCSD_BLOCK_LEN) + 1; + r_data->bytes_xfered += (1 << r_data->blksz_bits) - + readl(sock->addr + SOCK_MMCSD_BLOCK_LEN) + 1; } host->buffer = 0; host->buffer_pos = 0; host->buffer_size = 0; } - writel((~TIFM_CTRL_LED) & readl(sock->addr + SOCK_CONTROL), sock->addr + SOCK_CONTROL); + writel((~TIFM_CTRL_LED) & readl(sock->addr + SOCK_CONTROL), + sock->addr + SOCK_CONTROL); spin_unlock_irqrestore(&sock->lock, flags); @@ -628,7 +663,8 @@ static void tifm_sd_end_cmd_nodma(void * static void tifm_sd_abort(void *data) { - printk(KERN_ERR DRIVER_NAME ": card failed to respond for a long period of time"); + printk(KERN_ERR DRIVER_NAME + ": card failed to respond for a long period of time"); tifm_eject(((struct tifm_sd*)data)->dev); } @@ -647,8 +683,9 @@ static void tifm_sd_ios(struct mmc_host writel(TIFM_MMCSD_4BBUS | readl(sock->addr + SOCK_MMCSD_CONFIG), sock->addr + SOCK_MMCSD_CONFIG); } else { - writel((~TIFM_MMCSD_4BBUS) & readl(sock->addr + SOCK_MMCSD_CONFIG), - sock->addr + SOCK_MMCSD_CONFIG); + writel((~TIFM_MMCSD_4BBUS) & + readl(sock->addr + SOCK_MMCSD_CONFIG), + sock->addr + SOCK_MMCSD_CONFIG); } if (ios->clock) { @@ -667,20 +704,23 @@ static void tifm_sd_ios(struct mmc_host if ((20000000 / clk_div1) > (24000000 / clk_div2)) { host->clk_freq = 20000000; host->clk_div = clk_div1; - writel((~TIFM_CTRL_FAST_CLK) & readl(sock->addr + SOCK_CONTROL), - sock->addr + SOCK_CONTROL); + writel((~TIFM_CTRL_FAST_CLK) & + readl(sock->addr + SOCK_CONTROL), + sock->addr + SOCK_CONTROL); } else { host->clk_freq = 24000000; host->clk_div = clk_div2; - writel(TIFM_CTRL_FAST_CLK | readl(sock->addr + SOCK_CONTROL), - sock->addr + SOCK_CONTROL); + writel(TIFM_CTRL_FAST_CLK | + readl(sock->addr + SOCK_CONTROL), + sock->addr + SOCK_CONTROL); } } else { host->clk_div = 0; } host->clk_div &= TIFM_MMCSD_CLKMASK; - writel(host->clk_div | ((~TIFM_MMCSD_CLKMASK) & readl(sock->addr + SOCK_MMCSD_CONFIG)), - sock->addr + SOCK_MMCSD_CONFIG); + writel(host->clk_div | ((~TIFM_MMCSD_CLKMASK) & + readl(sock->addr + SOCK_MMCSD_CONFIG)), + sock->addr + SOCK_MMCSD_CONFIG); if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN) host->flags |= OPENDRAIN; @@ -690,7 +730,8 @@ static void tifm_sd_ios(struct mmc_host /* chip_select : maybe later */ //vdd //power is set before probe / after remove - //I believe, power_off when already marked for eject is sufficient to allow removal. + //I believe, power_off when already marked for eject is sufficient to + // allow removal. if ((host->flags & EJECT) && ios->power_mode == MMC_POWER_OFF) { host->flags |= EJECT_DONE; wake_up_all(&host->can_eject); @@ -730,8 +771,9 @@ static void tifm_sd_register_host(void * spin_lock_irqsave(&sock->lock, flags); host->flags |= HOST_REG; - PREPARE_WORK(&host->cmd_handler, no_dma ? tifm_sd_end_cmd_nodma : tifm_sd_end_cmd, - data); + PREPARE_WORK(&host->cmd_handler, + no_dma ? tifm_sd_end_cmd_nodma : tifm_sd_end_cmd, + data); spin_unlock_irqrestore(&sock->lock, flags); dev_dbg(&sock->dev, "adding host\n"); mmc_add_host(mmc); @@ -743,7 +785,8 @@ static int tifm_sd_probe(struct tifm_dev struct tifm_sd *host; int rc = -EIO; - if (!(TIFM_SOCK_STATE_OCCUPIED & readl(sock->addr + SOCK_PRESENT_STATE))) { + if (!(TIFM_SOCK_STATE_OCCUPIED & + readl(sock->addr + SOCK_PRESENT_STATE))) { printk(KERN_WARNING DRIVER_NAME ": card gone, unexpectedly\n"); return rc; } @@ -778,9 +821,10 @@ static int tifm_sd_probe(struct tifm_dev writel(0, sock->addr + SOCK_MMCSD_INT_ENABLE); writel(TIFM_MMCSD_RESET, sock->addr + SOCK_MMCSD_SYSTEM_CONTROL); - writel(host->clk_div | TIFM_MMCSD_POWER, sock->addr + SOCK_MMCSD_CONFIG); + writel(host->clk_div | TIFM_MMCSD_POWER, + sock->addr + SOCK_MMCSD_CONFIG); - for(rc = 0; rc < 50; rc++) { + for (rc = 0; rc < 50; rc++) { /* Wait for reset ack */ if (1 & readl(sock->addr + SOCK_MMCSD_SYSTEM_STATUS)) { rc = 0; @@ -790,21 +834,26 @@ static int tifm_sd_probe(struct tifm_dev } if (rc) { - printk(KERN_ERR DRIVER_NAME ": card not ready - probe failed\n"); + printk(KERN_ERR DRIVER_NAME + ": card not ready - probe failed\n"); mmc_free_host(mmc); return -ENODEV; } writel(0, sock->addr + SOCK_MMCSD_NUM_BLOCKS); - writel(host->clk_div | TIFM_MMCSD_POWER, sock->addr + SOCK_MMCSD_CONFIG); + writel(host->clk_div | TIFM_MMCSD_POWER, + sock->addr + SOCK_MMCSD_CONFIG); writel(TIFM_MMCSD_RXDE, sock->addr + SOCK_MMCSD_BUFFER_CONFIG); - writel(TIFM_MMCSD_DATAMASK | TIFM_MMCSD_ERRMASK, sock->addr + SOCK_MMCSD_INT_ENABLE); + writel(TIFM_MMCSD_DATAMASK | TIFM_MMCSD_ERRMASK, + sock->addr + SOCK_MMCSD_INT_ENABLE); writel(64, sock->addr + SOCK_MMCSD_COMMAND_TO); // command timeout 64 clocks for now writel(TIFM_MMCSD_INAB, sock->addr + SOCK_MMCSD_COMMAND); - writel(host->clk_div | TIFM_MMCSD_POWER, sock->addr + SOCK_MMCSD_CONFIG); + writel(host->clk_div | TIFM_MMCSD_POWER, + sock->addr + SOCK_MMCSD_CONFIG); - queue_delayed_work(sock->wq, &host->abort_handler, host->timeout_jiffies); + queue_delayed_work(sock->wq, &host->abort_handler, + host->timeout_jiffies); return 0; } @@ -833,15 +882,18 @@ static void tifm_sd_remove(struct tifm_d if (host->req) queue_work(sock->wq, &host->cmd_handler); spin_unlock_irqrestore(&sock->lock, flags); - wait_event_timeout(host->can_eject, tifm_sd_host_is_down(sock), host->timeout_jiffies); + wait_event_timeout(host->can_eject, tifm_sd_host_is_down(sock), + host->timeout_jiffies); if (host->flags & HOST_REG) mmc_remove_host(mmc); /* The meaning of the bit majority in this constant is unknown. */ - writel(0xfff8 & readl(sock->addr + SOCK_CONTROL), sock->addr + SOCK_CONTROL); + writel(0xfff8 & readl(sock->addr + SOCK_CONTROL), + sock->addr + SOCK_CONTROL); writel(0, sock->addr + SOCK_MMCSD_INT_ENABLE); - writel(TIFM_FIFO_INT_SETALL, sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR); + writel(TIFM_FIFO_INT_SETALL, + sock->addr + SOCK_DMA_FIFO_INT_ENABLE_CLEAR); writel(0, sock->addr + SOCK_DMA_FIFO_INT_ENABLE_SET); tifm_set_drvdata(sock, 0); _ Patches currently in -mm which might be from akpm@xxxxxxxx are git-acpi.patch acpi-asus-s3-resume-fix.patch sony_apci-resume.patch kauditd_thread-warning-fix.patch git-block.patch git-block-hack.patch scsi-device_reprobe-can-fail.patch git-drm.patch git-dvb.patch git-dvb-fixup.patch dvb-usb-vs-driver-tree.patch git-gfs2.patch git-ia64.patch git-ieee1394.patch stowaway-vs-driver-tree.patch git-intelfb-fixup.patch git-kbuild.patch hdrcheck-permission-fix.patch git-libata-all.patch 1-of-2-jmicron-driver-fix.patch via-pata-controller-xfer-fixes-fix.patch git-magic-fixup.patch git-magic-fixup-2.patch mmc-driver-for-ti-flashmedia-card-reader-source-tidy.patch git-netdev-all.patch drivers-net-ns83820c-add-paramter-to-disable-auto.patch git-net.patch git-net-fixup.patch git-nfs-fixup.patch revert-allow-file-systems-to-manually-d_move-inside-of-rename.patch git-ocfs2.patch revert-genirq-core-fix-handle_level_irq.patch git-parisc-fixup.patch git-parisc-powerpc-fix.patch git-pcmcia-fixup.patch git-powerpc.patch tickle-nmi-watchdog-on-serial-output-fix.patch serial-fix-uart_bug_txen-test.patch pcie-check-and-return-bus_register-errors-fix.patch git-scsi-misc.patch git-scsi-misc-fixup.patch revert-scsi-improve-inquiry-printing.patch git-scsi-misc-nlmsg_multicast-fix.patch git-block-vs-git-sas.patch pci-error-recovery-symbios-scsi-device-driver-tidy.patch git-scsi-target-fixup.patch git-scsi-target-vs-git-block.patch gregkh-usb-usb-storage-add-rio-karma-eject-support-fix.patch fix-gregkh-usb-usbcore-add-autosuspend-autoresume-infrastructure.patch xpad-dance-pad-support-tidy.patch git-watchdog.patch revert-x86_64-mm-i386-remove-lock-section.patch fix-x86_64-mm-i386-backtrace-ebp-fallback.patch fix-x86_64-mm-i386-pda-smp-processorid.patch fix-x86_64-mm-spinlock-cleanup.patch xfs-rename-uio_read.patch adix-tree-rcu-lockless-readside-update-tidy.patch mm-tracking-shared-dirty-pages-checks.patch mm-tracking-shared-dirty-pages-wimp.patch convert-i386-numa-kva-space-to-bootmem-tidy.patch reduce-max_nr_zones-make-display-of-highmem-counters-conditional-on-config_highmem-tidy.patch reduce-max_nr_zones-use-enum-to-define-zones-reformat-and-comment-cleanup.patch reduce-max_nr_zones-use-enum-to-define-zones-reformat-and-comment-fix.patch reduce-max_nr_zones-remove-display-of-counters-for-unconfigured-zones-s390-fix.patch out-of-memory-notifier-tidy.patch mm-swap-write-failure-fixup-fix.patch slab-optimize-kmalloc_node-the-same-way-as-kmalloc-fix.patch slab-fix-lockdep-warnings-fix-2.patch have-x86-use-add_active_range-and-free_area_init_nodes-fix.patch zone_reclaim-dynamic-slab-reclaim-tidy.patch vm-add-per-zone-writeout-counter.patch convert-s390-page-handling-macros-to-functions-fix.patch slab-fix-kmalloc_node-applying-memory-policies-if-nodeid-==-numa_node_id-fix.patch gfp_thisnode-for-the-slab-allocator-v2-fix.patch get-rid-of-zone_table-fix.patch do_no_pfn-tweaks.patch shared-page-table-for-hugetlb-page-v2-tidy.patch acx1xx-wireless-driver.patch tiacx-pci-build-fix.patch tiacx-ia64-fix.patch tiacx-build-fix.patch binfmt_elf-consistently-use-loff_t.patch nommu-set-bdi-capabilities-for-dev-mem-and-dev-kmem-tidy.patch nommu-move-the-fallback-arch_vma_name-to-a-sensible-place-fix.patch convert-i386-summit-subarch-to-use-srat-info-for-apicid_to_node-calls-tidy.patch i386-adds-smp_call_function_single-fix.patch swsusp-write-timer.patch swsusp-write-speedup.patch swsusp-read-timer.patch swsusp-read-speedup.patch swsusp-read-speedup-fix.patch swsusp-read-speedup-cleanup.patch swsusp-read-speedup-cleanup-2.patch swsusp-read-speedup-fix-fix-2.patch deprecate-smbfs-in-favour-of-cifs.patch edac-new-opteron-athlon64-memory-controller-driver-tidy.patch inode_diet-replace-inodeugeneric_ip-with-inodei_private-gfs-fix.patch inode-diet-eliminate-i_blksize-and-use-a-per-superblock-default-fix-fix.patch x86-microcode-microcode-driver-cleanup-tidy.patch x86-microcode-add-sysfs-and-hotplug-support-fix.patch eisa-bus-modalias-attributes-support-1-fix-git-kbuild-fix.patch add-address_space_operationsbatch_write-fix.patch alloc_fdtable-cleanup.patch sysctl-allow-proc-sys-without-sys_sysctl-fix.patch add-probe_kernel_address.patch x86-use-probe_kernel_address-in-handle_bug.patch blockdevc-check-errors.patch let-warn_on-warn_on_once-return-the-condition-fix.patch let-warn_on-warn_on_once-return-the-condition-fix-2.patch omap-add-watchdog-driver-support-tweaks.patch move-valid_dma_direction-from-x86_64-to-generic-code-fix.patch single-bit-flip-detector-tidy.patch fix-unserialized-task-files-changing-fix.patch tty-make-termios_sem-a-mutex-fix.patch solaris-emulation-incorrect-tty-locking-fix.patch solaris-emulation-incorrect-tty-locking-fix-2.patch cpuset-top_cpuset-tracks-hotplug-changes-to-node_online_map-fix.patch remove-sound-oss-copying.patch maximum-latency-tracking-infrastructure-tidy.patch fs-nameic-replace-multiple-current-fs-by-shortcut-variable-tidy.patch call-mm-page-writebackcset_ratelimit-when-new-pages-tidy.patch sys-modules-patch-allow-full-length-section-names.patch expand_fdtable-remove-pointless-unlocklock.patch add-config_headers_check-option-to-automatically-run-make-headers_check-nobble.patch submit-checklist-mention-headers_check.patch ntp-move-all-the-ntp-related-code-to-ntpc-fix.patch reiserfs-on-demand-bitmap-loading.patch streamline-generic_file_-interfaces-and-filemap-gfs-fix.patch add-vector-aio-support-fix.patch csa-basic-accounting-over-taskstats-fix.patch fs-cache-make-kafs-use-fs-cache-fix.patch fs-cache-make-kafs-use-fs-cache-vs-streamline-generic_file_-interfaces-and-filemap.patch nfs-use-local-caching-12-fix.patch stack-overflow-safe-kdump-crash_use_safe_smp_processor_id-fix.patch generic-ioremap_page_range-x86_64-conversion-fix.patch vfs-make-filldir_t-and-struct-kstat-deal-in-64-bit-inode-numbers-alpha-fix.patch some-cleanup-in-the-pipe-code-tidy.patch support-piping-into-commands-in-proc-sys-kernel-core_pattern-fix.patch move-pidmap-to-pspaceh-fix.patch kprobes-handle-symbol-resolution-when-modulesymbol-is-specified-tidy.patch isdn-work-around-excessive-udelay.patch knfsd-add-a-callback-for-when-last-rpc-thread-finishes-tidy.patch knfsd-add-a-callback-for-when-last-rpc-thread-finishes-fix.patch knfsd-separate-out-some-parts-of-nfsd_svc-which-start-nfs-servers-tweaks.patch knfsd-define-new-nfsdfs-file-portlist-contains-list-of-ports-tidy.patch knfsd-define-new-nfsdfs-file-portlist-contains-list-of-ports-fix.patch knfsd-drop-serv-option-to-svc_recv-and-svc_process-nfs-callback-fix-nfs-callback-fix.patch knfsd-move-tempsock-aging-to-a-timer-tidy.patch sched-remove-unnecessary-sched-group-allocations-fix.patch swap_prefetch-vs-zoned-counters.patch ecryptfs-mmap-operations.patch ecryptfs-alpha-build-fix.patch ecryptfs-more-elegant-aes-key-size-manipulation.patch ecryptfs-get_sb_dev-fix.patch make-kmem_cache_destroy-return-void-ecryptfs.patch ecryptfs-versioning-fixes-tidy.patch namespaces-add-nsproxy.patch namespaces-utsname-switch-to-using-uts-namespaces.patch namespaces-utsname-switch-to-using-uts-namespaces-klibc-bit-sparc.patch namespaces-utsname-use-init_utsname-when-appropriate.patch namespaces-utsname-implement-utsname-namespaces.patch namespaces-utsname-sysctl-hack.patch ipc-namespace-core.patch rename-the-provided-execve-functions-to-kernel_execve-headers-fix.patch replace-cad_pid-by-a-struct-pid-fixes.patch readahead-sysctl-parameters-fix.patch make-copy_from_user_inatomic-not-zero-the-tail-on-i386-vs-reiser4.patch make-kmem_cache_destroy-return-void-reiser4.patch reiser4-hardirq-include-fix.patch reiser4-run-truncate_inode_pages-in-reiser4_delete_inode.patch reiser4-get_sb_dev-fix.patch reiser4-vs-zoned-allocator.patch reiser4-rename-generic_sounding_globalspatch-fix.patch hpt3xx-rework-rate-filtering-tidy.patch genirq-convert-the-i386-architecture-to-irq-chips.patch genirq-x86_64-irq-reenable-migrating-irqs-to-other-cpus.patch genirq-msi-simplify-msi-enable-and-disable.patch genirq-ia64-irq-dynamic-irq-support.patch genirq-msi-only-build-msi-apicc-on-ia64-fix.patch genirq-i386-irq-remove-the-msi-assumption-that-irq-==-vector.patch genirq-x86_64-irq-make-vector_irq-per-cpu-fix.patch genirq-x86_64-irq-make-vector_irq-per-cpu-warning-fix.patch add-hypertransport-capability-defines-fix.patch initial-generic-hypertransport-interrupt-support-Kconfig-fix.patch srcu-report-out-of-memory-errors-fixlet.patch isdn-debug-build-fix.patch isdn-more-pr_debug-fixes.patch nr_blockdev_pages-in_interrupt-warning.patch device-suspend-debug.patch slab-leaks3-default-y.patch x86-kmap_atomic-debugging.patch restore-rogue-readahead-printk.patch put_bh-debug.patch acpi_format_exception-debug.patch jmicron-warning-fix.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html