aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ata/pata_arasan_cf.c4
-rw-r--r--drivers/base/dd.c2
-rw-r--r--drivers/char/hw_random/atmel-rng.c2
-rw-r--r--drivers/clk/spear/clk-aux-synth.c2
-rw-r--r--drivers/clk/spear/clk-frac-synth.c2
-rw-r--r--drivers/clk/spear/clk-gpt-synth.c2
-rw-r--r--drivers/clk/spear/clk-vco-pll.c2
-rw-r--r--drivers/clk/spear/clk.c2
-rw-r--r--drivers/clk/spear/clk.h2
-rw-r--r--drivers/clk/spear/spear1310_clock.c2
-rw-r--r--drivers/clk/spear/spear1340_clock.c2
-rw-r--r--drivers/clk/spear/spear3xx_clock.c2
-rw-r--r--drivers/clk/spear/spear6xx_clock.c2
-rw-r--r--drivers/dma/dw_dmac.c2
-rw-r--r--drivers/dma/imx-sdma.c6
-rw-r--r--drivers/dma/pl330.c30
-rw-r--r--drivers/edac/edac_mc.c2
-rw-r--r--drivers/edac/i7core_edac.c15
-rw-r--r--drivers/edac/mpc85xx_edac.c3
-rw-r--r--drivers/edac/sb_edac.c10
-rw-r--r--drivers/extcon/extcon-max8997.c5
-rw-r--r--drivers/extcon/extcon_class.c2
-rw-r--r--drivers/extcon/extcon_gpio.c2
-rw-r--r--drivers/hwmon/applesmc.c4
-rw-r--r--drivers/hwmon/coretemp.c33
-rw-r--r--drivers/hwmon/emc2103.c12
-rw-r--r--drivers/iio/Kconfig3
-rw-r--r--drivers/iio/industrialio-core.c16
-rw-r--r--drivers/media/video/pms.c1
-rw-r--r--drivers/mfd/stmpe-i2c.c2
-rw-r--r--drivers/mfd/stmpe-spi.c4
-rw-r--r--drivers/misc/mei/interrupt.c2
-rw-r--r--drivers/misc/mei/main.c9
-rw-r--r--drivers/misc/mei/wd.c2
-rw-r--r--drivers/mmc/core/mmc.c2
-rw-r--r--drivers/mmc/core/sd.c6
-rw-r--r--drivers/mmc/core/sdio.c6
-rw-r--r--drivers/mmc/host/atmel-mci-regs.h14
-rw-r--r--drivers/mmc/host/atmel-mci.c12
-rw-r--r--drivers/mmc/host/dw_mmc.c36
-rw-r--r--drivers/mmc/host/mmci.c19
-rw-r--r--drivers/mmc/host/mxs-mmc.c2
-rw-r--r--drivers/mmc/host/omap.c18
-rw-r--r--drivers/mmc/host/sdhci-s3c.c2
-rw-r--r--drivers/mmc/host/sdhci-spear.c4
-rw-r--r--drivers/mmc/host/sdhci.c4
-rw-r--r--drivers/mtd/mtdoops.c22
-rw-r--r--drivers/pinctrl/pinctrl-mxs.c2
-rw-r--r--drivers/pinctrl/pinctrl-nomadik.c22
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear.c2
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear.h2
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear1310.c4
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear1340.c4
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear300.c4
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear310.c4
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear320.c4
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear3xx.c2
-rw-r--r--drivers/pinctrl/spear/pinctrl-spear3xx.h2
-rw-r--r--drivers/regulator/ab8500.c22
-rw-r--r--drivers/regulator/db8500-prcmu.c40
-rw-r--r--drivers/regulator/s5m8767.c2
-rw-r--r--drivers/remoteproc/omap_remoteproc.c2
-rw-r--r--drivers/remoteproc/remoteproc_core.c10
-rw-r--r--drivers/spi/spi-omap2-mcspi.c3
-rw-r--r--drivers/staging/comedi/drivers.c5
-rw-r--r--drivers/staging/gdm72xx/netlink_k.c2
-rw-r--r--drivers/staging/iio/Documentation/device.txt2
-rw-r--r--drivers/staging/iio/adc/Kconfig1
-rw-r--r--drivers/staging/iio/adc/ad7606_core.c3
-rw-r--r--drivers/staging/omapdrm/omap_fbdev.c10
-rw-r--r--drivers/staging/rtl8712/usb_intf.c2
-rw-r--r--drivers/tty/serial/8250/8250.c2
-rw-r--r--drivers/tty/serial/amba-pl011.c45
-rw-r--r--drivers/tty/serial/serial_txx9.c2
-rw-r--r--drivers/watchdog/sp805_wdt.c4
75 files changed, 335 insertions, 214 deletions
diff --git a/drivers/ata/pata_arasan_cf.c b/drivers/ata/pata_arasan_cf.c
index 3239517f4d90..ac6a5beb28f3 100644
--- a/drivers/ata/pata_arasan_cf.c
+++ b/drivers/ata/pata_arasan_cf.c
@@ -4,7 +4,7 @@
4 * Arasan Compact Flash host controller source file 4 * Arasan Compact Flash host controller source file
5 * 5 *
6 * Copyright (C) 2011 ST Microelectronics 6 * Copyright (C) 2011 ST Microelectronics
7 * Viresh Kumar <viresh.kumar@st.com> 7 * Viresh Kumar <viresh.linux@gmail.com>
8 * 8 *
9 * This file is licensed under the terms of the GNU General Public 9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any 10 * License version 2. This program is licensed "as is" without any
@@ -959,7 +959,7 @@ static struct platform_driver arasan_cf_driver = {
959 959
960module_platform_driver(arasan_cf_driver); 960module_platform_driver(arasan_cf_driver);
961 961
962MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); 962MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>");
963MODULE_DESCRIPTION("Arasan ATA Compact Flash driver"); 963MODULE_DESCRIPTION("Arasan ATA Compact Flash driver");
964MODULE_LICENSE("GPL"); 964MODULE_LICENSE("GPL");
965MODULE_ALIAS("platform:" DRIVER_NAME); 965MODULE_ALIAS("platform:" DRIVER_NAME);
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 1b1cbb571d38..dcb8a6e48692 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -100,7 +100,7 @@ static void driver_deferred_probe_add(struct device *dev)
100 mutex_lock(&deferred_probe_mutex); 100 mutex_lock(&deferred_probe_mutex);
101 if (list_empty(&dev->p->deferred_probe)) { 101 if (list_empty(&dev->p->deferred_probe)) {
102 dev_dbg(dev, "Added to deferred list\n"); 102 dev_dbg(dev, "Added to deferred list\n");
103 list_add(&dev->p->deferred_probe, &deferred_probe_pending_list); 103 list_add_tail(&dev->p->deferred_probe, &deferred_probe_pending_list);
104 } 104 }
105 mutex_unlock(&deferred_probe_mutex); 105 mutex_unlock(&deferred_probe_mutex);
106} 106}
diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c
index 6289f0eee24c..731c9046cf7b 100644
--- a/drivers/char/hw_random/atmel-rng.c
+++ b/drivers/char/hw_random/atmel-rng.c
@@ -34,7 +34,7 @@ static int atmel_trng_read(struct hwrng *rng, void *buf, size_t max,
34 u32 *data = buf; 34 u32 *data = buf;
35 35
36 /* data ready? */ 36 /* data ready? */
37 if (readl(trng->base + TRNG_ODATA) & 1) { 37 if (readl(trng->base + TRNG_ISR) & 1) {
38 *data = readl(trng->base + TRNG_ODATA); 38 *data = readl(trng->base + TRNG_ODATA);
39 /* 39 /*
40 ensure data ready is only set again AFTER the next data 40 ensure data ready is only set again AFTER the next data
diff --git a/drivers/clk/spear/clk-aux-synth.c b/drivers/clk/spear/clk-aux-synth.c
index af34074e702b..6756e7c3bc07 100644
--- a/drivers/clk/spear/clk-aux-synth.c
+++ b/drivers/clk/spear/clk-aux-synth.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2012 ST Microelectronics 2 * Copyright (C) 2012 ST Microelectronics
3 * Viresh Kumar <viresh.kumar@st.com> 3 * Viresh Kumar <viresh.linux@gmail.com>
4 * 4 *
5 * This file is licensed under the terms of the GNU General Public 5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any 6 * License version 2. This program is licensed "as is" without any
diff --git a/drivers/clk/spear/clk-frac-synth.c b/drivers/clk/spear/clk-frac-synth.c
index 4dbdb3fe18e0..958aa3ad1d60 100644
--- a/drivers/clk/spear/clk-frac-synth.c
+++ b/drivers/clk/spear/clk-frac-synth.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2012 ST Microelectronics 2 * Copyright (C) 2012 ST Microelectronics
3 * Viresh Kumar <viresh.kumar@st.com> 3 * Viresh Kumar <viresh.linux@gmail.com>
4 * 4 *
5 * This file is licensed under the terms of the GNU General Public 5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any 6 * License version 2. This program is licensed "as is" without any
diff --git a/drivers/clk/spear/clk-gpt-synth.c b/drivers/clk/spear/clk-gpt-synth.c
index b471c9762a97..1afc18c4effc 100644
--- a/drivers/clk/spear/clk-gpt-synth.c
+++ b/drivers/clk/spear/clk-gpt-synth.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2012 ST Microelectronics 2 * Copyright (C) 2012 ST Microelectronics
3 * Viresh Kumar <viresh.kumar@st.com> 3 * Viresh Kumar <viresh.linux@gmail.com>
4 * 4 *
5 * This file is licensed under the terms of the GNU General Public 5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any 6 * License version 2. This program is licensed "as is" without any
diff --git a/drivers/clk/spear/clk-vco-pll.c b/drivers/clk/spear/clk-vco-pll.c
index dcd4bdf4b0d9..5f1b6badeb15 100644
--- a/drivers/clk/spear/clk-vco-pll.c
+++ b/drivers/clk/spear/clk-vco-pll.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2012 ST Microelectronics 2 * Copyright (C) 2012 ST Microelectronics
3 * Viresh Kumar <viresh.kumar@st.com> 3 * Viresh Kumar <viresh.linux@gmail.com>
4 * 4 *
5 * This file is licensed under the terms of the GNU General Public 5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any 6 * License version 2. This program is licensed "as is" without any
diff --git a/drivers/clk/spear/clk.c b/drivers/clk/spear/clk.c
index 376d4e5ff326..7cd63788d546 100644
--- a/drivers/clk/spear/clk.c
+++ b/drivers/clk/spear/clk.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 2012 ST Microelectronics 2 * Copyright (C) 2012 ST Microelectronics
3 * Viresh Kumar <viresh.kumar@st.com> 3 * Viresh Kumar <viresh.linux@gmail.com>
4 * 4 *
5 * This file is licensed under the terms of the GNU General Public 5 * This file is licensed under the terms of the GNU General Public
6 * License version 2. This program is licensed "as is" without any 6 * License version 2. This program is licensed "as is" without any
diff --git a/drivers/clk/spear/clk.h b/drivers/clk/spear/clk.h
index 3321c46a071c..931737677dfa 100644
--- a/drivers/clk/spear/clk.h
+++ b/drivers/clk/spear/clk.h
@@ -2,7 +2,7 @@
2 * Clock framework definitions for SPEAr platform 2 * Clock framework definitions for SPEAr platform
3 * 3 *
4 * Copyright (C) 2012 ST Microelectronics 4 * Copyright (C) 2012 ST Microelectronics
5 * Viresh Kumar <viresh.kumar@st.com> 5 * Viresh Kumar <viresh.linux@gmail.com>
6 * 6 *
7 * This file is licensed under the terms of the GNU General Public 7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any 8 * License version 2. This program is licensed "as is" without any
diff --git a/drivers/clk/spear/spear1310_clock.c b/drivers/clk/spear/spear1310_clock.c
index 42b68df9aeef..8f05652d53e6 100644
--- a/drivers/clk/spear/spear1310_clock.c
+++ b/drivers/clk/spear/spear1310_clock.c
@@ -4,7 +4,7 @@
4 * SPEAr1310 machine clock framework source file 4 * SPEAr1310 machine clock framework source file
5 * 5 *
6 * Copyright (C) 2012 ST Microelectronics 6 * Copyright (C) 2012 ST Microelectronics
7 * Viresh Kumar <viresh.kumar@st.com> 7 * Viresh Kumar <viresh.linux@gmail.com>
8 * 8 *
9 * This file is licensed under the terms of the GNU General Public 9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any 10 * License version 2. This program is licensed "as is" without any
diff --git a/drivers/clk/spear/spear1340_clock.c b/drivers/clk/spear/spear1340_clock.c
index f130919d5bf8..e3ea72162236 100644
--- a/drivers/clk/spear/spear1340_clock.c
+++ b/drivers/clk/spear/spear1340_clock.c
@@ -4,7 +4,7 @@
4 * SPEAr1340 machine clock framework source file 4 * SPEAr1340 machine clock framework source file
5 * 5 *
6 * Copyright (C) 2012 ST Microelectronics 6 * Copyright (C) 2012 ST Microelectronics
7 * Viresh Kumar <viresh.kumar@st.com> 7 * Viresh Kumar <viresh.linux@gmail.com>
8 * 8 *
9 * This file is licensed under the terms of the GNU General Public 9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any 10 * License version 2. This program is licensed "as is" without any
diff --git a/drivers/clk/spear/spear3xx_clock.c b/drivers/clk/spear/spear3xx_clock.c
index 440bb3e4c971..01dd6daff2a1 100644
--- a/drivers/clk/spear/spear3xx_clock.c
+++ b/drivers/clk/spear/spear3xx_clock.c
@@ -2,7 +2,7 @@
2 * SPEAr3xx machines clock framework source file 2 * SPEAr3xx machines clock framework source file
3 * 3 *
4 * Copyright (C) 2012 ST Microelectronics 4 * Copyright (C) 2012 ST Microelectronics
5 * Viresh Kumar <viresh.kumar@st.com> 5 * Viresh Kumar <viresh.linux@gmail.com>
6 * 6 *
7 * This file is licensed under the terms of the GNU General Public 7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any 8 * License version 2. This program is licensed "as is" without any
diff --git a/drivers/clk/spear/spear6xx_clock.c b/drivers/clk/spear/spear6xx_clock.c
index f9a20b382304..554d64b062a1 100644
--- a/drivers/clk/spear/spear6xx_clock.c
+++ b/drivers/clk/spear/spear6xx_clock.c
@@ -2,7 +2,7 @@
2 * SPEAr6xx machines clock framework source file 2 * SPEAr6xx machines clock framework source file
3 * 3 *
4 * Copyright (C) 2012 ST Microelectronics 4 * Copyright (C) 2012 ST Microelectronics
5 * Viresh Kumar <viresh.kumar@st.com> 5 * Viresh Kumar <viresh.linux@gmail.com>
6 * 6 *
7 * This file is licensed under the terms of the GNU General Public 7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any 8 * License version 2. This program is licensed "as is" without any
diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
index e23dc82d43ac..721296157577 100644
--- a/drivers/dma/dw_dmac.c
+++ b/drivers/dma/dw_dmac.c
@@ -1626,4 +1626,4 @@ module_exit(dw_exit);
1626MODULE_LICENSE("GPL v2"); 1626MODULE_LICENSE("GPL v2");
1627MODULE_DESCRIPTION("Synopsys DesignWare DMA Controller driver"); 1627MODULE_DESCRIPTION("Synopsys DesignWare DMA Controller driver");
1628MODULE_AUTHOR("Haavard Skinnemoen (Atmel)"); 1628MODULE_AUTHOR("Haavard Skinnemoen (Atmel)");
1629MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); 1629MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>");
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index fb4f4990f5eb..1dc2a4ad0026 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -815,8 +815,6 @@ static int sdma_request_channel(struct sdma_channel *sdmac)
815 815
816 init_completion(&sdmac->done); 816 init_completion(&sdmac->done);
817 817
818 sdmac->buf_tail = 0;
819
820 return 0; 818 return 0;
821out: 819out:
822 820
@@ -927,6 +925,8 @@ static struct dma_async_tx_descriptor *sdma_prep_slave_sg(
927 925
928 sdmac->flags = 0; 926 sdmac->flags = 0;
929 927
928 sdmac->buf_tail = 0;
929
930 dev_dbg(sdma->dev, "setting up %d entries for channel %d.\n", 930 dev_dbg(sdma->dev, "setting up %d entries for channel %d.\n",
931 sg_len, channel); 931 sg_len, channel);
932 932
@@ -1027,6 +1027,8 @@ static struct dma_async_tx_descriptor *sdma_prep_dma_cyclic(
1027 1027
1028 sdmac->status = DMA_IN_PROGRESS; 1028 sdmac->status = DMA_IN_PROGRESS;
1029 1029
1030 sdmac->buf_tail = 0;
1031
1030 sdmac->flags |= IMX_DMA_SG_LOOP; 1032 sdmac->flags |= IMX_DMA_SG_LOOP;
1031 sdmac->direction = direction; 1033 sdmac->direction = direction;
1032 ret = sdma_load_context(sdmac); 1034 ret = sdma_load_context(sdmac);
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index cbcc28e79be6..e4feba6b03c0 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -392,6 +392,8 @@ struct pl330_req {
392 struct pl330_reqcfg *cfg; 392 struct pl330_reqcfg *cfg;
393 /* Pointer to first xfer in the request. */ 393 /* Pointer to first xfer in the request. */
394 struct pl330_xfer *x; 394 struct pl330_xfer *x;
395 /* Hook to attach to DMAC's list of reqs with due callback */
396 struct list_head rqd;
395}; 397};
396 398
397/* 399/*
@@ -461,8 +463,6 @@ struct _pl330_req {
461 /* Number of bytes taken to setup MC for the req */ 463 /* Number of bytes taken to setup MC for the req */
462 u32 mc_len; 464 u32 mc_len;
463 struct pl330_req *r; 465 struct pl330_req *r;
464 /* Hook to attach to DMAC's list of reqs with due callback */
465 struct list_head rqd;
466}; 466};
467 467
468/* ToBeDone for tasklet */ 468/* ToBeDone for tasklet */
@@ -1683,7 +1683,7 @@ static void pl330_dotask(unsigned long data)
1683/* Returns 1 if state was updated, 0 otherwise */ 1683/* Returns 1 if state was updated, 0 otherwise */
1684static int pl330_update(const struct pl330_info *pi) 1684static int pl330_update(const struct pl330_info *pi)
1685{ 1685{
1686 struct _pl330_req *rqdone; 1686 struct pl330_req *rqdone, *tmp;
1687 struct pl330_dmac *pl330; 1687 struct pl330_dmac *pl330;
1688 unsigned long flags; 1688 unsigned long flags;
1689 void __iomem *regs; 1689 void __iomem *regs;
@@ -1750,7 +1750,10 @@ static int pl330_update(const struct pl330_info *pi)
1750 if (active == -1) /* Aborted */ 1750 if (active == -1) /* Aborted */
1751 continue; 1751 continue;
1752 1752
1753 rqdone = &thrd->req[active]; 1753 /* Detach the req */
1754 rqdone = thrd->req[active].r;
1755 thrd->req[active].r = NULL;
1756
1754 mark_free(thrd, active); 1757 mark_free(thrd, active);
1755 1758
1756 /* Get going again ASAP */ 1759 /* Get going again ASAP */
@@ -1762,20 +1765,11 @@ static int pl330_update(const struct pl330_info *pi)
1762 } 1765 }
1763 1766
1764 /* Now that we are in no hurry, do the callbacks */ 1767 /* Now that we are in no hurry, do the callbacks */
1765 while (!list_empty(&pl330->req_done)) { 1768 list_for_each_entry_safe(rqdone, tmp, &pl330->req_done, rqd) {
1766 struct pl330_req *r; 1769 list_del(&rqdone->rqd);
1767
1768 rqdone = container_of(pl330->req_done.next,
1769 struct _pl330_req, rqd);
1770
1771 list_del_init(&rqdone->rqd);
1772
1773 /* Detach the req */
1774 r = rqdone->r;
1775 rqdone->r = NULL;
1776 1770
1777 spin_unlock_irqrestore(&pl330->lock, flags); 1771 spin_unlock_irqrestore(&pl330->lock, flags);
1778 _callback(r, PL330_ERR_NONE); 1772 _callback(rqdone, PL330_ERR_NONE);
1779 spin_lock_irqsave(&pl330->lock, flags); 1773 spin_lock_irqsave(&pl330->lock, flags);
1780 } 1774 }
1781 1775
@@ -2321,7 +2315,7 @@ static void pl330_tasklet(unsigned long data)
2321 /* Pick up ripe tomatoes */ 2315 /* Pick up ripe tomatoes */
2322 list_for_each_entry_safe(desc, _dt, &pch->work_list, node) 2316 list_for_each_entry_safe(desc, _dt, &pch->work_list, node)
2323 if (desc->status == DONE) { 2317 if (desc->status == DONE) {
2324 if (pch->cyclic) 2318 if (!pch->cyclic)
2325 dma_cookie_complete(&desc->txd); 2319 dma_cookie_complete(&desc->txd);
2326 list_move_tail(&desc->node, &list); 2320 list_move_tail(&desc->node, &list);
2327 } 2321 }
@@ -2539,7 +2533,7 @@ static inline void _init_desc(struct dma_pl330_desc *desc)
2539} 2533}
2540 2534
2541/* Returns the number of descriptors added to the DMAC pool */ 2535/* Returns the number of descriptors added to the DMAC pool */
2542int add_desc(struct dma_pl330_dmac *pdmac, gfp_t flg, int count) 2536static int add_desc(struct dma_pl330_dmac *pdmac, gfp_t flg, int count)
2543{ 2537{
2544 struct dma_pl330_desc *desc; 2538 struct dma_pl330_desc *desc;
2545 unsigned long flags; 2539 unsigned long flags;
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 10f375032e96..de5ba86e8b89 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -164,7 +164,7 @@ void *edac_align_ptr(void **p, unsigned size, int n_elems)
164 else 164 else
165 return (char *)ptr; 165 return (char *)ptr;
166 166
167 r = size % align; 167 r = (unsigned long)p % align;
168 168
169 if (r == 0) 169 if (r == 0)
170 return (char *)ptr; 170 return (char *)ptr;
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index d27778f65a5d..a499c7ed820a 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -1814,12 +1814,6 @@ static int i7core_mce_check_error(struct notifier_block *nb, unsigned long val,
1814 if (mce->bank != 8) 1814 if (mce->bank != 8)
1815 return NOTIFY_DONE; 1815 return NOTIFY_DONE;
1816 1816
1817#ifdef CONFIG_SMP
1818 /* Only handle if it is the right mc controller */
1819 if (mce->socketid != pvt->i7core_dev->socket)
1820 return NOTIFY_DONE;
1821#endif
1822
1823 smp_rmb(); 1817 smp_rmb();
1824 if ((pvt->mce_out + 1) % MCE_LOG_LEN == pvt->mce_in) { 1818 if ((pvt->mce_out + 1) % MCE_LOG_LEN == pvt->mce_in) {
1825 smp_wmb(); 1819 smp_wmb();
@@ -2116,8 +2110,6 @@ static void i7core_unregister_mci(struct i7core_dev *i7core_dev)
2116 if (pvt->enable_scrub) 2110 if (pvt->enable_scrub)
2117 disable_sdram_scrub_setting(mci); 2111 disable_sdram_scrub_setting(mci);
2118 2112
2119 mce_unregister_decode_chain(&i7_mce_dec);
2120
2121 /* Disable EDAC polling */ 2113 /* Disable EDAC polling */
2122 i7core_pci_ctl_release(pvt); 2114 i7core_pci_ctl_release(pvt);
2123 2115
@@ -2222,8 +2214,6 @@ static int i7core_register_mci(struct i7core_dev *i7core_dev)
2222 /* DCLK for scrub rate setting */ 2214 /* DCLK for scrub rate setting */
2223 pvt->dclk_freq = get_dclk_freq(); 2215 pvt->dclk_freq = get_dclk_freq();
2224 2216
2225 mce_register_decode_chain(&i7_mce_dec);
2226
2227 return 0; 2217 return 0;
2228 2218
2229fail0: 2219fail0:
@@ -2367,8 +2357,10 @@ static int __init i7core_init(void)
2367 2357
2368 pci_rc = pci_register_driver(&i7core_driver); 2358 pci_rc = pci_register_driver(&i7core_driver);
2369 2359
2370 if (pci_rc >= 0) 2360 if (pci_rc >= 0) {
2361 mce_register_decode_chain(&i7_mce_dec);
2371 return 0; 2362 return 0;
2363 }
2372 2364
2373 i7core_printk(KERN_ERR, "Failed to register device with error %d.\n", 2365 i7core_printk(KERN_ERR, "Failed to register device with error %d.\n",
2374 pci_rc); 2366 pci_rc);
@@ -2384,6 +2376,7 @@ static void __exit i7core_exit(void)
2384{ 2376{
2385 debugf2("MC: " __FILE__ ": %s()\n", __func__); 2377 debugf2("MC: " __FILE__ ": %s()\n", __func__);
2386 pci_unregister_driver(&i7core_driver); 2378 pci_unregister_driver(&i7core_driver);
2379 mce_unregister_decode_chain(&i7_mce_dec);
2387} 2380}
2388 2381
2389module_init(i7core_init); 2382module_init(i7core_init);
diff --git a/drivers/edac/mpc85xx_edac.c b/drivers/edac/mpc85xx_edac.c
index 4c402353ba98..0e374625f6f8 100644
--- a/drivers/edac/mpc85xx_edac.c
+++ b/drivers/edac/mpc85xx_edac.c
@@ -980,7 +980,8 @@ static int __devinit mpc85xx_mc_err_probe(struct platform_device *op)
980 layers[1].type = EDAC_MC_LAYER_CHANNEL; 980 layers[1].type = EDAC_MC_LAYER_CHANNEL;
981 layers[1].size = 1; 981 layers[1].size = 1;
982 layers[1].is_virt_csrow = false; 982 layers[1].is_virt_csrow = false;
983 mci = edac_mc_alloc(edac_mc_idx, ARRAY_SIZE(layers), sizeof(*pdata)); 983 mci = edac_mc_alloc(edac_mc_idx, ARRAY_SIZE(layers), layers,
984 sizeof(*pdata));
984 if (!mci) { 985 if (!mci) {
985 devres_release_group(&op->dev, mpc85xx_mc_err_probe); 986 devres_release_group(&op->dev, mpc85xx_mc_err_probe);
986 return -ENOMEM; 987 return -ENOMEM;
diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
index 4adaf4b7da99..36ad17e79d61 100644
--- a/drivers/edac/sb_edac.c
+++ b/drivers/edac/sb_edac.c
@@ -555,7 +555,7 @@ static int get_dimm_config(struct mem_ctl_info *mci)
555 pvt->is_close_pg = false; 555 pvt->is_close_pg = false;
556 } 556 }
557 557
558 pci_read_config_dword(pvt->pci_ta, RANK_CFG_A, &reg); 558 pci_read_config_dword(pvt->pci_ddrio, RANK_CFG_A, &reg);
559 if (IS_RDIMM_ENABLED(reg)) { 559 if (IS_RDIMM_ENABLED(reg)) {
560 /* FIXME: Can also be LRDIMM */ 560 /* FIXME: Can also be LRDIMM */
561 debugf0("Memory is registered\n"); 561 debugf0("Memory is registered\n");
@@ -1604,8 +1604,6 @@ static void sbridge_unregister_mci(struct sbridge_dev *sbridge_dev)
1604 debugf0("MC: " __FILE__ ": %s(): mci = %p, dev = %p\n", 1604 debugf0("MC: " __FILE__ ": %s(): mci = %p, dev = %p\n",
1605 __func__, mci, &sbridge_dev->pdev[0]->dev); 1605 __func__, mci, &sbridge_dev->pdev[0]->dev);
1606 1606
1607 mce_unregister_decode_chain(&sbridge_mce_dec);
1608
1609 /* Remove MC sysfs nodes */ 1607 /* Remove MC sysfs nodes */
1610 edac_mc_del_mc(mci->dev); 1608 edac_mc_del_mc(mci->dev);
1611 1609
@@ -1682,7 +1680,6 @@ static int sbridge_register_mci(struct sbridge_dev *sbridge_dev)
1682 goto fail0; 1680 goto fail0;
1683 } 1681 }
1684 1682
1685 mce_register_decode_chain(&sbridge_mce_dec);
1686 return 0; 1683 return 0;
1687 1684
1688fail0: 1685fail0:
@@ -1811,8 +1808,10 @@ static int __init sbridge_init(void)
1811 1808
1812 pci_rc = pci_register_driver(&sbridge_driver); 1809 pci_rc = pci_register_driver(&sbridge_driver);
1813 1810
1814 if (pci_rc >= 0) 1811 if (pci_rc >= 0) {
1812 mce_register_decode_chain(&sbridge_mce_dec);
1815 return 0; 1813 return 0;
1814 }
1816 1815
1817 sbridge_printk(KERN_ERR, "Failed to register device with error %d.\n", 1816 sbridge_printk(KERN_ERR, "Failed to register device with error %d.\n",
1818 pci_rc); 1817 pci_rc);
@@ -1828,6 +1827,7 @@ static void __exit sbridge_exit(void)
1828{ 1827{
1829 debugf2("MC: " __FILE__ ": %s()\n", __func__); 1828 debugf2("MC: " __FILE__ ": %s()\n", __func__);
1830 pci_unregister_driver(&sbridge_driver); 1829 pci_unregister_driver(&sbridge_driver);
1830 mce_unregister_decode_chain(&sbridge_mce_dec);
1831} 1831}
1832 1832
1833module_init(sbridge_init); 1833module_init(sbridge_init);
diff --git a/drivers/extcon/extcon-max8997.c b/drivers/extcon/extcon-max8997.c
index 23416e443765..a4ed30bd9a41 100644
--- a/drivers/extcon/extcon-max8997.c
+++ b/drivers/extcon/extcon-max8997.c
@@ -116,8 +116,8 @@ const char *max8997_extcon_cable[] = {
116 [5] = "Charge-downstream", 116 [5] = "Charge-downstream",
117 [6] = "MHL", 117 [6] = "MHL",
118 [7] = "Dock-desk", 118 [7] = "Dock-desk",
119 [7] = "Dock-card", 119 [8] = "Dock-card",
120 [8] = "JIG", 120 [9] = "JIG",
121 121
122 NULL, 122 NULL,
123}; 123};
@@ -514,6 +514,7 @@ static int __devexit max8997_muic_remove(struct platform_device *pdev)
514 514
515 extcon_dev_unregister(info->edev); 515 extcon_dev_unregister(info->edev);
516 516
517 kfree(info->edev);
517 kfree(info); 518 kfree(info);
518 519
519 return 0; 520 return 0;
diff --git a/drivers/extcon/extcon_class.c b/drivers/extcon/extcon_class.c
index f598a700ec15..159aeb07b3ba 100644
--- a/drivers/extcon/extcon_class.c
+++ b/drivers/extcon/extcon_class.c
@@ -762,7 +762,7 @@ int extcon_dev_register(struct extcon_dev *edev, struct device *dev)
762#if defined(CONFIG_ANDROID) 762#if defined(CONFIG_ANDROID)
763 if (switch_class) 763 if (switch_class)
764 ret = class_compat_create_link(switch_class, edev->dev, 764 ret = class_compat_create_link(switch_class, edev->dev,
765 dev); 765 NULL);
766#endif /* CONFIG_ANDROID */ 766#endif /* CONFIG_ANDROID */
767 767
768 spin_lock_init(&edev->lock); 768 spin_lock_init(&edev->lock);
diff --git a/drivers/extcon/extcon_gpio.c b/drivers/extcon/extcon_gpio.c
index fe7a07b47336..8a0dcc11c7c7 100644
--- a/drivers/extcon/extcon_gpio.c
+++ b/drivers/extcon/extcon_gpio.c
@@ -125,6 +125,7 @@ static int __devinit gpio_extcon_probe(struct platform_device *pdev)
125 if (ret < 0) 125 if (ret < 0)
126 goto err_request_irq; 126 goto err_request_irq;
127 127
128 platform_set_drvdata(pdev, extcon_data);
128 /* Perform initial detection */ 129 /* Perform initial detection */
129 gpio_extcon_work(&extcon_data->work.work); 130 gpio_extcon_work(&extcon_data->work.work);
130 131
@@ -146,6 +147,7 @@ static int __devexit gpio_extcon_remove(struct platform_device *pdev)
146 struct gpio_extcon_data *extcon_data = platform_get_drvdata(pdev); 147 struct gpio_extcon_data *extcon_data = platform_get_drvdata(pdev);
147 148
148 cancel_delayed_work_sync(&extcon_data->work); 149 cancel_delayed_work_sync(&extcon_data->work);
150 free_irq(extcon_data->irq, extcon_data);
149 gpio_free(extcon_data->gpio); 151 gpio_free(extcon_data->gpio);
150 extcon_dev_unregister(&extcon_data->edev); 152 extcon_dev_unregister(&extcon_data->edev);
151 devm_kfree(&pdev->dev, extcon_data); 153 devm_kfree(&pdev->dev, extcon_data);
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
index f082e48ab113..70d62f5bc909 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -215,7 +215,7 @@ static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len)
215 int i; 215 int i;
216 216
217 if (send_command(cmd) || send_argument(key)) { 217 if (send_command(cmd) || send_argument(key)) {
218 pr_warn("%s: read arg fail\n", key); 218 pr_warn("%.4s: read arg fail\n", key);
219 return -EIO; 219 return -EIO;
220 } 220 }
221 221
@@ -223,7 +223,7 @@ static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len)
223 223
224 for (i = 0; i < len; i++) { 224 for (i = 0; i < len; i++) {
225 if (__wait_status(0x05)) { 225 if (__wait_status(0x05)) {
226 pr_warn("%s: read data fail\n", key); 226 pr_warn("%.4s: read data fail\n", key);
227 return -EIO; 227 return -EIO;
228 } 228 }
229 buffer[i] = inb(APPLESMC_DATA_PORT); 229 buffer[i] = inb(APPLESMC_DATA_PORT);
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index b9d512331ed4..7f1feb2f467a 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -191,6 +191,24 @@ static ssize_t show_temp(struct device *dev,
191 return tdata->valid ? sprintf(buf, "%d\n", tdata->temp) : -EAGAIN; 191 return tdata->valid ? sprintf(buf, "%d\n", tdata->temp) : -EAGAIN;
192} 192}
193 193
194struct tjmax {
195 char const *id;
196 int tjmax;
197};
198
199static struct tjmax __cpuinitconst tjmax_table[] = {
200 { "CPU D410", 100000 },
201 { "CPU D425", 100000 },
202 { "CPU D510", 100000 },
203 { "CPU D525", 100000 },
204 { "CPU N450", 100000 },
205 { "CPU N455", 100000 },
206 { "CPU N470", 100000 },
207 { "CPU N475", 100000 },
208 { "CPU 230", 100000 },
209 { "CPU 330", 125000 },
210};
211
194static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, 212static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id,
195 struct device *dev) 213 struct device *dev)
196{ 214{
@@ -202,6 +220,13 @@ static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id,
202 int err; 220 int err;
203 u32 eax, edx; 221 u32 eax, edx;
204 struct pci_dev *host_bridge; 222 struct pci_dev *host_bridge;
223 int i;
224
225 /* explicit tjmax table entries override heuristics */
226 for (i = 0; i < ARRAY_SIZE(tjmax_table); i++) {
227 if (strstr(c->x86_model_id, tjmax_table[i].id))
228 return tjmax_table[i].tjmax;
229 }
205 230
206 /* Early chips have no MSR for TjMax */ 231 /* Early chips have no MSR for TjMax */
207 232
@@ -210,7 +235,8 @@ static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id,
210 235
211 /* Atom CPUs */ 236 /* Atom CPUs */
212 237
213 if (c->x86_model == 0x1c) { 238 if (c->x86_model == 0x1c || c->x86_model == 0x26
239 || c->x86_model == 0x27) {
214 usemsr_ee = 0; 240 usemsr_ee = 0;
215 241
216 host_bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0)); 242 host_bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
@@ -223,6 +249,9 @@ static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id,
223 tjmax = 90000; 249 tjmax = 90000;
224 250
225 pci_dev_put(host_bridge); 251 pci_dev_put(host_bridge);
252 } else if (c->x86_model == 0x36) {
253 usemsr_ee = 0;
254 tjmax = 100000;
226 } 255 }
227 256
228 if (c->x86_model > 0xe && usemsr_ee) { 257 if (c->x86_model > 0xe && usemsr_ee) {
@@ -772,7 +801,7 @@ MODULE_DEVICE_TABLE(x86cpu, coretemp_ids);
772 801
773static int __init coretemp_init(void) 802static int __init coretemp_init(void)
774{ 803{
775 int i, err = -ENODEV; 804 int i, err;
776 805
777 /* 806 /*
778 * CPUID.06H.EAX[0] indicates whether the CPU has thermal 807 * CPUID.06H.EAX[0] indicates whether the CPU has thermal
diff --git a/drivers/hwmon/emc2103.c b/drivers/hwmon/emc2103.c
index 9691f664c76e..e7d234b59312 100644
--- a/drivers/hwmon/emc2103.c
+++ b/drivers/hwmon/emc2103.c
@@ -451,11 +451,15 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *da,
451 data->fan_rpm_control = true; 451 data->fan_rpm_control = true;
452 break; 452 break;
453 default: 453 default:
454 mutex_unlock(&data->update_lock); 454 count = -EINVAL;
455 return -EINVAL; 455 goto err;
456 } 456 }
457 457
458 read_u8_from_i2c(client, REG_FAN_CONF1, &conf_reg); 458 result = read_u8_from_i2c(client, REG_FAN_CONF1, &conf_reg);
459 if (result) {
460 count = result;
461 goto err;
462 }
459 463
460 if (data->fan_rpm_control) 464 if (data->fan_rpm_control)
461 conf_reg |= 0x80; 465 conf_reg |= 0x80;
@@ -463,7 +467,7 @@ static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *da,
463 conf_reg &= ~0x80; 467 conf_reg &= ~0x80;
464 468
465 i2c_smbus_write_byte_data(client, REG_FAN_CONF1, conf_reg); 469 i2c_smbus_write_byte_data(client, REG_FAN_CONF1, conf_reg);
466 470err:
467 mutex_unlock(&data->update_lock); 471 mutex_unlock(&data->update_lock);
468 return count; 472 return count;
469} 473}
diff --git a/drivers/iio/Kconfig b/drivers/iio/Kconfig
index 56eecefcec75..2ec93da41e2c 100644
--- a/drivers/iio/Kconfig
+++ b/drivers/iio/Kconfig
@@ -8,8 +8,7 @@ menuconfig IIO
8 help 8 help
9 The industrial I/O subsystem provides a unified framework for 9 The industrial I/O subsystem provides a unified framework for
10 drivers for many different types of embedded sensors using a 10 drivers for many different types of embedded sensors using a
11 number of different physical interfaces (i2c, spi, etc). See 11 number of different physical interfaces (i2c, spi, etc).
12 Documentation/iio for more information.
13 12
14if IIO 13if IIO
15 14
diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c
index 1ddd8861c71b..4f947e4377ef 100644
--- a/drivers/iio/industrialio-core.c
+++ b/drivers/iio/industrialio-core.c
@@ -661,7 +661,6 @@ static int iio_device_register_sysfs(struct iio_dev *indio_dev)
661 * New channel registration method - relies on the fact a group does 661 * New channel registration method - relies on the fact a group does
662 * not need to be initialized if it is name is NULL. 662 * not need to be initialized if it is name is NULL.
663 */ 663 */
664 INIT_LIST_HEAD(&indio_dev->channel_attr_list);
665 if (indio_dev->channels) 664 if (indio_dev->channels)
666 for (i = 0; i < indio_dev->num_channels; i++) { 665 for (i = 0; i < indio_dev->num_channels; i++) {
667 ret = iio_device_add_channel_sysfs(indio_dev, 666 ret = iio_device_add_channel_sysfs(indio_dev,
@@ -725,12 +724,16 @@ static void iio_device_unregister_sysfs(struct iio_dev *indio_dev)
725static void iio_dev_release(struct device *device) 724static void iio_dev_release(struct device *device)
726{ 725{
727 struct iio_dev *indio_dev = dev_to_iio_dev(device); 726 struct iio_dev *indio_dev = dev_to_iio_dev(device);
728 cdev_del(&indio_dev->chrdev); 727 if (indio_dev->chrdev.dev)
728 cdev_del(&indio_dev->chrdev);
729 if (indio_dev->modes & INDIO_BUFFER_TRIGGERED) 729 if (indio_dev->modes & INDIO_BUFFER_TRIGGERED)
730 iio_device_unregister_trigger_consumer(indio_dev); 730 iio_device_unregister_trigger_consumer(indio_dev);
731 iio_device_unregister_eventset(indio_dev); 731 iio_device_unregister_eventset(indio_dev);
732 iio_device_unregister_sysfs(indio_dev); 732 iio_device_unregister_sysfs(indio_dev);
733 iio_device_unregister_debugfs(indio_dev); 733 iio_device_unregister_debugfs(indio_dev);
734
735 ida_simple_remove(&iio_ida, indio_dev->id);
736 kfree(indio_dev);
734} 737}
735 738
736static struct device_type iio_dev_type = { 739static struct device_type iio_dev_type = {
@@ -761,6 +764,7 @@ struct iio_dev *iio_device_alloc(int sizeof_priv)
761 dev_set_drvdata(&dev->dev, (void *)dev); 764 dev_set_drvdata(&dev->dev, (void *)dev);
762 mutex_init(&dev->mlock); 765 mutex_init(&dev->mlock);
763 mutex_init(&dev->info_exist_lock); 766 mutex_init(&dev->info_exist_lock);
767 INIT_LIST_HEAD(&dev->channel_attr_list);
764 768
765 dev->id = ida_simple_get(&iio_ida, 0, 0, GFP_KERNEL); 769 dev->id = ida_simple_get(&iio_ida, 0, 0, GFP_KERNEL);
766 if (dev->id < 0) { 770 if (dev->id < 0) {
@@ -778,10 +782,8 @@ EXPORT_SYMBOL(iio_device_alloc);
778 782
779void iio_device_free(struct iio_dev *dev) 783void iio_device_free(struct iio_dev *dev)
780{ 784{
781 if (dev) { 785 if (dev)
782 ida_simple_remove(&iio_ida, dev->id); 786 put_device(&dev->dev);
783 kfree(dev);
784 }
785} 787}
786EXPORT_SYMBOL(iio_device_free); 788EXPORT_SYMBOL(iio_device_free);
787 789
@@ -902,7 +904,7 @@ void iio_device_unregister(struct iio_dev *indio_dev)
902 mutex_lock(&indio_dev->info_exist_lock); 904 mutex_lock(&indio_dev->info_exist_lock);
903 indio_dev->info = NULL; 905 indio_dev->info = NULL;
904 mutex_unlock(&indio_dev->info_exist_lock); 906 mutex_unlock(&indio_dev->info_exist_lock);
905 device_unregister(&indio_dev->dev); 907 device_del(&indio_dev->dev);
906} 908}
907EXPORT_SYMBOL(iio_device_unregister); 909EXPORT_SYMBOL(iio_device_unregister);
908subsys_initcall(iio_init); 910subsys_initcall(iio_init);
diff --git a/drivers/media/video/pms.c b/drivers/media/video/pms.c
index af2d9086d7e8..c370c2d87c17 100644
--- a/drivers/media/video/pms.c
+++ b/drivers/media/video/pms.c
@@ -29,6 +29,7 @@
29#include <linux/ioport.h> 29#include <linux/ioport.h>
30#include <linux/init.h> 30#include <linux/init.h>
31#include <linux/mutex.h> 31#include <linux/mutex.h>
32#include <linux/slab.h>
32#include <linux/uaccess.h> 33#include <linux/uaccess.h>
33#include <linux/isa.h> 34#include <linux/isa.h>
34#include <asm/io.h> 35#include <asm/io.h>
diff --git a/drivers/mfd/stmpe-i2c.c b/drivers/mfd/stmpe-i2c.c
index 373f423b1181..947a06a1845f 100644
--- a/drivers/mfd/stmpe-i2c.c
+++ b/drivers/mfd/stmpe-i2c.c
@@ -6,7 +6,7 @@
6 * 6 *
7 * License Terms: GNU General Public License, version 2 7 * License Terms: GNU General Public License, version 2
8 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson 8 * Author: Rabin Vincent <rabin.vincent@stericsson.com> for ST-Ericsson
9 * Author: Viresh Kumar <viresh.kumar@st.com> for ST Microelectronics 9 * Author: Viresh Kumar <viresh.linux@gmail.com> for ST Microelectronics
10 */ 10 */
11 11
12#include <linux/i2c.h> 12#include <linux/i2c.h>
diff --git a/drivers/mfd/stmpe-spi.c b/drivers/mfd/stmpe-spi.c
index afd459013ecb..9edfe864cc05 100644
--- a/drivers/mfd/stmpe-spi.c
+++ b/drivers/mfd/stmpe-spi.c
@@ -4,7 +4,7 @@
4 * Copyright (C) ST Microelectronics SA 2011 4 * Copyright (C) ST Microelectronics SA 2011
5 * 5 *
6 * License Terms: GNU General Public License, version 2 6 * License Terms: GNU General Public License, version 2
7 * Author: Viresh Kumar <viresh.kumar@st.com> for ST Microelectronics 7 * Author: Viresh Kumar <viresh.linux@gmail.com> for ST Microelectronics
8 */ 8 */
9 9
10#include <linux/spi/spi.h> 10#include <linux/spi/spi.h>
@@ -146,4 +146,4 @@ module_exit(stmpe_exit);
146 146
147MODULE_LICENSE("GPL v2"); 147MODULE_LICENSE("GPL v2");
148MODULE_DESCRIPTION("STMPE MFD SPI Interface Driver"); 148MODULE_DESCRIPTION("STMPE MFD SPI Interface Driver");
149MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); 149MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>");
diff --git a/drivers/misc/mei/interrupt.c b/drivers/misc/mei/interrupt.c
index 93936f1b75eb..23f5463d4cae 100644
--- a/drivers/misc/mei/interrupt.c
+++ b/drivers/misc/mei/interrupt.c
@@ -835,7 +835,7 @@ static int _mei_irq_thread_read(struct mei_device *dev, s32 *slots,
835 struct mei_cl *cl, 835 struct mei_cl *cl,
836 struct mei_io_list *cmpl_list) 836 struct mei_io_list *cmpl_list)
837{ 837{
838 if ((*slots * sizeof(u32)) >= (sizeof(struct mei_msg_hdr) + 838 if ((*slots * sizeof(u32)) < (sizeof(struct mei_msg_hdr) +
839 sizeof(struct hbm_flow_control))) { 839 sizeof(struct hbm_flow_control))) {
840 /* return the cancel routine */ 840 /* return the cancel routine */
841 list_del(&cb_pos->cb_list); 841 list_del(&cb_pos->cb_list);
diff --git a/drivers/misc/mei/main.c b/drivers/misc/mei/main.c
index c70333228337..7de13891e49e 100644
--- a/drivers/misc/mei/main.c
+++ b/drivers/misc/mei/main.c
@@ -982,7 +982,7 @@ static int __devinit mei_probe(struct pci_dev *pdev,
982 err = request_threaded_irq(pdev->irq, 982 err = request_threaded_irq(pdev->irq,
983 NULL, 983 NULL,
984 mei_interrupt_thread_handler, 984 mei_interrupt_thread_handler,
985 0, mei_driver_name, dev); 985 IRQF_ONESHOT, mei_driver_name, dev);
986 else 986 else
987 err = request_threaded_irq(pdev->irq, 987 err = request_threaded_irq(pdev->irq,
988 mei_interrupt_quick_handler, 988 mei_interrupt_quick_handler,
@@ -992,7 +992,7 @@ static int __devinit mei_probe(struct pci_dev *pdev,
992 if (err) { 992 if (err) {
993 dev_err(&pdev->dev, "request_threaded_irq failure. irq = %d\n", 993 dev_err(&pdev->dev, "request_threaded_irq failure. irq = %d\n",
994 pdev->irq); 994 pdev->irq);
995 goto unmap_memory; 995 goto disable_msi;
996 } 996 }
997 INIT_DELAYED_WORK(&dev->timer_work, mei_timer); 997 INIT_DELAYED_WORK(&dev->timer_work, mei_timer);
998 if (mei_hw_init(dev)) { 998 if (mei_hw_init(dev)) {
@@ -1023,8 +1023,8 @@ release_irq:
1023 mei_disable_interrupts(dev); 1023 mei_disable_interrupts(dev);
1024 flush_scheduled_work(); 1024 flush_scheduled_work();
1025 free_irq(pdev->irq, dev); 1025 free_irq(pdev->irq, dev);
1026disable_msi:
1026 pci_disable_msi(pdev); 1027 pci_disable_msi(pdev);
1027unmap_memory:
1028 pci_iounmap(pdev, dev->mem_addr); 1028 pci_iounmap(pdev, dev->mem_addr);
1029free_device: 1029free_device:
1030 kfree(dev); 1030 kfree(dev);
@@ -1101,6 +1101,8 @@ static void __devexit mei_remove(struct pci_dev *pdev)
1101 1101
1102 pci_release_regions(pdev); 1102 pci_release_regions(pdev);
1103 pci_disable_device(pdev); 1103 pci_disable_device(pdev);
1104
1105 misc_deregister(&mei_misc_device);
1104} 1106}
1105#ifdef CONFIG_PM 1107#ifdef CONFIG_PM
1106static int mei_pci_suspend(struct device *device) 1108static int mei_pci_suspend(struct device *device)
@@ -1216,7 +1218,6 @@ module_init(mei_init_module);
1216 */ 1218 */
1217static void __exit mei_exit_module(void) 1219static void __exit mei_exit_module(void)
1218{ 1220{
1219 misc_deregister(&mei_misc_device);
1220 pci_unregister_driver(&mei_driver); 1221 pci_unregister_driver(&mei_driver);
1221 1222
1222 pr_debug("unloaded successfully.\n"); 1223 pr_debug("unloaded successfully.\n");
diff --git a/drivers/misc/mei/wd.c b/drivers/misc/mei/wd.c
index 6be5605707b4..e2ec0505eb5c 100644
--- a/drivers/misc/mei/wd.c
+++ b/drivers/misc/mei/wd.c
@@ -341,7 +341,7 @@ static const struct watchdog_ops wd_ops = {
341}; 341};
342static const struct watchdog_info wd_info = { 342static const struct watchdog_info wd_info = {
343 .identity = INTEL_AMT_WATCHDOG_ID, 343 .identity = INTEL_AMT_WATCHDOG_ID,
344 .options = WDIOF_KEEPALIVEPING, 344 .options = WDIOF_KEEPALIVEPING | WDIOF_ALARMONLY,
345}; 345};
346 346
347static struct watchdog_device amt_wd_dev = { 347static struct watchdog_device amt_wd_dev = {
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 2d4a4b746750..258b203397aa 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1326,7 +1326,7 @@ static int mmc_suspend(struct mmc_host *host)
1326 if (!err) 1326 if (!err)
1327 mmc_card_set_sleep(host->card); 1327 mmc_card_set_sleep(host->card);
1328 } else if (!mmc_host_is_spi(host)) 1328 } else if (!mmc_host_is_spi(host))
1329 mmc_deselect_cards(host); 1329 err = mmc_deselect_cards(host);
1330 host->card->state &= ~(MMC_STATE_HIGHSPEED | MMC_STATE_HIGHSPEED_200); 1330 host->card->state &= ~(MMC_STATE_HIGHSPEED | MMC_STATE_HIGHSPEED_200);
1331 mmc_release_host(host); 1331 mmc_release_host(host);
1332 1332
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index c272c6868ecf..b2b43f624b9e 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -1075,16 +1075,18 @@ static void mmc_sd_detect(struct mmc_host *host)
1075 */ 1075 */
1076static int mmc_sd_suspend(struct mmc_host *host) 1076static int mmc_sd_suspend(struct mmc_host *host)
1077{ 1077{
1078 int err = 0;
1079
1078 BUG_ON(!host); 1080 BUG_ON(!host);
1079 BUG_ON(!host->card); 1081 BUG_ON(!host->card);
1080 1082
1081 mmc_claim_host(host); 1083 mmc_claim_host(host);
1082 if (!mmc_host_is_spi(host)) 1084 if (!mmc_host_is_spi(host))
1083 mmc_deselect_cards(host); 1085 err = mmc_deselect_cards(host);
1084 host->card->state &= ~MMC_STATE_HIGHSPEED; 1086 host->card->state &= ~MMC_STATE_HIGHSPEED;
1085 mmc_release_host(host); 1087 mmc_release_host(host);
1086 1088
1087 return 0; 1089 return err;
1088} 1090}
1089 1091
1090/* 1092/*
diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
index 13d0e95380ab..41c5fd8848f4 100644
--- a/drivers/mmc/core/sdio.c
+++ b/drivers/mmc/core/sdio.c
@@ -218,6 +218,12 @@ static int sdio_enable_wide(struct mmc_card *card)
218 if (ret) 218 if (ret)
219 return ret; 219 return ret;
220 220
221 if ((ctrl & SDIO_BUS_WIDTH_MASK) == SDIO_BUS_WIDTH_RESERVED)
222 pr_warning("%s: SDIO_CCCR_IF is invalid: 0x%02x\n",
223 mmc_hostname(card->host), ctrl);
224
225 /* set as 4-bit bus width */
226 ctrl &= ~SDIO_BUS_WIDTH_MASK;
221 ctrl |= SDIO_BUS_WIDTH_4BIT; 227 ctrl |= SDIO_BUS_WIDTH_4BIT;
222 228
223 ret = mmc_io_rw_direct(card, 1, 0, SDIO_CCCR_IF, ctrl, NULL); 229 ret = mmc_io_rw_direct(card, 1, 0, SDIO_CCCR_IF, ctrl, NULL);
diff --git a/drivers/mmc/host/atmel-mci-regs.h b/drivers/mmc/host/atmel-mci-regs.h
index 787aba1682bb..ab56f7db5315 100644
--- a/drivers/mmc/host/atmel-mci-regs.h
+++ b/drivers/mmc/host/atmel-mci-regs.h
@@ -140,4 +140,18 @@
140#define atmci_writel(port,reg,value) \ 140#define atmci_writel(port,reg,value) \
141 __raw_writel((value), (port)->regs + reg) 141 __raw_writel((value), (port)->regs + reg)
142 142
143/*
144 * Fix sconfig's burst size according to atmel MCI. We need to convert them as:
145 * 1 -> 0, 4 -> 1, 8 -> 2, 16 -> 3.
146 *
147 * This can be done by finding most significant bit set.
148 */
149static inline unsigned int atmci_convert_chksize(unsigned int maxburst)
150{
151 if (maxburst > 1)
152 return fls(maxburst) - 2;
153 else
154 return 0;
155}
156
143#endif /* __DRIVERS_MMC_ATMEL_MCI_H__ */ 157#endif /* __DRIVERS_MMC_ATMEL_MCI_H__ */
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 420aca642b14..f2c115e06438 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -910,6 +910,7 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data)
910 enum dma_data_direction direction; 910 enum dma_data_direction direction;
911 enum dma_transfer_direction slave_dirn; 911 enum dma_transfer_direction slave_dirn;
912 unsigned int sglen; 912 unsigned int sglen;
913 u32 maxburst;
913 u32 iflags; 914 u32 iflags;
914 915
915 data->error = -EINPROGRESS; 916 data->error = -EINPROGRESS;
@@ -943,17 +944,18 @@ atmci_prepare_data_dma(struct atmel_mci *host, struct mmc_data *data)
943 if (!chan) 944 if (!chan)
944 return -ENODEV; 945 return -ENODEV;
945 946
946 if (host->caps.has_dma)
947 atmci_writel(host, ATMCI_DMA, ATMCI_DMA_CHKSIZE(3) | ATMCI_DMAEN);
948
949 if (data->flags & MMC_DATA_READ) { 947 if (data->flags & MMC_DATA_READ) {
950 direction = DMA_FROM_DEVICE; 948 direction = DMA_FROM_DEVICE;
951 host->dma_conf.direction = slave_dirn = DMA_DEV_TO_MEM; 949 host->dma_conf.direction = slave_dirn = DMA_DEV_TO_MEM;
950 maxburst = atmci_convert_chksize(host->dma_conf.src_maxburst);
952 } else { 951 } else {
953 direction = DMA_TO_DEVICE; 952 direction = DMA_TO_DEVICE;
954 host->dma_conf.direction = slave_dirn = DMA_MEM_TO_DEV; 953 host->dma_conf.direction = slave_dirn = DMA_MEM_TO_DEV;
954 maxburst = atmci_convert_chksize(host->dma_conf.dst_maxburst);
955 } 955 }
956 956
957 atmci_writel(host, ATMCI_DMA, ATMCI_DMA_CHKSIZE(maxburst) | ATMCI_DMAEN);
958
957 sglen = dma_map_sg(chan->device->dev, data->sg, 959 sglen = dma_map_sg(chan->device->dev, data->sg,
958 data->sg_len, direction); 960 data->sg_len, direction);
959 961
@@ -2314,6 +2316,8 @@ static int __init atmci_probe(struct platform_device *pdev)
2314 2316
2315 platform_set_drvdata(pdev, host); 2317 platform_set_drvdata(pdev, host);
2316 2318
2319 setup_timer(&host->timer, atmci_timeout_timer, (unsigned long)host);
2320
2317 /* We need at least one slot to succeed */ 2321 /* We need at least one slot to succeed */
2318 nr_slots = 0; 2322 nr_slots = 0;
2319 ret = -ENODEV; 2323 ret = -ENODEV;
@@ -2352,8 +2356,6 @@ static int __init atmci_probe(struct platform_device *pdev)
2352 } 2356 }
2353 } 2357 }
2354 2358
2355 setup_timer(&host->timer, atmci_timeout_timer, (unsigned long)host);
2356
2357 dev_info(&pdev->dev, 2359 dev_info(&pdev->dev,
2358 "Atmel MCI controller at 0x%08lx irq %d, %u slots\n", 2360 "Atmel MCI controller at 0x%08lx irq %d, %u slots\n",
2359 host->mapbase, irq, nr_slots); 2361 host->mapbase, irq, nr_slots);
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
index 9bbf45f8c538..1ca5e72ceb65 100644
--- a/drivers/mmc/host/dw_mmc.c
+++ b/drivers/mmc/host/dw_mmc.c
@@ -418,6 +418,8 @@ static int dw_mci_idmac_init(struct dw_mci *host)
418 p->des3 = host->sg_dma; 418 p->des3 = host->sg_dma;
419 p->des0 = IDMAC_DES0_ER; 419 p->des0 = IDMAC_DES0_ER;
420 420
421 mci_writel(host, BMOD, SDMMC_IDMAC_SWRESET);
422
421 /* Mask out interrupts - get Tx & Rx complete only */ 423 /* Mask out interrupts - get Tx & Rx complete only */
422 mci_writel(host, IDINTEN, SDMMC_IDMAC_INT_NI | SDMMC_IDMAC_INT_RI | 424 mci_writel(host, IDINTEN, SDMMC_IDMAC_INT_NI | SDMMC_IDMAC_INT_RI |
423 SDMMC_IDMAC_INT_TI); 425 SDMMC_IDMAC_INT_TI);
@@ -615,14 +617,15 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot)
615 u32 div; 617 u32 div;
616 618
617 if (slot->clock != host->current_speed) { 619 if (slot->clock != host->current_speed) {
618 if (host->bus_hz % slot->clock) 620 div = host->bus_hz / slot->clock;
621 if (host->bus_hz % slot->clock && host->bus_hz > slot->clock)
619 /* 622 /*
620 * move the + 1 after the divide to prevent 623 * move the + 1 after the divide to prevent
621 * over-clocking the card. 624 * over-clocking the card.
622 */ 625 */
623 div = ((host->bus_hz / slot->clock) >> 1) + 1; 626 div += 1;
624 else 627
625 div = (host->bus_hz / slot->clock) >> 1; 628 div = (host->bus_hz != slot->clock) ? DIV_ROUND_UP(div, 2) : 0;
626 629
627 dev_info(&slot->mmc->class_dev, 630 dev_info(&slot->mmc->class_dev,
628 "Bus speed (slot %d) = %dHz (slot req %dHz, actual %dHZ" 631 "Bus speed (slot %d) = %dHz (slot req %dHz, actual %dHZ"
@@ -939,8 +942,8 @@ static void dw_mci_command_complete(struct dw_mci *host, struct mmc_command *cmd
939 mdelay(20); 942 mdelay(20);
940 943
941 if (cmd->data) { 944 if (cmd->data) {
942 host->data = NULL;
943 dw_mci_stop_dma(host); 945 dw_mci_stop_dma(host);
946 host->data = NULL;
944 } 947 }
945 } 948 }
946} 949}
@@ -1623,7 +1626,6 @@ static irqreturn_t dw_mci_interrupt(int irq, void *dev_id)
1623 if (pending & (SDMMC_IDMAC_INT_TI | SDMMC_IDMAC_INT_RI)) { 1626 if (pending & (SDMMC_IDMAC_INT_TI | SDMMC_IDMAC_INT_RI)) {
1624 mci_writel(host, IDSTS, SDMMC_IDMAC_INT_TI | SDMMC_IDMAC_INT_RI); 1627 mci_writel(host, IDSTS, SDMMC_IDMAC_INT_TI | SDMMC_IDMAC_INT_RI);
1625 mci_writel(host, IDSTS, SDMMC_IDMAC_INT_NI); 1628 mci_writel(host, IDSTS, SDMMC_IDMAC_INT_NI);
1626 set_bit(EVENT_DATA_COMPLETE, &host->pending_events);
1627 host->dma_ops->complete(host); 1629 host->dma_ops->complete(host);
1628 } 1630 }
1629#endif 1631#endif
@@ -1725,7 +1727,8 @@ static void dw_mci_work_routine_card(struct work_struct *work)
1725 1727
1726#ifdef CONFIG_MMC_DW_IDMAC 1728#ifdef CONFIG_MMC_DW_IDMAC
1727 ctrl = mci_readl(host, BMOD); 1729 ctrl = mci_readl(host, BMOD);
1728 ctrl |= 0x01; /* Software reset of DMA */ 1730 /* Software reset of DMA */
1731 ctrl |= SDMMC_IDMAC_SWRESET;
1729 mci_writel(host, BMOD, ctrl); 1732 mci_writel(host, BMOD, ctrl);
1730#endif 1733#endif
1731 1734
@@ -1950,10 +1953,6 @@ int dw_mci_probe(struct dw_mci *host)
1950 spin_lock_init(&host->lock); 1953 spin_lock_init(&host->lock);
1951 INIT_LIST_HEAD(&host->queue); 1954 INIT_LIST_HEAD(&host->queue);
1952 1955
1953
1954 host->dma_ops = host->pdata->dma_ops;
1955 dw_mci_init_dma(host);
1956
1957 /* 1956 /*
1958 * Get the host data width - this assumes that HCON has been set with 1957 * Get the host data width - this assumes that HCON has been set with
1959 * the correct values. 1958 * the correct values.
@@ -1981,10 +1980,11 @@ int dw_mci_probe(struct dw_mci *host)
1981 } 1980 }
1982 1981
1983 /* Reset all blocks */ 1982 /* Reset all blocks */
1984 if (!mci_wait_reset(&host->dev, host)) { 1983 if (!mci_wait_reset(&host->dev, host))
1985 ret = -ENODEV; 1984 return -ENODEV;
1986 goto err_dmaunmap; 1985
1987 } 1986 host->dma_ops = host->pdata->dma_ops;
1987 dw_mci_init_dma(host);
1988 1988
1989 /* Clear the interrupts for the host controller */ 1989 /* Clear the interrupts for the host controller */
1990 mci_writel(host, RINTSTS, 0xFFFFFFFF); 1990 mci_writel(host, RINTSTS, 0xFFFFFFFF);
@@ -2170,14 +2170,14 @@ int dw_mci_resume(struct dw_mci *host)
2170 if (host->vmmc) 2170 if (host->vmmc)
2171 regulator_enable(host->vmmc); 2171 regulator_enable(host->vmmc);
2172 2172
2173 if (host->dma_ops->init)
2174 host->dma_ops->init(host);
2175
2176 if (!mci_wait_reset(&host->dev, host)) { 2173 if (!mci_wait_reset(&host->dev, host)) {
2177 ret = -ENODEV; 2174 ret = -ENODEV;
2178 return ret; 2175 return ret;
2179 } 2176 }
2180 2177
2178 if (host->dma_ops->init)
2179 host->dma_ops->init(host);
2180
2181 /* Restore the old value at FIFOTH register */ 2181 /* Restore the old value at FIFOTH register */
2182 mci_writel(host, FIFOTH, host->fifoth_val); 2182 mci_writel(host, FIFOTH, host->fifoth_val);
2183 2183
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index f0fcce40cd8d..50ff19a62368 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1216,12 +1216,7 @@ static void mmci_dt_populate_generic_pdata(struct device_node *np,
1216 int bus_width = 0; 1216 int bus_width = 0;
1217 1217
1218 pdata->gpio_wp = of_get_named_gpio(np, "wp-gpios", 0); 1218 pdata->gpio_wp = of_get_named_gpio(np, "wp-gpios", 0);
1219 if (!pdata->gpio_wp)
1220 pdata->gpio_wp = -1;
1221
1222 pdata->gpio_cd = of_get_named_gpio(np, "cd-gpios", 0); 1219 pdata->gpio_cd = of_get_named_gpio(np, "cd-gpios", 0);
1223 if (!pdata->gpio_cd)
1224 pdata->gpio_cd = -1;
1225 1220
1226 if (of_get_property(np, "cd-inverted", NULL)) 1221 if (of_get_property(np, "cd-inverted", NULL))
1227 pdata->cd_invert = true; 1222 pdata->cd_invert = true;
@@ -1276,6 +1271,12 @@ static int __devinit mmci_probe(struct amba_device *dev,
1276 return -EINVAL; 1271 return -EINVAL;
1277 } 1272 }
1278 1273
1274 if (!plat) {
1275 plat = devm_kzalloc(&dev->dev, sizeof(*plat), GFP_KERNEL);
1276 if (!plat)
1277 return -ENOMEM;
1278 }
1279
1279 if (np) 1280 if (np)
1280 mmci_dt_populate_generic_pdata(np, plat); 1281 mmci_dt_populate_generic_pdata(np, plat);
1281 1282
@@ -1424,6 +1425,10 @@ static int __devinit mmci_probe(struct amba_device *dev,
1424 writel(0, host->base + MMCIMASK1); 1425 writel(0, host->base + MMCIMASK1);
1425 writel(0xfff, host->base + MMCICLEAR); 1426 writel(0xfff, host->base + MMCICLEAR);
1426 1427
1428 if (plat->gpio_cd == -EPROBE_DEFER) {
1429 ret = -EPROBE_DEFER;
1430 goto err_gpio_cd;
1431 }
1427 if (gpio_is_valid(plat->gpio_cd)) { 1432 if (gpio_is_valid(plat->gpio_cd)) {
1428 ret = gpio_request(plat->gpio_cd, DRIVER_NAME " (cd)"); 1433 ret = gpio_request(plat->gpio_cd, DRIVER_NAME " (cd)");
1429 if (ret == 0) 1434 if (ret == 0)
@@ -1447,6 +1452,10 @@ static int __devinit mmci_probe(struct amba_device *dev,
1447 if (ret >= 0) 1452 if (ret >= 0)
1448 host->gpio_cd_irq = gpio_to_irq(plat->gpio_cd); 1453 host->gpio_cd_irq = gpio_to_irq(plat->gpio_cd);
1449 } 1454 }
1455 if (plat->gpio_wp == -EPROBE_DEFER) {
1456 ret = -EPROBE_DEFER;
1457 goto err_gpio_wp;
1458 }
1450 if (gpio_is_valid(plat->gpio_wp)) { 1459 if (gpio_is_valid(plat->gpio_wp)) {
1451 ret = gpio_request(plat->gpio_wp, DRIVER_NAME " (wp)"); 1460 ret = gpio_request(plat->gpio_wp, DRIVER_NAME " (wp)");
1452 if (ret == 0) 1461 if (ret == 0)
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 34a90266ab11..277161d279b8 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -894,8 +894,8 @@ static struct platform_driver mxs_mmc_driver = {
894 .owner = THIS_MODULE, 894 .owner = THIS_MODULE,
895#ifdef CONFIG_PM 895#ifdef CONFIG_PM
896 .pm = &mxs_mmc_pm_ops, 896 .pm = &mxs_mmc_pm_ops,
897 .of_match_table = mxs_mmc_dt_ids,
898#endif 897#endif
898 .of_match_table = mxs_mmc_dt_ids,
899 }, 899 },
900}; 900};
901 901
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index 552196c764d4..3e8dcf8d2e05 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -1300,7 +1300,7 @@ static const struct mmc_host_ops mmc_omap_ops = {
1300 .set_ios = mmc_omap_set_ios, 1300 .set_ios = mmc_omap_set_ios,
1301}; 1301};
1302 1302
1303static int __init mmc_omap_new_slot(struct mmc_omap_host *host, int id) 1303static int __devinit mmc_omap_new_slot(struct mmc_omap_host *host, int id)
1304{ 1304{
1305 struct mmc_omap_slot *slot = NULL; 1305 struct mmc_omap_slot *slot = NULL;
1306 struct mmc_host *mmc; 1306 struct mmc_host *mmc;
@@ -1485,24 +1485,26 @@ static int __devinit mmc_omap_probe(struct platform_device *pdev)
1485 } 1485 }
1486 1486
1487 host->nr_slots = pdata->nr_slots; 1487 host->nr_slots = pdata->nr_slots;
1488 host->reg_shift = (cpu_is_omap7xx() ? 1 : 2);
1489
1490 host->mmc_omap_wq = alloc_workqueue("mmc_omap", 0, 0);
1491 if (!host->mmc_omap_wq)
1492 goto err_plat_cleanup;
1493
1488 for (i = 0; i < pdata->nr_slots; i++) { 1494 for (i = 0; i < pdata->nr_slots; i++) {
1489 ret = mmc_omap_new_slot(host, i); 1495 ret = mmc_omap_new_slot(host, i);
1490 if (ret < 0) { 1496 if (ret < 0) {
1491 while (--i >= 0) 1497 while (--i >= 0)
1492 mmc_omap_remove_slot(host->slots[i]); 1498 mmc_omap_remove_slot(host->slots[i]);
1493 1499
1494 goto err_plat_cleanup; 1500 goto err_destroy_wq;
1495 } 1501 }
1496 } 1502 }
1497 1503
1498 host->reg_shift = (cpu_is_omap7xx() ? 1 : 2);
1499
1500 host->mmc_omap_wq = alloc_workqueue("mmc_omap", 0, 0);
1501 if (!host->mmc_omap_wq)
1502 goto err_plat_cleanup;
1503
1504 return 0; 1504 return 0;
1505 1505
1506err_destroy_wq:
1507 destroy_workqueue(host->mmc_omap_wq);
1506err_plat_cleanup: 1508err_plat_cleanup:
1507 if (pdata->cleanup) 1509 if (pdata->cleanup)
1508 pdata->cleanup(&pdev->dev); 1510 pdata->cleanup(&pdev->dev);
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 55a164fcaa15..a50c205ea208 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -404,7 +404,7 @@ static void sdhci_s3c_setup_card_detect_gpio(struct sdhci_s3c *sc)
404 if (sc->ext_cd_irq && 404 if (sc->ext_cd_irq &&
405 request_threaded_irq(sc->ext_cd_irq, NULL, 405 request_threaded_irq(sc->ext_cd_irq, NULL,
406 sdhci_s3c_gpio_card_detect_thread, 406 sdhci_s3c_gpio_card_detect_thread,
407 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, 407 IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
408 dev_name(dev), sc) == 0) { 408 dev_name(dev), sc) == 0) {
409 int status = gpio_get_value(sc->ext_cd_gpio); 409 int status = gpio_get_value(sc->ext_cd_gpio);
410 if (pdata->ext_cd_gpio_invert) 410 if (pdata->ext_cd_gpio_invert)
diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
index 1fe32dfa7cd4..423da8194cd8 100644
--- a/drivers/mmc/host/sdhci-spear.c
+++ b/drivers/mmc/host/sdhci-spear.c
@@ -4,7 +4,7 @@
4 * Support of SDHCI platform devices for spear soc family 4 * Support of SDHCI platform devices for spear soc family
5 * 5 *
6 * Copyright (C) 2010 ST Microelectronics 6 * Copyright (C) 2010 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com> 7 * Viresh Kumar <viresh.linux@gmail.com>
8 * 8 *
9 * Inspired by sdhci-pltfm.c 9 * Inspired by sdhci-pltfm.c
10 * 10 *
@@ -289,5 +289,5 @@ static struct platform_driver sdhci_driver = {
289module_platform_driver(sdhci_driver); 289module_platform_driver(sdhci_driver);
290 290
291MODULE_DESCRIPTION("SPEAr Secure Digital Host Controller Interface driver"); 291MODULE_DESCRIPTION("SPEAr Secure Digital Host Controller Interface driver");
292MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); 292MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>");
293MODULE_LICENSE("GPL v2"); 293MODULE_LICENSE("GPL v2");
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index e626732aff77..f4b8b4db3a9a 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -680,8 +680,8 @@ static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd)
680 } 680 }
681 681
682 if (count >= 0xF) { 682 if (count >= 0xF) {
683 pr_warning("%s: Too large timeout 0x%x requested for CMD%d!\n", 683 DBG("%s: Too large timeout 0x%x requested for CMD%d!\n",
684 mmc_hostname(host->mmc), count, cmd->opcode); 684 mmc_hostname(host->mmc), count, cmd->opcode);
685 count = 0xE; 685 count = 0xE;
686 } 686 }
687 687
diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
index ae36d7e1e913..551e316e4454 100644
--- a/drivers/mtd/mtdoops.c
+++ b/drivers/mtd/mtdoops.c
@@ -304,32 +304,17 @@ static void find_next_position(struct mtdoops_context *cxt)
304} 304}
305 305
306static void mtdoops_do_dump(struct kmsg_dumper *dumper, 306static void mtdoops_do_dump(struct kmsg_dumper *dumper,
307 enum kmsg_dump_reason reason, const char *s1, unsigned long l1, 307 enum kmsg_dump_reason reason)
308 const char *s2, unsigned long l2)
309{ 308{
310 struct mtdoops_context *cxt = container_of(dumper, 309 struct mtdoops_context *cxt = container_of(dumper,
311 struct mtdoops_context, dump); 310 struct mtdoops_context, dump);
312 unsigned long s1_start, s2_start;
313 unsigned long l1_cpy, l2_cpy;
314 char *dst;
315
316 if (reason != KMSG_DUMP_OOPS &&
317 reason != KMSG_DUMP_PANIC)
318 return;
319 311
320 /* Only dump oopses if dump_oops is set */ 312 /* Only dump oopses if dump_oops is set */
321 if (reason == KMSG_DUMP_OOPS && !dump_oops) 313 if (reason == KMSG_DUMP_OOPS && !dump_oops)
322 return; 314 return;
323 315
324 dst = cxt->oops_buf + MTDOOPS_HEADER_SIZE; /* Skip the header */ 316 kmsg_dump_get_buffer(dumper, true, cxt->oops_buf + MTDOOPS_HEADER_SIZE,
325 l2_cpy = min(l2, record_size - MTDOOPS_HEADER_SIZE); 317 record_size - MTDOOPS_HEADER_SIZE, NULL);
326 l1_cpy = min(l1, record_size - MTDOOPS_HEADER_SIZE - l2_cpy);
327
328 s2_start = l2 - l2_cpy;
329 s1_start = l1 - l1_cpy;
330
331 memcpy(dst, s1 + s1_start, l1_cpy);
332 memcpy(dst + l1_cpy, s2 + s2_start, l2_cpy);
333 318
334 /* Panics must be written immediately */ 319 /* Panics must be written immediately */
335 if (reason != KMSG_DUMP_OOPS) 320 if (reason != KMSG_DUMP_OOPS)
@@ -375,6 +360,7 @@ static void mtdoops_notify_add(struct mtd_info *mtd)
375 return; 360 return;
376 } 361 }
377 362
363 cxt->dump.max_reason = KMSG_DUMP_OOPS;
378 cxt->dump.dump = mtdoops_do_dump; 364 cxt->dump.dump = mtdoops_do_dump;
379 err = kmsg_dump_register(&cxt->dump); 365 err = kmsg_dump_register(&cxt->dump);
380 if (err) { 366 if (err) {
diff --git a/drivers/pinctrl/pinctrl-mxs.c b/drivers/pinctrl/pinctrl-mxs.c
index afb50ee64598..4ba4636b6a4a 100644
--- a/drivers/pinctrl/pinctrl-mxs.c
+++ b/drivers/pinctrl/pinctrl-mxs.c
@@ -137,7 +137,7 @@ static int mxs_dt_node_to_map(struct pinctrl_dev *pctldev,
137 137
138free_group: 138free_group:
139 if (!purecfg) 139 if (!purecfg)
140 free(group); 140 kfree(group);
141free: 141free:
142 kfree(new_map); 142 kfree(new_map);
143 return ret; 143 return ret;
diff --git a/drivers/pinctrl/pinctrl-nomadik.c b/drivers/pinctrl/pinctrl-nomadik.c
index e8937e7e4999..3e7e47d6b385 100644
--- a/drivers/pinctrl/pinctrl-nomadik.c
+++ b/drivers/pinctrl/pinctrl-nomadik.c
@@ -1438,7 +1438,27 @@ static int nmk_pmx_enable(struct pinctrl_dev *pctldev, unsigned function,
1438 1438
1439 dev_dbg(npct->dev, "enable group %s, %u pins\n", g->name, g->npins); 1439 dev_dbg(npct->dev, "enable group %s, %u pins\n", g->name, g->npins);
1440 1440
1441 /* Handle this special glitch on altfunction C */ 1441 /*
1442 * If we're setting altfunc C by setting both AFSLA and AFSLB to 1,
1443 * we may pass through an undesired state. In this case we take
1444 * some extra care.
1445 *
1446 * Safe sequence used to switch IOs between GPIO and Alternate-C mode:
1447 * - Save SLPM registers (since we have a shadow register in the
1448 * nmk_chip we're using that as backup)
1449 * - Set SLPM=0 for the IOs you want to switch and others to 1
1450 * - Configure the GPIO registers for the IOs that are being switched
1451 * - Set IOFORCE=1
1452 * - Modify the AFLSA/B registers for the IOs that are being switched
1453 * - Set IOFORCE=0
1454 * - Restore SLPM registers
1455 * - Any spurious wake up event during switch sequence to be ignored
1456 * and cleared
1457 *
1458 * We REALLY need to save ALL slpm registers, because the external
1459 * IOFORCE will switch *all* ports to their sleepmode setting to as
1460 * to avoid glitches. (Not just one port!)
1461 */
1442 glitch = (g->altsetting == NMK_GPIO_ALT_C); 1462 glitch = (g->altsetting == NMK_GPIO_ALT_C);
1443 1463
1444 if (glitch) { 1464 if (glitch) {
diff --git a/drivers/pinctrl/spear/pinctrl-spear.c b/drivers/pinctrl/spear/pinctrl-spear.c
index 5ae50aadf885..b3f6b2873fdd 100644
--- a/drivers/pinctrl/spear/pinctrl-spear.c
+++ b/drivers/pinctrl/spear/pinctrl-spear.c
@@ -2,7 +2,7 @@
2 * Driver for the ST Microelectronics SPEAr pinmux 2 * Driver for the ST Microelectronics SPEAr pinmux
3 * 3 *
4 * Copyright (C) 2012 ST Microelectronics 4 * Copyright (C) 2012 ST Microelectronics
5 * Viresh Kumar <viresh.kumar@st.com> 5 * Viresh Kumar <viresh.linux@gmail.com>
6 * 6 *
7 * Inspired from: 7 * Inspired from:
8 * - U300 Pinctl drivers 8 * - U300 Pinctl drivers
diff --git a/drivers/pinctrl/spear/pinctrl-spear.h b/drivers/pinctrl/spear/pinctrl-spear.h
index 9155783bb47f..d950eb78d939 100644
--- a/drivers/pinctrl/spear/pinctrl-spear.h
+++ b/drivers/pinctrl/spear/pinctrl-spear.h
@@ -2,7 +2,7 @@
2 * Driver header file for the ST Microelectronics SPEAr pinmux 2 * Driver header file for the ST Microelectronics SPEAr pinmux
3 * 3 *
4 * Copyright (C) 2012 ST Microelectronics 4 * Copyright (C) 2012 ST Microelectronics
5 * Viresh Kumar <viresh.kumar@st.com> 5 * Viresh Kumar <viresh.linux@gmail.com>
6 * 6 *
7 * This file is licensed under the terms of the GNU General Public 7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any 8 * License version 2. This program is licensed "as is" without any
diff --git a/drivers/pinctrl/spear/pinctrl-spear1310.c b/drivers/pinctrl/spear/pinctrl-spear1310.c
index fff168be7f00..d6cca8c81b92 100644
--- a/drivers/pinctrl/spear/pinctrl-spear1310.c
+++ b/drivers/pinctrl/spear/pinctrl-spear1310.c
@@ -2,7 +2,7 @@
2 * Driver for the ST Microelectronics SPEAr1310 pinmux 2 * Driver for the ST Microelectronics SPEAr1310 pinmux
3 * 3 *
4 * Copyright (C) 2012 ST Microelectronics 4 * Copyright (C) 2012 ST Microelectronics
5 * Viresh Kumar <viresh.kumar@st.com> 5 * Viresh Kumar <viresh.linux@gmail.com>
6 * 6 *
7 * This file is licensed under the terms of the GNU General Public 7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any 8 * License version 2. This program is licensed "as is" without any
@@ -2192,7 +2192,7 @@ static void __exit spear1310_pinctrl_exit(void)
2192} 2192}
2193module_exit(spear1310_pinctrl_exit); 2193module_exit(spear1310_pinctrl_exit);
2194 2194
2195MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); 2195MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>");
2196MODULE_DESCRIPTION("ST Microelectronics SPEAr1310 pinctrl driver"); 2196MODULE_DESCRIPTION("ST Microelectronics SPEAr1310 pinctrl driver");
2197MODULE_LICENSE("GPL v2"); 2197MODULE_LICENSE("GPL v2");
2198MODULE_DEVICE_TABLE(of, spear1310_pinctrl_of_match); 2198MODULE_DEVICE_TABLE(of, spear1310_pinctrl_of_match);
diff --git a/drivers/pinctrl/spear/pinctrl-spear1340.c b/drivers/pinctrl/spear/pinctrl-spear1340.c
index a8ab2a6f51bf..a0eb057e55bd 100644
--- a/drivers/pinctrl/spear/pinctrl-spear1340.c
+++ b/drivers/pinctrl/spear/pinctrl-spear1340.c
@@ -2,7 +2,7 @@
2 * Driver for the ST Microelectronics SPEAr1340 pinmux 2 * Driver for the ST Microelectronics SPEAr1340 pinmux
3 * 3 *
4 * Copyright (C) 2012 ST Microelectronics 4 * Copyright (C) 2012 ST Microelectronics
5 * Viresh Kumar <viresh.kumar@st.com> 5 * Viresh Kumar <viresh.linux@gmail.com>
6 * 6 *
7 * This file is licensed under the terms of the GNU General Public 7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any 8 * License version 2. This program is licensed "as is" without any
@@ -1983,7 +1983,7 @@ static void __exit spear1340_pinctrl_exit(void)
1983} 1983}
1984module_exit(spear1340_pinctrl_exit); 1984module_exit(spear1340_pinctrl_exit);
1985 1985
1986MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); 1986MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>");
1987MODULE_DESCRIPTION("ST Microelectronics SPEAr1340 pinctrl driver"); 1987MODULE_DESCRIPTION("ST Microelectronics SPEAr1340 pinctrl driver");
1988MODULE_LICENSE("GPL v2"); 1988MODULE_LICENSE("GPL v2");
1989MODULE_DEVICE_TABLE(of, spear1340_pinctrl_of_match); 1989MODULE_DEVICE_TABLE(of, spear1340_pinctrl_of_match);
diff --git a/drivers/pinctrl/spear/pinctrl-spear300.c b/drivers/pinctrl/spear/pinctrl-spear300.c
index 9c82a35e4e78..4dfc2849b172 100644
--- a/drivers/pinctrl/spear/pinctrl-spear300.c
+++ b/drivers/pinctrl/spear/pinctrl-spear300.c
@@ -2,7 +2,7 @@
2 * Driver for the ST Microelectronics SPEAr300 pinmux 2 * Driver for the ST Microelectronics SPEAr300 pinmux
3 * 3 *
4 * Copyright (C) 2012 ST Microelectronics 4 * Copyright (C) 2012 ST Microelectronics
5 * Viresh Kumar <viresh.kumar@st.com> 5 * Viresh Kumar <viresh.linux@gmail.com>
6 * 6 *
7 * This file is licensed under the terms of the GNU General Public 7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any 8 * License version 2. This program is licensed "as is" without any
@@ -702,7 +702,7 @@ static void __exit spear300_pinctrl_exit(void)
702} 702}
703module_exit(spear300_pinctrl_exit); 703module_exit(spear300_pinctrl_exit);
704 704
705MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); 705MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>");
706MODULE_DESCRIPTION("ST Microelectronics SPEAr300 pinctrl driver"); 706MODULE_DESCRIPTION("ST Microelectronics SPEAr300 pinctrl driver");
707MODULE_LICENSE("GPL v2"); 707MODULE_LICENSE("GPL v2");
708MODULE_DEVICE_TABLE(of, spear300_pinctrl_of_match); 708MODULE_DEVICE_TABLE(of, spear300_pinctrl_of_match);
diff --git a/drivers/pinctrl/spear/pinctrl-spear310.c b/drivers/pinctrl/spear/pinctrl-spear310.c
index 1a9707605125..96883693fb7e 100644
--- a/drivers/pinctrl/spear/pinctrl-spear310.c
+++ b/drivers/pinctrl/spear/pinctrl-spear310.c
@@ -2,7 +2,7 @@
2 * Driver for the ST Microelectronics SPEAr310 pinmux 2 * Driver for the ST Microelectronics SPEAr310 pinmux
3 * 3 *
4 * Copyright (C) 2012 ST Microelectronics 4 * Copyright (C) 2012 ST Microelectronics
5 * Viresh Kumar <viresh.kumar@st.com> 5 * Viresh Kumar <viresh.linux@gmail.com>
6 * 6 *
7 * This file is licensed under the terms of the GNU General Public 7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any 8 * License version 2. This program is licensed "as is" without any
@@ -425,7 +425,7 @@ static void __exit spear310_pinctrl_exit(void)
425} 425}
426module_exit(spear310_pinctrl_exit); 426module_exit(spear310_pinctrl_exit);
427 427
428MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); 428MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>");
429MODULE_DESCRIPTION("ST Microelectronics SPEAr310 pinctrl driver"); 429MODULE_DESCRIPTION("ST Microelectronics SPEAr310 pinctrl driver");
430MODULE_LICENSE("GPL v2"); 430MODULE_LICENSE("GPL v2");
431MODULE_DEVICE_TABLE(of, SPEAr310_pinctrl_of_match); 431MODULE_DEVICE_TABLE(of, SPEAr310_pinctrl_of_match);
diff --git a/drivers/pinctrl/spear/pinctrl-spear320.c b/drivers/pinctrl/spear/pinctrl-spear320.c
index de726e6c283a..020b1e0bdb3e 100644
--- a/drivers/pinctrl/spear/pinctrl-spear320.c
+++ b/drivers/pinctrl/spear/pinctrl-spear320.c
@@ -2,7 +2,7 @@
2 * Driver for the ST Microelectronics SPEAr320 pinmux 2 * Driver for the ST Microelectronics SPEAr320 pinmux
3 * 3 *
4 * Copyright (C) 2012 ST Microelectronics 4 * Copyright (C) 2012 ST Microelectronics
5 * Viresh Kumar <viresh.kumar@st.com> 5 * Viresh Kumar <viresh.linux@gmail.com>
6 * 6 *
7 * This file is licensed under the terms of the GNU General Public 7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any 8 * License version 2. This program is licensed "as is" without any
@@ -3462,7 +3462,7 @@ static void __exit spear320_pinctrl_exit(void)
3462} 3462}
3463module_exit(spear320_pinctrl_exit); 3463module_exit(spear320_pinctrl_exit);
3464 3464
3465MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); 3465MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>");
3466MODULE_DESCRIPTION("ST Microelectronics SPEAr320 pinctrl driver"); 3466MODULE_DESCRIPTION("ST Microelectronics SPEAr320 pinctrl driver");
3467MODULE_LICENSE("GPL v2"); 3467MODULE_LICENSE("GPL v2");
3468MODULE_DEVICE_TABLE(of, spear320_pinctrl_of_match); 3468MODULE_DEVICE_TABLE(of, spear320_pinctrl_of_match);
diff --git a/drivers/pinctrl/spear/pinctrl-spear3xx.c b/drivers/pinctrl/spear/pinctrl-spear3xx.c
index 91c883bc46a6..0242378f7cb8 100644
--- a/drivers/pinctrl/spear/pinctrl-spear3xx.c
+++ b/drivers/pinctrl/spear/pinctrl-spear3xx.c
@@ -2,7 +2,7 @@
2 * Driver for the ST Microelectronics SPEAr3xx pinmux 2 * Driver for the ST Microelectronics SPEAr3xx pinmux
3 * 3 *
4 * Copyright (C) 2012 ST Microelectronics 4 * Copyright (C) 2012 ST Microelectronics
5 * Viresh Kumar <viresh.kumar@st.com> 5 * Viresh Kumar <viresh.linux@gmail.com>
6 * 6 *
7 * This file is licensed under the terms of the GNU General Public 7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any 8 * License version 2. This program is licensed "as is" without any
diff --git a/drivers/pinctrl/spear/pinctrl-spear3xx.h b/drivers/pinctrl/spear/pinctrl-spear3xx.h
index 5d5fdd8df7b8..31f44347f17c 100644
--- a/drivers/pinctrl/spear/pinctrl-spear3xx.h
+++ b/drivers/pinctrl/spear/pinctrl-spear3xx.h
@@ -2,7 +2,7 @@
2 * Header file for the ST Microelectronics SPEAr3xx pinmux 2 * Header file for the ST Microelectronics SPEAr3xx pinmux
3 * 3 *
4 * Copyright (C) 2012 ST Microelectronics 4 * Copyright (C) 2012 ST Microelectronics
5 * Viresh Kumar <viresh.kumar@st.com> 5 * Viresh Kumar <viresh.linux@gmail.com>
6 * 6 *
7 * This file is licensed under the terms of the GNU General Public 7 * This file is licensed under the terms of the GNU General Public
8 * License version 2. This program is licensed "as is" without any 8 * License version 2. This program is licensed "as is" without any
diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index e1b8c54ace5a..a739f5ca936a 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -794,17 +794,17 @@ static __devinit int ab8500_regulator_register(struct platform_device *pdev,
794} 794}
795 795
796static struct of_regulator_match ab8500_regulator_matches[] = { 796static struct of_regulator_match ab8500_regulator_matches[] = {
797 { .name = "LDO-AUX1", .driver_data = (void *) AB8500_LDO_AUX1, }, 797 { .name = "ab8500_ldo_aux1", .driver_data = (void *) AB8500_LDO_AUX1, },
798 { .name = "LDO-AUX2", .driver_data = (void *) AB8500_LDO_AUX2, }, 798 { .name = "ab8500_ldo_aux2", .driver_data = (void *) AB8500_LDO_AUX2, },
799 { .name = "LDO-AUX3", .driver_data = (void *) AB8500_LDO_AUX3, }, 799 { .name = "ab8500_ldo_aux3", .driver_data = (void *) AB8500_LDO_AUX3, },
800 { .name = "LDO-INTCORE", .driver_data = (void *) AB8500_LDO_INTCORE, }, 800 { .name = "ab8500_ldo_intcore", .driver_data = (void *) AB8500_LDO_INTCORE, },
801 { .name = "LDO-TVOUT", .driver_data = (void *) AB8500_LDO_TVOUT, }, 801 { .name = "ab8500_ldo_tvout", .driver_data = (void *) AB8500_LDO_TVOUT, },
802 { .name = "LDO-USB", .driver_data = (void *) AB8500_LDO_USB, }, 802 { .name = "ab8500_ldo_usb", .driver_data = (void *) AB8500_LDO_USB, },
803 { .name = "LDO-AUDIO", .driver_data = (void *) AB8500_LDO_AUDIO, }, 803 { .name = "ab8500_ldo_audio", .driver_data = (void *) AB8500_LDO_AUDIO, },
804 { .name = "LDO-ANAMIC1", .driver_data = (void *) AB8500_LDO_ANAMIC1, }, 804 { .name = "ab8500_ldo_anamic1", .driver_data = (void *) AB8500_LDO_ANAMIC1, },
805 { .name = "LDO-ANAMIC2", .driver_data = (void *) AB8500_LDO_ANAMIC2, }, 805 { .name = "ab8500_ldo_amamic2", .driver_data = (void *) AB8500_LDO_ANAMIC2, },
806 { .name = "LDO-DMIC", .driver_data = (void *) AB8500_LDO_DMIC, }, 806 { .name = "ab8500_ldo_dmic", .driver_data = (void *) AB8500_LDO_DMIC, },
807 { .name = "LDO-ANA", .driver_data = (void *) AB8500_LDO_ANA, }, 807 { .name = "ab8500_ldo_ana", .driver_data = (void *) AB8500_LDO_ANA, },
808}; 808};
809 809
810static __devinit int 810static __devinit int
diff --git a/drivers/regulator/db8500-prcmu.c b/drivers/regulator/db8500-prcmu.c
index 968f97f3cb3d..9dbb491b6efa 100644
--- a/drivers/regulator/db8500-prcmu.c
+++ b/drivers/regulator/db8500-prcmu.c
@@ -452,26 +452,26 @@ static __devinit int db8500_regulator_register(struct platform_device *pdev,
452} 452}
453 453
454static struct of_regulator_match db8500_regulator_matches[] = { 454static struct of_regulator_match db8500_regulator_matches[] = {
455 { .name = "db8500-vape", .driver_data = (void *) DB8500_REGULATOR_VAPE, }, 455 { .name = "db8500_vape", .driver_data = (void *) DB8500_REGULATOR_VAPE, },
456 { .name = "db8500-varm", .driver_data = (void *) DB8500_REGULATOR_VARM, }, 456 { .name = "db8500_varm", .driver_data = (void *) DB8500_REGULATOR_VARM, },
457 { .name = "db8500-vmodem", .driver_data = (void *) DB8500_REGULATOR_VMODEM, }, 457 { .name = "db8500_vmodem", .driver_data = (void *) DB8500_REGULATOR_VMODEM, },
458 { .name = "db8500-vpll", .driver_data = (void *) DB8500_REGULATOR_VPLL, }, 458 { .name = "db8500_vpll", .driver_data = (void *) DB8500_REGULATOR_VPLL, },
459 { .name = "db8500-vsmps1", .driver_data = (void *) DB8500_REGULATOR_VSMPS1, }, 459 { .name = "db8500_vsmps1", .driver_data = (void *) DB8500_REGULATOR_VSMPS1, },
460 { .name = "db8500-vsmps2", .driver_data = (void *) DB8500_REGULATOR_VSMPS2, }, 460 { .name = "db8500_vsmps2", .driver_data = (void *) DB8500_REGULATOR_VSMPS2, },
461 { .name = "db8500-vsmps3", .driver_data = (void *) DB8500_REGULATOR_VSMPS3, }, 461 { .name = "db8500_vsmps3", .driver_data = (void *) DB8500_REGULATOR_VSMPS3, },
462 { .name = "db8500-vrf1", .driver_data = (void *) DB8500_REGULATOR_VRF1, }, 462 { .name = "db8500_vrf1", .driver_data = (void *) DB8500_REGULATOR_VRF1, },
463 { .name = "db8500-sva-mmdsp", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SVAMMDSP, }, 463 { .name = "db8500_sva_mmdsp", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SVAMMDSP, },
464 { .name = "db8500-sva-mmdsp-ret", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SVAMMDSPRET, }, 464 { .name = "db8500_sva_mmdsp_ret", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SVAMMDSPRET, },
465 { .name = "db8500-sva-pipe", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SVAPIPE, }, 465 { .name = "db8500_sva_pipe", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SVAPIPE, },
466 { .name = "db8500-sia-mmdsp", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SIAMMDSP, }, 466 { .name = "db8500_sia_mmdsp", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SIAMMDSP, },
467 { .name = "db8500-sia-mmdsp-ret", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SIAMMDSPRET, }, 467 { .name = "db8500_sia_mmdsp_ret", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SIAMMDSPRET, },
468 { .name = "db8500-sia-pipe", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SIAPIPE, }, 468 { .name = "db8500_sia_pipe", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SIAPIPE, },
469 { .name = "db8500-sga", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SGA, }, 469 { .name = "db8500_sga", .driver_data = (void *) DB8500_REGULATOR_SWITCH_SGA, },
470 { .name = "db8500-b2r2-mcde", .driver_data = (void *) DB8500_REGULATOR_SWITCH_B2R2_MCDE, }, 470 { .name = "db8500_b2r2_mcde", .driver_data = (void *) DB8500_REGULATOR_SWITCH_B2R2_MCDE, },
471 { .name = "db8500-esram12", .driver_data = (void *) DB8500_REGULATOR_SWITCH_ESRAM12, }, 471 { .name = "db8500_esram12", .driver_data = (void *) DB8500_REGULATOR_SWITCH_ESRAM12, },
472 { .name = "db8500-esram12-ret", .driver_data = (void *) DB8500_REGULATOR_SWITCH_ESRAM12RET, }, 472 { .name = "db8500_esram12_ret", .driver_data = (void *) DB8500_REGULATOR_SWITCH_ESRAM12RET, },
473 { .name = "db8500-esram34", .driver_data = (void *) DB8500_REGULATOR_SWITCH_ESRAM34, }, 473 { .name = "db8500_esram34", .driver_data = (void *) DB8500_REGULATOR_SWITCH_ESRAM34, },
474 { .name = "db8500-esram34-ret", .driver_data = (void *) DB8500_REGULATOR_SWITCH_ESRAM34RET, }, 474 { .name = "db8500_esram34_ret", .driver_data = (void *) DB8500_REGULATOR_SWITCH_ESRAM34RET, },
475}; 475};
476 476
477static __devinit int 477static __devinit int
diff --git a/drivers/regulator/s5m8767.c b/drivers/regulator/s5m8767.c
index 290d6fc01029..9caadb482178 100644
--- a/drivers/regulator/s5m8767.c
+++ b/drivers/regulator/s5m8767.c
@@ -451,7 +451,7 @@ static int s5m8767_set_voltage_time_sel(struct regulator_dev *rdev,
451 451
452 desc = reg_voltage_map[reg_id]; 452 desc = reg_voltage_map[reg_id];
453 453
454 if (old_sel < new_sel) 454 if ((old_sel < new_sel) && s5m8767->ramp_delay)
455 return DIV_ROUND_UP(desc->step * (new_sel - old_sel), 455 return DIV_ROUND_UP(desc->step * (new_sel - old_sel),
456 s5m8767->ramp_delay * 1000); 456 s5m8767->ramp_delay * 1000);
457 return 0; 457 return 0;
diff --git a/drivers/remoteproc/omap_remoteproc.c b/drivers/remoteproc/omap_remoteproc.c
index 69425c4e86f3..de138e30d3e6 100644
--- a/drivers/remoteproc/omap_remoteproc.c
+++ b/drivers/remoteproc/omap_remoteproc.c
@@ -182,7 +182,7 @@ static int __devinit omap_rproc_probe(struct platform_device *pdev)
182 182
183 ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); 183 ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
184 if (ret) { 184 if (ret) {
185 dev_err(pdev->dev.parent, "dma_set_coherent_mask: %d\n", ret); 185 dev_err(&pdev->dev, "dma_set_coherent_mask: %d\n", ret);
186 return ret; 186 return ret;
187 } 187 }
188 188
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 8ea7bccc7100..66324ee4678f 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -247,7 +247,7 @@ rproc_load_segments(struct rproc *rproc, const u8 *elf_data, size_t len)
247 } 247 }
248 248
249 if (offset + filesz > len) { 249 if (offset + filesz > len) {
250 dev_err(dev, "truncated fw: need 0x%x avail 0x%x\n", 250 dev_err(dev, "truncated fw: need 0x%x avail 0x%zx\n",
251 offset + filesz, len); 251 offset + filesz, len);
252 ret = -EINVAL; 252 ret = -EINVAL;
253 break; 253 break;
@@ -934,7 +934,7 @@ static void rproc_resource_cleanup(struct rproc *rproc)
934 unmapped = iommu_unmap(rproc->domain, entry->da, entry->len); 934 unmapped = iommu_unmap(rproc->domain, entry->da, entry->len);
935 if (unmapped != entry->len) { 935 if (unmapped != entry->len) {
936 /* nothing much to do besides complaining */ 936 /* nothing much to do besides complaining */
937 dev_err(dev, "failed to unmap %u/%u\n", entry->len, 937 dev_err(dev, "failed to unmap %u/%zu\n", entry->len,
938 unmapped); 938 unmapped);
939 } 939 }
940 940
@@ -1020,7 +1020,7 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw)
1020 1020
1021 ehdr = (struct elf32_hdr *)fw->data; 1021 ehdr = (struct elf32_hdr *)fw->data;
1022 1022
1023 dev_info(dev, "Booting fw image %s, size %d\n", name, fw->size); 1023 dev_info(dev, "Booting fw image %s, size %zd\n", name, fw->size);
1024 1024
1025 /* 1025 /*
1026 * if enabling an IOMMU isn't relevant for this rproc, this is 1026 * if enabling an IOMMU isn't relevant for this rproc, this is
@@ -1041,8 +1041,10 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw)
1041 1041
1042 /* look for the resource table */ 1042 /* look for the resource table */
1043 table = rproc_find_rsc_table(rproc, fw->data, fw->size, &tablesz); 1043 table = rproc_find_rsc_table(rproc, fw->data, fw->size, &tablesz);
1044 if (!table) 1044 if (!table) {
1045 ret = -EINVAL;
1045 goto clean_up; 1046 goto clean_up;
1047 }
1046 1048
1047 /* handle fw resources which are required to boot rproc */ 1049 /* handle fw resources which are required to boot rproc */
1048 ret = rproc_handle_boot_rsc(rproc, table, tablesz); 1050 ret = rproc_handle_boot_rsc(rproc, table, tablesz);
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 46ef5fe51db5..0c73dd4f43a0 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -801,7 +801,7 @@ static int omap2_mcspi_setup(struct spi_device *spi)
801 mcspi_dma = &mcspi->dma_channels[spi->chip_select]; 801 mcspi_dma = &mcspi->dma_channels[spi->chip_select];
802 802
803 if (!cs) { 803 if (!cs) {
804 cs = devm_kzalloc(&spi->dev , sizeof *cs, GFP_KERNEL); 804 cs = kzalloc(sizeof *cs, GFP_KERNEL);
805 if (!cs) 805 if (!cs)
806 return -ENOMEM; 806 return -ENOMEM;
807 cs->base = mcspi->base + spi->chip_select * 0x14; 807 cs->base = mcspi->base + spi->chip_select * 0x14;
@@ -842,6 +842,7 @@ static void omap2_mcspi_cleanup(struct spi_device *spi)
842 cs = spi->controller_state; 842 cs = spi->controller_state;
843 list_del(&cs->node); 843 list_del(&cs->node);
844 844
845 kfree(cs);
845 } 846 }
846 847
847 if (spi->chip_select < spi->master->num_chipselect) { 848 if (spi->chip_select < spi->master->num_chipselect) {
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index 1c3d6386ea36..aeac1caba3f9 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -30,6 +30,7 @@
30#include <linux/pci.h> 30#include <linux/pci.h>
31#include <linux/usb.h> 31#include <linux/usb.h>
32#include <linux/errno.h> 32#include <linux/errno.h>
33#include <linux/kconfig.h>
33#include <linux/kernel.h> 34#include <linux/kernel.h>
34#include <linux/sched.h> 35#include <linux/sched.h>
35#include <linux/fcntl.h> 36#include <linux/fcntl.h>
@@ -981,6 +982,8 @@ void comedi_pci_driver_unregister(struct comedi_driver *comedi_driver,
981} 982}
982EXPORT_SYMBOL_GPL(comedi_pci_driver_unregister); 983EXPORT_SYMBOL_GPL(comedi_pci_driver_unregister);
983 984
985#if IS_ENABLED(CONFIG_USB)
986
984static int comedi_old_usb_auto_config(struct usb_interface *intf, 987static int comedi_old_usb_auto_config(struct usb_interface *intf,
985 struct comedi_driver *driver) 988 struct comedi_driver *driver)
986{ 989{
@@ -1043,3 +1046,5 @@ void comedi_usb_driver_unregister(struct comedi_driver *comedi_driver,
1043 comedi_driver_unregister(comedi_driver); 1046 comedi_driver_unregister(comedi_driver);
1044} 1047}
1045EXPORT_SYMBOL_GPL(comedi_usb_driver_unregister); 1048EXPORT_SYMBOL_GPL(comedi_usb_driver_unregister);
1049
1050#endif
diff --git a/drivers/staging/gdm72xx/netlink_k.c b/drivers/staging/gdm72xx/netlink_k.c
index 292af0f7f451..51665132c61b 100644
--- a/drivers/staging/gdm72xx/netlink_k.c
+++ b/drivers/staging/gdm72xx/netlink_k.c
@@ -104,7 +104,7 @@ struct sock *netlink_init(int unit, void (*cb)(struct net_device *dev, u16 type,
104 104
105void netlink_exit(struct sock *sock) 105void netlink_exit(struct sock *sock)
106{ 106{
107 sock_release(sock->sk_socket); 107 netlink_kernel_release(sock);
108} 108}
109 109
110int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len) 110int netlink_send(struct sock *sock, int group, u16 type, void *msg, int len)
diff --git a/drivers/staging/iio/Documentation/device.txt b/drivers/staging/iio/Documentation/device.txt
index 0338c7cd0a8b..f03fbd3bb454 100644
--- a/drivers/staging/iio/Documentation/device.txt
+++ b/drivers/staging/iio/Documentation/device.txt
@@ -29,8 +29,6 @@ Then fill in the following:
29 * info->driver_module: 29 * info->driver_module:
30 Set to THIS_MODULE. Used to ensure correct ownership 30 Set to THIS_MODULE. Used to ensure correct ownership
31 of various resources allocate by the core. 31 of various resources allocate by the core.
32 * info->num_interrupt_lines:
33 Number of event triggering hardware lines the device has.
34 * info->event_attrs: 32 * info->event_attrs:
35 Attributes used to enable / disable hardware events. 33 Attributes used to enable / disable hardware events.
36 * info->attrs: 34 * info->attrs:
diff --git a/drivers/staging/iio/adc/Kconfig b/drivers/staging/iio/adc/Kconfig
index 2490dd25093b..8f1b3af02f29 100644
--- a/drivers/staging/iio/adc/Kconfig
+++ b/drivers/staging/iio/adc/Kconfig
@@ -13,6 +13,7 @@ config AD7291
13config AD7298 13config AD7298
14 tristate "Analog Devices AD7298 ADC driver" 14 tristate "Analog Devices AD7298 ADC driver"
15 depends on SPI 15 depends on SPI
16 select IIO_KFIFO_BUF if IIO_BUFFER
16 help 17 help
17 Say yes here to build support for Analog Devices AD7298 18 Say yes here to build support for Analog Devices AD7298
18 8 Channel ADC with temperature sensor. 19 8 Channel ADC with temperature sensor.
diff --git a/drivers/staging/iio/adc/ad7606_core.c b/drivers/staging/iio/adc/ad7606_core.c
index 10ab6dc823b9..a13afff2dfe6 100644
--- a/drivers/staging/iio/adc/ad7606_core.c
+++ b/drivers/staging/iio/adc/ad7606_core.c
@@ -235,7 +235,8 @@ static const struct attribute_group ad7606_attribute_group_range = {
235 .indexed = 1, \ 235 .indexed = 1, \
236 .channel = num, \ 236 .channel = num, \
237 .address = num, \ 237 .address = num, \
238 .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT, \ 238 .info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT | \
239 IIO_CHAN_INFO_SCALE_SHARED_BIT, \
239 .scan_index = num, \ 240 .scan_index = num, \
240 .scan_type = IIO_ST('s', 16, 16, 0), \ 241 .scan_type = IIO_ST('s', 16, 16, 0), \
241 } 242 }
diff --git a/drivers/staging/omapdrm/omap_fbdev.c b/drivers/staging/omapdrm/omap_fbdev.c
index 11acd4c35ed2..8c6ed3b0c6f6 100644
--- a/drivers/staging/omapdrm/omap_fbdev.c
+++ b/drivers/staging/omapdrm/omap_fbdev.c
@@ -208,7 +208,8 @@ static int omap_fbdev_create(struct drm_fb_helper *helper,
208 */ 208 */
209 ret = omap_gem_get_paddr(fbdev->bo, &paddr, true); 209 ret = omap_gem_get_paddr(fbdev->bo, &paddr, true);
210 if (ret) { 210 if (ret) {
211 dev_err(dev->dev, "could not map (paddr)!\n"); 211 dev_err(dev->dev,
212 "could not map (paddr)! Skipping framebuffer alloc\n");
212 ret = -ENOMEM; 213 ret = -ENOMEM;
213 goto fail; 214 goto fail;
214 } 215 }
@@ -388,8 +389,11 @@ void omap_fbdev_free(struct drm_device *dev)
388 389
389 fbi = helper->fbdev; 390 fbi = helper->fbdev;
390 391
391 unregister_framebuffer(fbi); 392 /* only cleanup framebuffer if it is present */
392 framebuffer_release(fbi); 393 if (fbi) {
394 unregister_framebuffer(fbi);
395 framebuffer_release(fbi);
396 }
393 397
394 drm_fb_helper_fini(helper); 398 drm_fb_helper_fini(helper);
395 399
diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
index 9bd18e2d0513..69f616c6964e 100644
--- a/drivers/staging/rtl8712/usb_intf.c
+++ b/drivers/staging/rtl8712/usb_intf.c
@@ -102,6 +102,8 @@ static struct usb_device_id rtl871x_usb_id_tbl[] = {
102 /* - */ 102 /* - */
103 {USB_DEVICE(0x20F4, 0x646B)}, 103 {USB_DEVICE(0x20F4, 0x646B)},
104 {USB_DEVICE(0x083A, 0xC512)}, 104 {USB_DEVICE(0x083A, 0xC512)},
105 {USB_DEVICE(0x25D4, 0x4CA1)},
106 {USB_DEVICE(0x25D4, 0x4CAB)},
105 107
106/* RTL8191SU */ 108/* RTL8191SU */
107 /* Realtek */ 109 /* Realtek */
diff --git a/drivers/tty/serial/8250/8250.c b/drivers/tty/serial/8250/8250.c
index 47d061b9ad4d..6e1958a325bd 100644
--- a/drivers/tty/serial/8250/8250.c
+++ b/drivers/tty/serial/8250/8250.c
@@ -3113,7 +3113,7 @@ static struct uart_8250_port *serial8250_find_match_or_unused(struct uart_port *
3113 3113
3114/** 3114/**
3115 * serial8250_register_8250_port - register a serial port 3115 * serial8250_register_8250_port - register a serial port
3116 * @port: serial port template 3116 * @up: serial port template
3117 * 3117 *
3118 * Configure the serial port specified by the request. If the 3118 * Configure the serial port specified by the request. If the
3119 * port exists and is in use, it is hung up and unregistered 3119 * port exists and is in use, it is hung up and unregistered
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index 4ad721fb8405..c17923ec6e95 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -133,6 +133,10 @@ struct pl011_dmatx_data {
133struct uart_amba_port { 133struct uart_amba_port {
134 struct uart_port port; 134 struct uart_port port;
135 struct clk *clk; 135 struct clk *clk;
136 /* Two optional pin states - default & sleep */
137 struct pinctrl *pinctrl;
138 struct pinctrl_state *pins_default;
139 struct pinctrl_state *pins_sleep;
136 const struct vendor_data *vendor; 140 const struct vendor_data *vendor;
137 unsigned int dmacr; /* dma control reg */ 141 unsigned int dmacr; /* dma control reg */
138 unsigned int im; /* interrupt mask */ 142 unsigned int im; /* interrupt mask */
@@ -1312,6 +1316,14 @@ static int pl011_startup(struct uart_port *port)
1312 unsigned int cr; 1316 unsigned int cr;
1313 int retval; 1317 int retval;
1314 1318
1319 /* Optionaly enable pins to be muxed in and configured */
1320 if (!IS_ERR(uap->pins_default)) {
1321 retval = pinctrl_select_state(uap->pinctrl, uap->pins_default);
1322 if (retval)
1323 dev_err(port->dev,
1324 "could not set default pins\n");
1325 }
1326
1315 retval = clk_prepare(uap->clk); 1327 retval = clk_prepare(uap->clk);
1316 if (retval) 1328 if (retval)
1317 goto out; 1329 goto out;
@@ -1420,6 +1432,7 @@ static void pl011_shutdown(struct uart_port *port)
1420{ 1432{
1421 struct uart_amba_port *uap = (struct uart_amba_port *)port; 1433 struct uart_amba_port *uap = (struct uart_amba_port *)port;
1422 unsigned int cr; 1434 unsigned int cr;
1435 int retval;
1423 1436
1424 /* 1437 /*
1425 * disable all interrupts 1438 * disable all interrupts
@@ -1462,6 +1475,14 @@ static void pl011_shutdown(struct uart_port *port)
1462 */ 1475 */
1463 clk_disable(uap->clk); 1476 clk_disable(uap->clk);
1464 clk_unprepare(uap->clk); 1477 clk_unprepare(uap->clk);
1478 /* Optionally let pins go into sleep states */
1479 if (!IS_ERR(uap->pins_sleep)) {
1480 retval = pinctrl_select_state(uap->pinctrl, uap->pins_sleep);
1481 if (retval)
1482 dev_err(port->dev,
1483 "could not set pins to sleep state\n");
1484 }
1485
1465 1486
1466 if (uap->port.dev->platform_data) { 1487 if (uap->port.dev->platform_data) {
1467 struct amba_pl011_data *plat; 1488 struct amba_pl011_data *plat;
@@ -1792,6 +1813,14 @@ static int __init pl011_console_setup(struct console *co, char *options)
1792 if (!uap) 1813 if (!uap)
1793 return -ENODEV; 1814 return -ENODEV;
1794 1815
1816 /* Allow pins to be muxed in and configured */
1817 if (!IS_ERR(uap->pins_default)) {
1818 ret = pinctrl_select_state(uap->pinctrl, uap->pins_default);
1819 if (ret)
1820 dev_err(uap->port.dev,
1821 "could not set default pins\n");
1822 }
1823
1795 ret = clk_prepare(uap->clk); 1824 ret = clk_prepare(uap->clk);
1796 if (ret) 1825 if (ret)
1797 return ret; 1826 return ret;
@@ -1844,7 +1873,6 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
1844{ 1873{
1845 struct uart_amba_port *uap; 1874 struct uart_amba_port *uap;
1846 struct vendor_data *vendor = id->data; 1875 struct vendor_data *vendor = id->data;
1847 struct pinctrl *pinctrl;
1848 void __iomem *base; 1876 void __iomem *base;
1849 int i, ret; 1877 int i, ret;
1850 1878
@@ -1869,11 +1897,20 @@ static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
1869 goto free; 1897 goto free;
1870 } 1898 }
1871 1899
1872 pinctrl = devm_pinctrl_get_select_default(&dev->dev); 1900 uap->pinctrl = devm_pinctrl_get(&dev->dev);
1873 if (IS_ERR(pinctrl)) { 1901 if (IS_ERR(uap->pinctrl)) {
1874 ret = PTR_ERR(pinctrl); 1902 ret = PTR_ERR(uap->pinctrl);
1875 goto unmap; 1903 goto unmap;
1876 } 1904 }
1905 uap->pins_default = pinctrl_lookup_state(uap->pinctrl,
1906 PINCTRL_STATE_DEFAULT);
1907 if (IS_ERR(uap->pins_default))
1908 dev_err(&dev->dev, "could not get default pinstate\n");
1909
1910 uap->pins_sleep = pinctrl_lookup_state(uap->pinctrl,
1911 PINCTRL_STATE_SLEEP);
1912 if (IS_ERR(uap->pins_sleep))
1913 dev_dbg(&dev->dev, "could not get sleep pinstate\n");
1877 1914
1878 uap->clk = clk_get(&dev->dev, NULL); 1915 uap->clk = clk_get(&dev->dev, NULL);
1879 if (IS_ERR(uap->clk)) { 1916 if (IS_ERR(uap->clk)) {
diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_txx9.c
index 34bd345da775..6ae2a58d62f2 100644
--- a/drivers/tty/serial/serial_txx9.c
+++ b/drivers/tty/serial/serial_txx9.c
@@ -466,7 +466,7 @@ static void serial_txx9_break_ctl(struct uart_port *port, int break_state)
466 spin_unlock_irqrestore(&up->port.lock, flags); 466 spin_unlock_irqrestore(&up->port.lock, flags);
467} 467}
468 468
469#if defined(CONFIG_SERIAL_TXX9_CONSOLE) || (CONFIG_CONSOLE_POLL) 469#if defined(CONFIG_SERIAL_TXX9_CONSOLE) || defined(CONFIG_CONSOLE_POLL)
470/* 470/*
471 * Wait for transmitter & holding register to empty 471 * Wait for transmitter & holding register to empty
472 */ 472 */
diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c
index afcd13676542..e4841c36798b 100644
--- a/drivers/watchdog/sp805_wdt.c
+++ b/drivers/watchdog/sp805_wdt.c
@@ -4,7 +4,7 @@
4 * Watchdog driver for ARM SP805 watchdog module 4 * Watchdog driver for ARM SP805 watchdog module
5 * 5 *
6 * Copyright (C) 2010 ST Microelectronics 6 * Copyright (C) 2010 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com> 7 * Viresh Kumar <viresh.linux@gmail.com>
8 * 8 *
9 * This file is licensed under the terms of the GNU General Public 9 * This file is licensed under the terms of the GNU General Public
10 * License version 2 or later. This program is licensed "as is" without any 10 * License version 2 or later. This program is licensed "as is" without any
@@ -331,6 +331,6 @@ static struct amba_driver sp805_wdt_driver = {
331 331
332module_amba_driver(sp805_wdt_driver); 332module_amba_driver(sp805_wdt_driver);
333 333
334MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); 334MODULE_AUTHOR("Viresh Kumar <viresh.linux@gmail.com>");
335MODULE_DESCRIPTION("ARM SP805 Watchdog Driver"); 335MODULE_DESCRIPTION("ARM SP805 Watchdog Driver");
336MODULE_LICENSE("GPL"); 336MODULE_LICENSE("GPL");