* [PATCH mmc/next v3 0/2] mmc: tmio, renesas-sdhi: cleanups
@ 2017-06-16 16:11 Simon Horman
2017-06-16 16:11 ` [PATCH mmc/next v3 1/2] mmc: tmio: improve checkpatch cleanness Simon Horman
2017-06-16 16:11 ` [PATCH mmc/next v3 2/2] mmc: renesas-sdhi: " Simon Horman
0 siblings, 2 replies; 7+ messages in thread
From: Simon Horman @ 2017-06-16 16:11 UTC (permalink / raw)
To: Wolfram Sang, Ulf Hansson
Cc: Magnus Damm, linux-mmc, linux-renesas-soc, Simon Horman
Hi,
this short series provides some cleanups to the tmio and renesas-sdhi
drivers to improve their checkpatch cleanness.
Changes since v2:
* Address review - details noted in changelogs of each patch
Lightly tested on H2/Lager and M3-W/Salvator-X as per the log below.
Simon Horman (2):
mmc: tmio: improve checkpatch cleanness
mmc: renesas-sdhi: improve checkpatch cleanness
drivers/mmc/host/renesas_sdhi.h | 4 +-
drivers/mmc/host/renesas_sdhi_core.c | 43 +++++++++++----------
drivers/mmc/host/renesas_sdhi_sys_dmac.c | 25 ++++++------
drivers/mmc/host/tmio_mmc.c | 8 ++--
drivers/mmc/host/tmio_mmc.h | 17 ++++----
drivers/mmc/host/tmio_mmc_core.c | 66 +++++++++++++++++---------------
include/linux/mfd/tmio.h | 33 ++++++++--------
7 files changed, 103 insertions(+), 93 deletions(-)
--
2.1.4
Salvator-X/M3-W ES1.0
=====================
With Cleanup
------------
5a0e681d4c56 ("mmc: renesas-sdhi: improve checkpatch cleanness")
# dmesg | egrep '(sd|mmc)'
[ 1.410058] sdhci: Secure Digital Host Controller Interface driver
[ 1.416271] sdhci: Copyright(c) Pierre Ossman
[ 1.421257] sh_mobile_sdhi ee100000.sd: Got CD GPIO
[ 1.426171] sh_mobile_sdhi ee100000.sd: Got WP GPIO
[ 1.557515] sh_mobile_sdhi ee140000.sd: mmc0 base at 0xee140000 max clock rate 200 MHz
[ 1.565873] sh_mobile_sdhi ee160000.sd: Got CD GPIO
[ 1.570806] sh_mobile_sdhi ee160000.sd: Got WP GPIO
[ 1.584531] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.633928] sh_mobile_sdhi ee100000.sd: Got CD GPIO
[ 1.638941] sh_mobile_sdhi ee100000.sd: Got WP GPIO
[ 1.765569] sh_mobile_sdhi ee100000.sd: mmc1 base at 0xee100000 max clock rate 200 MHz
[ 1.774965] sh_mobile_sdhi ee160000.sd: Got CD GPIO
[ 1.779903] sh_mobile_sdhi ee160000.sd: Got WP GPIO
[ 1.811972] mmc0: new high speed MMC card at address 0001
[ 1.817790] mmcblk0: mmc0:0001 eMMC 28.8 GiB
[ 1.826541] mmcblk0boot0: mmc0:0001 eMMC partition 1 4.00 MiB
[ 1.836647] mmcblk0boot1: mmc0:0001 eMMC partition 2 4.00 MiB
[ 1.848444] mmcblk0rpmb: mmc0:0001 eMMC partition 3 4.00 MiB
[ 1.858737] mmcblk0: p1
[ 1.917609] sh_mobile_sdhi ee160000.sd: mmc2 base at 0xee160000 max clock rate 200 MHz
[ 2.065539] mmc1: new ultra high speed SDR50 SDHC card at address e624
[ 2.072548] mmcblk1: mmc1:e624 SU08G 7.40 GiB
[ 2.088110] mmcblk1: p1
[ 2.189536] mmc2: new ultra high speed SDR50 SDHC card at address 0001
[ 2.196412] mmcblk2: mmc2:0001 00000 29.8 GiB
[ 2.210919] mmcblk2: p1
root@Debian:~# cat /sys/devi
# grep sd /proc/interrupts
100: 1063140 0 GIC-0 197 Level ee100000.sd
101: 3012 0 GIC-0 199 Level ee140000.sd
102: 2276 0 GIC-0 200 Level ee160000.sd
178: 0 0 e6053000.gpio 12 Edge ee100000.sd cd
197: 0 0 e6054000.gpio 15 Edge ee160000.sd cd
# cat /sys/devices/platform/soc/ee100000.sd/mmc_host/mmc1/mmc1:*/cid
035344535530384780b1b8a11200d300
# dd if=/dev/mmcblk1 of=/dev/null bs=1M count=512 iflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 56.3221 s, 9.5 MB/s
# cat /sys/devices/platform/soc/ee160000.sd/mmc_host/mmc2/mmc2:*/cid
1b534d3030303030103916141700f600
# dd if=/dev/mmcblk2 of=/dev/null bs=1M count=512 iflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 56.7888 s, 9.5 MB/s
# grep sd /proc/interrupts
100: 2124004 0 GIC-0 197 Level ee100000.sd
101: 3012 0 GIC-0 199 Level ee140000.sd
102: 1063140 0 GIC-0 200 Level ee160000.sd
178: 0 0 e6053000.gpio 12 Edge ee100000.sd cd
197: 0 0 e6054000.gpio 15 Edge ee160000.sd cd
Without Cleanup
---------------
f2cd281b9f7d (mmc/next) mmc: sdhci-pci: Enable card detect wake for Intel BYT-related SD controllers
# dmesg | egrep '(sd|mmc)'
[ 1.413160] sdhci: Secure Digital Host Controller Interface driver
[ 1.419368] sdhci: Copyright(c) Pierre Ossman
[ 1.424317] sh_mobile_sdhi ee100000.sd: Got CD GPIO
[ 1.429254] sh_mobile_sdhi ee100000.sd: Got WP GPIO
[ 1.556994] sh_mobile_sdhi ee140000.sd: mmc0 base at 0xee140000 max clock rate 200 MHz
[ 1.565359] sh_mobile_sdhi ee160000.sd: Got CD GPIO
[ 1.570313] sh_mobile_sdhi ee160000.sd: Got WP GPIO
[ 1.584078] sdhci-pltfm: SDHCI platform and OF driver helper
[ 1.633385] sh_mobile_sdhi ee100000.sd: Got CD GPIO
[ 1.638319] sh_mobile_sdhi ee100000.sd: Got WP GPIO
[ 1.765061] sh_mobile_sdhi ee100000.sd: mmc1 base at 0xee100000 max clock rate 200 MHz
[ 1.774258] sh_mobile_sdhi ee160000.sd: Got CD GPIO
[ 1.779185] sh_mobile_sdhi ee160000.sd: Got WP GPIO
[ 1.834292] mmc0: new high speed MMC card at address 0001
[ 1.840594] mmcblk0: mmc0:0001 eMMC 28.8 GiB
[ 1.850501] mmcblk0boot0: mmc0:0001 eMMC partition 1 4.00 MiB
[ 1.860750] mmcblk0boot1: mmc0:0001 eMMC partition 2 4.00 MiB
[ 1.870834] mmcblk0rpmb: mmc0:0001 eMMC partition 3 4.00 MiB
[ 1.880344] mmcblk0: p1
[ 1.909078] sh_mobile_sdhi ee160000.sd: mmc2 base at 0xee160000 max clock rate 200 MHz
[ 2.049028] mmc1: new ultra high speed SDR50 SDHC card at address e624
[ 2.060070] mmcblk1: mmc1:e624 SU08G 7.40 GiB
[ 2.075628] mmcblk1: p1
[ 2.165019] mmc2: new ultra high speed SDR50 SDHC card at address 0001
[ 2.175911] mmcblk2: mmc2:0001 00000 29.8 GiB
[ 2.190409] mmcblk2: p1
# grep sd /proc/interrupts
100: 2276 0 GIC-0 197 Level ee100000.sd
101: 2986 0 GIC-0 199 Level ee140000.sd
102: 2276 0 GIC-0 200 Level ee160000.sd
178: 0 0 e6053000.gpio 12 Edge ee100000.sd cd
197: 0 0 e6054000.gpio 15 Edge ee160000.sd cd
# cat /sys/devices/platform/soc/ee100000.sd/mmc_host/mmc1/mmc1:*/cid
035344535530384780b1b8a11200d300
# dd if=/dev/mmcblk2 of=/dev/null bs=1M count=512 iflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 56.7595 s, 9.5 MB/s
# cat /sys/devices/platform/soc/ee160000.sd/mmc_host/mmc2/mmc2:*/cid
1b534d3030303030103916141700f600
# dd if=/dev/mmcblk2 of=/dev/null bs=1M count=512 iflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 56.7595 s, 9.5 MB/s
# grep sd /proc/interrupts
100: 2276 0 GIC-0 197 Level ee100000.sd
101: 2986 0 GIC-0 199 Level ee140000.sd
102: 2124004 0 GIC-0 200 Level ee160000.sd
178: 0 0 e6053000.gpio 12 Edge ee100000.sd cd
197: 0 0 e6054000.gpio 15 Edge ee160000.sd cd
Lager/H2 ES2.0
==============
With Cleanup
------------
5a0e681d4c56 ("mmc: renesas-sdhi: improve checkpatch cleanness")
# dmesg | egrep '(sd|mmc)'
[ 2.309775] sh_mobile_sdhi ee100000.sd: Got CD GPIO
[ 2.315203] sh_mobile_sdhi ee140000.sd: Got CD GPIO
[ 2.375149] sh_mmcif ee220000.mmc: Chip version 0x0003, clock rate 12MHz
[ 2.481838] sh_mobile_sdhi ee100000.sd: Got CD GPIO
[ 2.695297] sh_mobile_sdhi ee100000.sd: mmc1 base at 0xee100000 max clock rate 195 MHz
[ 2.703764] sh_mobile_sdhi ee140000.sd: Got CD GPIO
[ 2.784274] mmc0: new high speed MMC card at address 0001
[ 2.790078] mmcblk0: mmc0:0001 MMC08G 7.33 GiB
[ 2.794796] mmcblk0boot0: mmc0:0001 MMC08G partition 1 2.00 MiB
[ 2.800926] mmcblk0boot1: mmc0:0001 MMC08G partition 2 2.00 MiB
[ 2.808580] mmcblk0: p1
[ 2.915292] sh_mobile_sdhi ee140000.sd: mmc2 base at 0xee140000 max clock rate 97 MHz
[ 3.122381] mmc1: new ultra high speed SDR104 SDHC card at address 0001
[ 3.129381] mmcblk1: mmc1:0001 00000 29.8 GiB
[ 3.143191] mmcblk1: p1
[ 3.335268] mmc2: new ultra high speed SDR50 SDHC card at address 0001
[ 3.342131] mmcblk2: mmc2:0001 00000 29.8 GiB
[ 3.356094] mmcblk2: p1
# grep sd /proc/interrupts
99: 572 0 0 0 GIC-0 197 Level ee100000.sd
100: 540 0 0 0 GIC-0 199 Level ee140000.sd
220: 0 0 0 0 e6053000.gpio 6 Edge ee100000.sd cd
236: 0 0 0 0 e6053000.gpio 22 Edge ee140000.sd cd
# cat /sys/devices/platform/ee100000.sd/mmc_host/mmc1/mmc1:*/cid
1b534d303030303010ed85537600fc00
# dd if=/dev/mmcblk1 of=/dev/null bs=1M count=512 iflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 14.5894 s, 36.8 MB/
# cat /sys/devices/platform/ee140000.sd/mmc_host/mmc2/mmc2:*/cid
1b534d303030303010f0c957f500fc00
# dd if=/dev/mmcblk2 of=/dev/null bs=1M count=512 iflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 18.8921 s, 28.4 MB/s
# grep sd /proc/interrupts
99: 12860 0 0 0 GIC-0 197 Level ee100000.sd
100: 12828 0 0 0 GIC-0 199 Level ee140000.sd
220: 0 0 0 0 e6053000.gpio 6 Edge ee100000.sd cd
236: 0 0 0 0 e6053000.gpio 22 Edge ee140000.sd cd
Without Cleanup
---------------
f2cd281b9f7d (mmc/next) mmc: sdhci-pci: Enable card detect wake for Intel BYT-related SD controllers
# dmesg | egrep '(sd|mmc)'
[ 2.310760] sh_mobile_sdhi ee100000.sd: Got CD GPIO
[ 2.316185] sh_mobile_sdhi ee140000.sd: Got CD GPIO
[ 2.375581] sh_mmcif ee220000.mmc: Chip version 0x0003, clock rate 12MHz
[ 2.482371] sh_mobile_sdhi ee100000.sd: Got CD GPIO
[ 2.695738] sh_mobile_sdhi ee100000.sd: mmc1 base at 0xee100000 max clock rate 195 MHz
[ 2.704210] sh_mobile_sdhi ee140000.sd: Got CD GPIO
[ 2.784707] mmc0: new high speed MMC card at address 0001
[ 2.790501] mmcblk0: mmc0:0001 MMC08G 7.33 GiB
[ 2.795219] mmcblk0boot0: mmc0:0001 MMC08G partition 1 2.00 MiB
[ 2.804059] mmcblk0boot1: mmc0:0001 MMC08G partition 2 2.00 MiB
[ 2.811731] mmcblk0: p1
[ 2.915727] sh_mobile_sdhi ee140000.sd: mmc2 base at 0xee140000 max clock rate 97 MHz
[ 3.122796] mmc1: new ultra high speed SDR104 SDHC card at address 0001
[ 3.129798] mmcblk1: mmc1:0001 00000 29.8 GiB
[ 3.143603] mmcblk1: p1
[ 3.335704] mmc2: new ultra high speed SDR50 SDHC card at address 0001
[ 3.342565] mmcblk2: mmc2:0001 00000 29.8 GiB
[ 3.356510] mmcblk2: p1
# grep sd /proc/interrupts
99: 572 0 0 0 GIC-0 197 Level ee100000.sd
100: 538 0 0 0 GIC-0 199 Level ee140000.sd
220: 0 0 0 0 e6053000.gpio 6 Edge ee100000.sd cd
236: 0 0 0 0 e6053000.gpio 22 Edge ee140000.sd cd
# cat /sys/devices/platform/ee100000.sd/mmc_host/mmc1/mmc1:*/cid
1b534d303030303010ed85537600fc00
# dd if=/dev/mmcblk1 of=/dev/null bs=1M count=512 iflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 14.6023 s, 36.8 MB/s
# cat /sys/devices/platform/ee140000.sd/mmc_host/mmc2/mmc2:*/cid
1b534d303030303010f0c957f500fc00
# dd if=/dev/mmcblk2 of=/dev/null bs=1M count=512 iflag=direct
512+0 records in
512+0 records out
536870912 bytes (537 MB) copied, 18.8882 s, 28.4 MB/s
# grep sd /proc/interrupts
99: 12860 0 0 0 GIC-0 197 Level ee100000.sd
100: 12826 0 0 0 GIC-0 199 Level ee140000.sd
220: 0 0 0 0 e6053000.gpio 6 Edge ee100000.sd cd
236: 0 0 0 0 e6053000.gpio 22 Edge ee140000.sd cd
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH mmc/next v3 1/2] mmc: tmio: improve checkpatch cleanness
2017-06-16 16:11 [PATCH mmc/next v3 0/2] mmc: tmio, renesas-sdhi: cleanups Simon Horman
@ 2017-06-16 16:11 ` Simon Horman
2017-06-16 16:34 ` Wolfram Sang
2017-06-19 12:43 ` Ulf Hansson
2017-06-16 16:11 ` [PATCH mmc/next v3 2/2] mmc: renesas-sdhi: " Simon Horman
1 sibling, 2 replies; 7+ messages in thread
From: Simon Horman @ 2017-06-16 16:11 UTC (permalink / raw)
To: Wolfram Sang, Ulf Hansson
Cc: Magnus Damm, linux-mmc, linux-renesas-soc, Simon Horman
Trivial updates to improve checkpatch cleanness.
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
v3
* Really don't add bogus ',' after KERN_DEBUG
* Adjustments as per Wolfram's preferences
v2
* Don't add bogus ',' after KERN_DEBUG
* Leave some lines over 80 columns as it seems to be the more readable option
(very subjective)
---
drivers/mmc/host/renesas_sdhi.h | 2 +-
drivers/mmc/host/tmio_mmc.c | 8 ++---
drivers/mmc/host/tmio_mmc.h | 17 ++++++-----
drivers/mmc/host/tmio_mmc_core.c | 66 +++++++++++++++++++++-------------------
include/linux/mfd/tmio.h | 33 ++++++++++----------
5 files changed, 66 insertions(+), 60 deletions(-)
diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
index eb3ea15ff92d..6b4a79508c6b 100644
--- a/drivers/mmc/host/renesas_sdhi.h
+++ b/drivers/mmc/host/renesas_sdhi.h
@@ -27,7 +27,7 @@ struct renesas_sdhi_of_data {
unsigned long capabilities2;
enum dma_slave_buswidth dma_buswidth;
dma_addr_t dma_rx_offset;
- unsigned bus_shift;
+ unsigned int bus_shift;
int scc_offset;
struct renesas_sdhi_scc *taps;
int taps_num;
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 61cf36fb270b..64b7e9f18361 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -104,8 +104,8 @@ static int tmio_mmc_probe(struct platform_device *pdev)
goto host_free;
ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_irq,
- IRQF_TRIGGER_FALLING,
- dev_name(&pdev->dev), host);
+ IRQF_TRIGGER_FALLING,
+ dev_name(&pdev->dev), host);
if (ret)
goto host_remove;
@@ -132,6 +132,7 @@ static int tmio_mmc_remove(struct platform_device *pdev)
if (mmc) {
struct tmio_mmc_host *host = mmc_priv(mmc);
+
tmio_mmc_host_remove(host);
if (cell->disable)
cell->disable(pdev);
@@ -145,8 +146,7 @@ static int tmio_mmc_remove(struct platform_device *pdev)
static const struct dev_pm_ops tmio_mmc_dev_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(tmio_mmc_suspend, tmio_mmc_resume)
SET_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
- tmio_mmc_host_runtime_resume,
- NULL)
+ tmio_mmc_host_runtime_resume, NULL)
};
static struct platform_driver tmio_mmc_driver = {
diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
index 768c8abaedda..6ad6704175dc 100644
--- a/drivers/mmc/host/tmio_mmc.h
+++ b/drivers/mmc/host/tmio_mmc.h
@@ -239,24 +239,26 @@ static inline u16 sd_ctrl_read16(struct tmio_mmc_host *host, int addr)
}
static inline void sd_ctrl_read16_rep(struct tmio_mmc_host *host, int addr,
- u16 *buf, int count)
+ u16 *buf, int count)
{
readsw(host->ctl + (addr << host->bus_shift), buf, count);
}
-static inline u32 sd_ctrl_read16_and_16_as_32(struct tmio_mmc_host *host, int addr)
+static inline u32 sd_ctrl_read16_and_16_as_32(struct tmio_mmc_host *host,
+ int addr)
{
return readw(host->ctl + (addr << host->bus_shift)) |
readw(host->ctl + ((addr + 2) << host->bus_shift)) << 16;
}
static inline void sd_ctrl_read32_rep(struct tmio_mmc_host *host, int addr,
- u32 *buf, int count)
+ u32 *buf, int count)
{
readsl(host->ctl + (addr << host->bus_shift), buf, count);
}
-static inline void sd_ctrl_write16(struct tmio_mmc_host *host, int addr, u16 val)
+static inline void sd_ctrl_write16(struct tmio_mmc_host *host, int addr,
+ u16 val)
{
/* If there is a hook and it returns non-zero then there
* is an error and the write should be skipped
@@ -267,19 +269,20 @@ static inline void sd_ctrl_write16(struct tmio_mmc_host *host, int addr, u16 val
}
static inline void sd_ctrl_write16_rep(struct tmio_mmc_host *host, int addr,
- u16 *buf, int count)
+ u16 *buf, int count)
{
writesw(host->ctl + (addr << host->bus_shift), buf, count);
}
-static inline void sd_ctrl_write32_as_16_and_16(struct tmio_mmc_host *host, int addr, u32 val)
+static inline void sd_ctrl_write32_as_16_and_16(struct tmio_mmc_host *host,
+ int addr, u32 val)
{
writew(val & 0xffff, host->ctl + (addr << host->bus_shift));
writew(val >> 16, host->ctl + ((addr + 2) << host->bus_shift));
}
static inline void sd_ctrl_write32_rep(struct tmio_mmc_host *host, int addr,
- const u32 *buf, int count)
+ const u32 *buf, int count)
{
writesl(host->ctl + (addr << host->bus_shift), buf, count);
}
diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c
index fbe38464e7d7..82b80d42f7ae 100644
--- a/drivers/mmc/host/tmio_mmc_core.c
+++ b/drivers/mmc/host/tmio_mmc_core.c
@@ -127,16 +127,17 @@ static int tmio_mmc_next_sg(struct tmio_mmc_host *host)
#define STATUS_TO_TEXT(a, status, i) \
do { \
- if (status & TMIO_STAT_##a) { \
- if (i++) \
- printk(" | "); \
- printk(#a); \
+ if ((status) & TMIO_STAT_##a) { \
+ if ((i)++) \
+ printk(KERN_DEBUG " | "); \
+ printk(KERN_DEBUG #a); \
} \
} while (0)
static void pr_debug_status(u32 status)
{
int i = 0;
+
pr_debug("status: %08x = ", status);
STATUS_TO_TEXT(CARD_REMOVE, status, i);
STATUS_TO_TEXT(CARD_INSERT, status, i);
@@ -177,8 +178,7 @@ static void tmio_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
pm_runtime_get_sync(mmc_dev(mmc));
host->sdio_irq_enabled = true;
- host->sdio_irq_mask = TMIO_SDIO_MASK_ALL &
- ~TMIO_SDIO_STAT_IOIRQ;
+ host->sdio_irq_mask = TMIO_SDIO_MASK_ALL & ~TMIO_SDIO_STAT_IOIRQ;
/* Clear obsolete interrupts before enabling */
sdio_status = sd_ctrl_read16(host, CTL_SDIO_STATUS) & ~TMIO_SDIO_MASK_ALL;
@@ -222,7 +222,7 @@ static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
}
static void tmio_mmc_set_clock(struct tmio_mmc_host *host,
- unsigned int new_clock)
+ unsigned int new_clock)
{
u32 clk = 0, clock;
@@ -289,16 +289,16 @@ static void tmio_mmc_reset_work(struct work_struct *work)
* cancel_delayed_work(), it can happen, that a .set_ios() call preempts
* us, so, have to check for IS_ERR(host->mrq)
*/
- if (IS_ERR_OR_NULL(mrq)
- || time_is_after_jiffies(host->last_req_ts +
- msecs_to_jiffies(CMDREQ_TIMEOUT))) {
+ if (IS_ERR_OR_NULL(mrq) ||
+ time_is_after_jiffies(host->last_req_ts +
+ msecs_to_jiffies(CMDREQ_TIMEOUT))) {
spin_unlock_irqrestore(&host->lock, flags);
return;
}
dev_warn(&host->pdev->dev,
- "timeout waiting for hardware interrupt (CMD%u)\n",
- mrq->cmd->opcode);
+ "timeout waiting for hardware interrupt (CMD%u)\n",
+ mrq->cmd->opcode);
if (host->data)
host->data->error = -ETIMEDOUT;
@@ -336,7 +336,8 @@ static void tmio_mmc_reset_work(struct work_struct *work)
#define SECURITY_CMD 0x4000
#define NO_CMD12_ISSUE 0x4000 /* TMIO_MMC_HAVE_CMD12_CTRL */
-static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command *cmd)
+static int tmio_mmc_start_command(struct tmio_mmc_host *host,
+ struct mmc_command *cmd)
{
struct mmc_data *data = host->data;
int c = cmd->opcode;
@@ -375,8 +376,8 @@ static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command
c |= TRANSFER_MULTI;
/*
- * Disable auto CMD12 at IO_RW_EXTENDED and SET_BLOCK_COUNT
- * when doing multiple block transfer
+ * Disable auto CMD12 at IO_RW_EXTENDED and
+ * SET_BLOCK_COUNT when doing multiple block transfer
*/
if ((host->pdata->flags & TMIO_MMC_HAVE_CMD12_CTRL) &&
(cmd->opcode == SD_IO_RW_EXTENDED || host->mrq->sbc))
@@ -501,8 +502,6 @@ static void tmio_mmc_pio_irq(struct tmio_mmc_host *host)
if (host->sg_off == host->sg_ptr->length)
tmio_mmc_next_sg(host);
-
- return;
}
static void tmio_mmc_check_bounce_buffer(struct tmio_mmc_host *host)
@@ -510,6 +509,7 @@ static void tmio_mmc_check_bounce_buffer(struct tmio_mmc_host *host)
if (host->sg_ptr == &host->bounce_sg) {
unsigned long flags;
void *sg_vaddr = tmio_mmc_kmap_atomic(host->sg_orig, &flags);
+
memcpy(sg_vaddr, host->bounce_buf, host->bounce_sg.length);
tmio_mmc_kunmap_atomic(host->sg_orig, &flags, sg_vaddr);
}
@@ -574,6 +574,7 @@ EXPORT_SYMBOL_GPL(tmio_mmc_do_data_irq);
static void tmio_mmc_data_irq(struct tmio_mmc_host *host, unsigned int stat)
{
struct mmc_data *data;
+
spin_lock(&host->lock);
data = host->data;
@@ -618,8 +619,7 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host, unsigned int stat)
spin_unlock(&host->lock);
}
-static void tmio_mmc_cmd_irq(struct tmio_mmc_host *host,
- unsigned int stat)
+static void tmio_mmc_cmd_irq(struct tmio_mmc_host *host, unsigned int stat)
{
struct mmc_command *cmd = host->cmd;
int i, addr;
@@ -680,7 +680,7 @@ static void tmio_mmc_cmd_irq(struct tmio_mmc_host *host,
}
static bool __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host,
- int ireg, int status)
+ int ireg, int status)
{
struct mmc_host *mmc = host->mmc;
@@ -698,14 +698,13 @@ static bool __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host,
return false;
}
-static bool __tmio_mmc_sdcard_irq(struct tmio_mmc_host *host,
- int ireg, int status)
+static bool __tmio_mmc_sdcard_irq(struct tmio_mmc_host *host, int ireg,
+ int status)
{
/* Command completion */
if (ireg & (TMIO_STAT_CMDRESPEND | TMIO_STAT_CMDTIMEOUT)) {
- tmio_mmc_ack_mmc_irqs(host,
- TMIO_STAT_CMDRESPEND |
- TMIO_STAT_CMDTIMEOUT);
+ tmio_mmc_ack_mmc_irqs(host, TMIO_STAT_CMDRESPEND |
+ TMIO_STAT_CMDTIMEOUT);
tmio_mmc_cmd_irq(host, status);
return true;
}
@@ -776,7 +775,7 @@ irqreturn_t tmio_mmc_irq(int irq, void *devid)
EXPORT_SYMBOL_GPL(tmio_mmc_irq);
static int tmio_mmc_start_data(struct tmio_mmc_host *host,
- struct mmc_data *data)
+ struct mmc_data *data)
{
struct tmio_mmc_data *pdata = host->pdata;
@@ -831,7 +830,7 @@ static int tmio_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode)
if (host->tap_num * 2 >= sizeof(host->taps) * BITS_PER_BYTE) {
dev_warn_once(&host->pdev->dev,
- "Too many taps, skipping tuning. Please consider updating size of taps field of tmio_mmc_host\n");
+ "Too many taps, skipping tuning. Please consider updating size of taps field of tmio_mmc_host\n");
goto out;
}
@@ -862,7 +861,8 @@ static int tmio_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode)
return ret;
}
-static void tmio_process_mrq(struct tmio_mmc_host *host, struct mmc_request *mrq)
+static void tmio_process_mrq(struct tmio_mmc_host *host,
+ struct mmc_request *mrq)
{
struct mmc_command *cmd;
int ret;
@@ -1030,7 +1030,7 @@ static void tmio_mmc_power_off(struct tmio_mmc_host *host)
}
static void tmio_mmc_set_bus_width(struct tmio_mmc_host *host,
- unsigned char bus_width)
+ unsigned char bus_width)
{
u16 reg = sd_ctrl_read16(host, CTL_SD_MEM_CARD_OPT)
& ~(CARD_OPT_WIDTH | CARD_OPT_WIDTH8);
@@ -1070,7 +1070,8 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
dev_dbg(dev,
"%s.%d: CMD%u active since %lu, now %lu!\n",
current->comm, task_pid_nr(current),
- host->mrq->cmd->opcode, host->last_req_ts, jiffies);
+ host->mrq->cmd->opcode, host->last_req_ts,
+ jiffies);
}
spin_unlock_irqrestore(&host->lock, flags);
@@ -1117,6 +1118,7 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
struct tmio_mmc_host *host = mmc_priv(mmc);
struct tmio_mmc_data *pdata = host->pdata;
int ret = mmc_gpio_get_ro(mmc);
+
if (ret >= 0)
return ret;
@@ -1173,6 +1175,7 @@ static void tmio_mmc_of_parse(struct platform_device *pdev,
struct tmio_mmc_data *pdata)
{
const struct device_node *np = pdev->dev.of_node;
+
if (!np)
return;
@@ -1243,7 +1246,8 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
return -ENOMEM;
tmio_mmc_ops.card_busy = _host->card_busy;
- tmio_mmc_ops.start_signal_voltage_switch = _host->start_signal_voltage_switch;
+ tmio_mmc_ops.start_signal_voltage_switch =
+ _host->start_signal_voltage_switch;
mmc->ops = &tmio_mmc_ops;
mmc->caps |= MMC_CAP_4_BIT_DATA | pdata->capabilities;
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index c83c16b931a8..26e8f8c0a6db 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -13,15 +13,15 @@
#define tmio_ioread16(addr) readw(addr)
#define tmio_ioread16_rep(r, b, l) readsw(r, b, l)
#define tmio_ioread32(addr) \
- (((u32) readw((addr))) | (((u32) readw((addr) + 2)) << 16))
+ (((u32)readw((addr))) | (((u32)readw((addr) + 2)) << 16))
#define tmio_iowrite8(val, addr) writeb((val), (addr))
#define tmio_iowrite16(val, addr) writew((val), (addr))
#define tmio_iowrite16_rep(r, b, l) writesw(r, b, l)
#define tmio_iowrite32(val, addr) \
do { \
- writew((val), (addr)); \
- writew((val) >> 16, (addr) + 2); \
+ writew((val), (addr)); \
+ writew((val) >> 16, (addr) + 2); \
} while (0)
#define CNF_CMD 0x04
@@ -55,57 +55,57 @@
} while (0)
/* tmio MMC platform flags */
-#define TMIO_MMC_WRPROTECT_DISABLE (1 << 0)
+#define TMIO_MMC_WRPROTECT_DISABLE BIT(0)
/*
* Some controllers can support a 2-byte block size when the bus width
* is configured in 4-bit mode.
*/
-#define TMIO_MMC_BLKSZ_2BYTES (1 << 1)
+#define TMIO_MMC_BLKSZ_2BYTES BIT(1)
/*
* Some controllers can support SDIO IRQ signalling.
*/
-#define TMIO_MMC_SDIO_IRQ (1 << 2)
+#define TMIO_MMC_SDIO_IRQ BIT(2)
/* Some features are only available or tested on R-Car Gen2 or later */
-#define TMIO_MMC_MIN_RCAR2 (1 << 3)
+#define TMIO_MMC_MIN_RCAR2 BIT(3)
/*
* Some controllers require waiting for the SD bus to become
* idle before writing to some registers.
*/
-#define TMIO_MMC_HAS_IDLE_WAIT (1 << 4)
+#define TMIO_MMC_HAS_IDLE_WAIT BIT(4)
/*
* A GPIO is used for card hotplug detection. We need an extra flag for this,
* because 0 is a valid GPIO number too, and requiring users to specify
* cd_gpio < 0 to disable GPIO hotplug would break backwards compatibility.
*/
-#define TMIO_MMC_USE_GPIO_CD (1 << 5)
+#define TMIO_MMC_USE_GPIO_CD BIT(5)
/*
* Some controllers doesn't have over 0x100 register.
* it is used to checking accessibility of
* CTL_SD_CARD_CLK_CTL / CTL_CLK_AND_WAIT_CTL
*/
-#define TMIO_MMC_HAVE_HIGH_REG (1 << 6)
+#define TMIO_MMC_HAVE_HIGH_REG BIT(6)
/*
* Some controllers have CMD12 automatically
* issue/non-issue register
*/
-#define TMIO_MMC_HAVE_CMD12_CTRL (1 << 7)
+#define TMIO_MMC_HAVE_CMD12_CTRL BIT(7)
/* Controller has some SDIO status bits which must be 1 */
-#define TMIO_MMC_SDIO_STATUS_SETBITS (1 << 8)
+#define TMIO_MMC_SDIO_STATUS_SETBITS BIT(8)
/*
* Some controllers have a 32-bit wide data port register
*/
-#define TMIO_MMC_32BIT_DATA_PORT (1 << 9)
+#define TMIO_MMC_32BIT_DATA_PORT BIT(9)
/*
* Some controllers allows to set SDx actual clock
*/
-#define TMIO_MMC_CLK_ACTUAL (1 << 10)
+#define TMIO_MMC_CLK_ACTUAL BIT(10)
int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
@@ -146,9 +146,9 @@ struct tmio_nand_data {
struct tmio_fb_data {
int (*lcd_set_power)(struct platform_device *fb_dev,
- bool on);
+ bool on);
int (*lcd_mode)(struct platform_device *fb_dev,
- const struct fb_videomode *mode);
+ const struct fb_videomode *mode);
int num_modes;
struct fb_videomode *modes;
@@ -157,5 +157,4 @@ struct tmio_fb_data {
int width;
};
-
#endif
--
2.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH mmc/next v3 2/2] mmc: renesas-sdhi: improve checkpatch cleanness
2017-06-16 16:11 [PATCH mmc/next v3 0/2] mmc: tmio, renesas-sdhi: cleanups Simon Horman
2017-06-16 16:11 ` [PATCH mmc/next v3 1/2] mmc: tmio: improve checkpatch cleanness Simon Horman
@ 2017-06-16 16:11 ` Simon Horman
2017-06-19 12:43 ` Ulf Hansson
1 sibling, 1 reply; 7+ messages in thread
From: Simon Horman @ 2017-06-16 16:11 UTC (permalink / raw)
To: Wolfram Sang, Ulf Hansson
Cc: Magnus Damm, linux-mmc, linux-renesas-soc, Simon Horman
Trivial updates to improve checkpatch cleanness.
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
v2
* Correct one-line comment style
* Leave bus_shift size comments unchanged
---
drivers/mmc/host/renesas_sdhi.h | 2 +-
drivers/mmc/host/renesas_sdhi_core.c | 43 ++++++++++++++++----------------
drivers/mmc/host/renesas_sdhi_sys_dmac.c | 25 +++++++++++--------
3 files changed, 37 insertions(+), 33 deletions(-)
diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
index 6b4a79508c6b..ca83acc113b8 100644
--- a/drivers/mmc/host/renesas_sdhi.h
+++ b/drivers/mmc/host/renesas_sdhi.h
@@ -34,6 +34,6 @@ struct renesas_sdhi_of_data {
};
int renesas_sdhi_probe(struct platform_device *pdev,
- const struct tmio_mmc_dma_ops *dma_ops);
+ const struct tmio_mmc_dma_ops *dma_ops);
int renesas_sdhi_remove(struct platform_device *pdev);
#endif
diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index f4690cba3443..a4fb07d0ea91 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -45,7 +45,8 @@
#define SDHI_VER_GEN3_SD 0xcc10
#define SDHI_VER_GEN3_SDMMC 0xcd10
-#define host_to_priv(host) container_of((host)->pdata, struct renesas_sdhi, mmc_data)
+#define host_to_priv(host) \
+ container_of((host)->pdata, struct renesas_sdhi, mmc_data)
struct renesas_sdhi {
struct clk *clk;
@@ -94,6 +95,7 @@ static int renesas_sdhi_clk_enable(struct tmio_mmc_host *host)
struct mmc_host *mmc = host->mmc;
struct renesas_sdhi *priv = host_to_priv(host);
int ret = clk_prepare_enable(priv->clk);
+
if (ret < 0)
return ret;
@@ -125,7 +127,7 @@ static int renesas_sdhi_clk_enable(struct tmio_mmc_host *host)
}
static unsigned int renesas_sdhi_clk_update(struct tmio_mmc_host *host,
- unsigned int new_clock)
+ unsigned int new_clock)
{
struct renesas_sdhi *priv = host_to_priv(host);
unsigned int freq, diff, best_freq = 0, diff_min = ~0;
@@ -175,11 +177,12 @@ static int renesas_sdhi_card_busy(struct mmc_host *mmc)
{
struct tmio_mmc_host *host = mmc_priv(mmc);
- return !(sd_ctrl_read16_and_16_as_32(host, CTL_STATUS) & TMIO_STAT_DAT0);
+ return !(sd_ctrl_read16_and_16_as_32(host, CTL_STATUS) &
+ TMIO_STAT_DAT0);
}
static int renesas_sdhi_start_signal_voltage_switch(struct mmc_host *mmc,
- struct mmc_ios *ios)
+ struct mmc_ios *ios)
{
struct tmio_mmc_host *host = mmc_priv(mmc);
struct renesas_sdhi *priv = host_to_priv(host);
@@ -285,7 +288,7 @@ static unsigned int renesas_sdhi_init_tuning(struct tmio_mmc_host *host)
}
static void renesas_sdhi_prepare_tuning(struct tmio_mmc_host *host,
- unsigned long tap)
+ unsigned long tap)
{
struct renesas_sdhi *priv = host_to_priv(host);
@@ -318,9 +321,9 @@ static int renesas_sdhi_select_tuning(struct tmio_mmc_host *host)
tap_start = 0;
tap_end = 0;
for (i = 0; i < host->tap_num * 2; i++) {
- if (test_bit(i, host->taps))
+ if (test_bit(i, host->taps)) {
ntap++;
- else {
+ } else {
if (ntap > tap_cnt) {
tap_start = i - ntap;
tap_end = i - 1;
@@ -352,7 +355,6 @@ static int renesas_sdhi_select_tuning(struct tmio_mmc_host *host)
return 0;
}
-
static bool renesas_sdhi_check_scc_error(struct tmio_mmc_host *host)
{
struct renesas_sdhi *priv = host_to_priv(host);
@@ -414,8 +416,7 @@ static int renesas_sdhi_wait_idle(struct tmio_mmc_host *host)
static int renesas_sdhi_write16_hook(struct tmio_mmc_host *host, int addr)
{
- switch (addr)
- {
+ switch (addr) {
case CTL_SD_CMD:
case CTL_STOP_INTERNAL_ACTION:
case CTL_XFER_BLK_COUNT:
@@ -432,7 +433,7 @@ static int renesas_sdhi_write16_hook(struct tmio_mmc_host *host, int addr)
}
static int renesas_sdhi_multi_io_quirk(struct mmc_card *card,
- unsigned int direction, int blk_size)
+ unsigned int direction, int blk_size)
{
/*
* In Renesas controllers, when performing a
@@ -460,20 +461,23 @@ static void renesas_sdhi_enable_dma(struct tmio_mmc_host *host, bool enable)
int renesas_sdhi_probe(struct platform_device *pdev,
const struct tmio_mmc_dma_ops *dma_ops)
{
- const struct renesas_sdhi_of_data *of_data = of_device_get_match_data( &pdev->dev);
- struct renesas_sdhi *priv;
- struct tmio_mmc_data *mmc_data;
struct tmio_mmc_data *mmd = pdev->dev.platform_data;
+ const struct renesas_sdhi_of_data *of_data;
+ struct tmio_mmc_data *mmc_data;
+ struct tmio_mmc_dma *dma_priv;
struct tmio_mmc_host *host;
+ struct renesas_sdhi *priv;
struct resource *res;
int irq, ret, i;
- struct tmio_mmc_dma *dma_priv;
+
+ of_data = of_device_get_match_data(&pdev->dev);
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -EINVAL;
- priv = devm_kzalloc(&pdev->dev, sizeof(struct renesas_sdhi), GFP_KERNEL);
+ priv = devm_kzalloc(&pdev->dev, sizeof(struct renesas_sdhi),
+ GFP_KERNEL);
if (!priv)
return -ENOMEM;
@@ -516,7 +520,6 @@ int renesas_sdhi_probe(struct platform_device *pdev,
goto eprobe;
}
-
if (of_data) {
mmc_data->flags |= of_data->tmio_flags;
mmc_data->ocr_mask = of_data->tmio_ocr_mask;
@@ -566,9 +569,7 @@ int renesas_sdhi_probe(struct platform_device *pdev,
*/
mmc_data->flags |= TMIO_MMC_SDIO_IRQ;
- /*
- * All SDHI have CMD12 controll bit
- */
+ /* All SDHI have CMD12 control bit */
mmc_data->flags |= TMIO_MMC_HAVE_CMD12_CTRL;
/* All SDHI have SDIO status bits which must be 1 */
@@ -614,7 +615,7 @@ int renesas_sdhi_probe(struct platform_device *pdev,
break;
i++;
ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_irq, 0,
- dev_name(&pdev->dev), host);
+ dev_name(&pdev->dev), host);
if (ret)
goto eirq;
}
diff --git a/drivers/mmc/host/renesas_sdhi_sys_dmac.c b/drivers/mmc/host/renesas_sdhi_sys_dmac.c
index 202cf4346fdf..642a0dcc8c5c 100644
--- a/drivers/mmc/host/renesas_sdhi_sys_dmac.c
+++ b/drivers/mmc/host/renesas_sdhi_sys_dmac.c
@@ -104,7 +104,6 @@ static const struct of_device_id renesas_sdhi_sys_dmac_of_match[] = {
};
MODULE_DEVICE_TABLE(of, renesas_sdhi_sys_dmac_of_match);
-
static void renesas_sdhi_sys_dmac_enable_dma(struct tmio_mmc_host *host,
bool enable)
{
@@ -196,8 +195,8 @@ static void renesas_sdhi_sys_dmac_start_dma_rx(struct tmio_mmc_host *host)
ret = dma_map_sg(chan->device->dev, sg, host->sg_len, DMA_FROM_DEVICE);
if (ret > 0)
- desc = dmaengine_prep_slave_sg(chan, sg, ret,
- DMA_DEV_TO_MEM, DMA_CTRL_ACK);
+ desc = dmaengine_prep_slave_sg(chan, sg, ret, DMA_DEV_TO_MEM,
+ DMA_CTRL_ACK);
if (desc) {
reinit_completion(&host->dma_dataend);
@@ -265,6 +264,7 @@ static void renesas_sdhi_sys_dmac_start_dma_tx(struct tmio_mmc_host *host)
if (!aligned) {
unsigned long flags;
void *sg_vaddr = tmio_mmc_kmap_atomic(sg, &flags);
+
sg_init_one(&host->bounce_sg, host->bounce_buf, sg->length);
memcpy(host->bounce_buf, sg_vaddr, host->bounce_sg.length);
tmio_mmc_kunmap_atomic(sg, &flags, sg_vaddr);
@@ -274,8 +274,8 @@ static void renesas_sdhi_sys_dmac_start_dma_tx(struct tmio_mmc_host *host)
ret = dma_map_sg(chan->device->dev, sg, host->sg_len, DMA_TO_DEVICE);
if (ret > 0)
- desc = dmaengine_prep_slave_sg(chan, sg, ret,
- DMA_MEM_TO_DEV, DMA_CTRL_ACK);
+ desc = dmaengine_prep_slave_sg(chan, sg, ret, DMA_MEM_TO_DEV,
+ DMA_CTRL_ACK);
if (desc) {
reinit_completion(&host->dma_dataend);
@@ -308,7 +308,7 @@ static void renesas_sdhi_sys_dmac_start_dma_tx(struct tmio_mmc_host *host)
}
static void renesas_sdhi_sys_dmac_start_dma(struct tmio_mmc_host *host,
- struct mmc_data *data)
+ struct mmc_data *data)
{
if (data->flags & MMC_DATA_READ) {
if (host->chan_rx)
@@ -346,7 +346,7 @@ static void renesas_sdhi_sys_dmac_request_dma(struct tmio_mmc_host *host,
{
/* We can only either use DMA for both Tx and Rx or not use it at all */
if (!host->dma || (!host->pdev->dev.of_node &&
- (!pdata->chan_priv_tx || !pdata->chan_priv_rx)))
+ (!pdata->chan_priv_tx || !pdata->chan_priv_rx)))
return;
if (!host->chan_tx && !host->chan_rx) {
@@ -372,7 +372,8 @@ static void renesas_sdhi_sys_dmac_request_dma(struct tmio_mmc_host *host,
return;
cfg.direction = DMA_MEM_TO_DEV;
- cfg.dst_addr = res->start + (CTL_SD_DATA_PORT << host->bus_shift);
+ cfg.dst_addr = res->start +
+ (CTL_SD_DATA_PORT << host->bus_shift);
cfg.dst_addr_width = host->dma->dma_buswidth;
if (!cfg.dst_addr_width)
cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
@@ -428,11 +429,13 @@ static void renesas_sdhi_sys_dmac_release_dma(struct tmio_mmc_host *host)
{
if (host->chan_tx) {
struct dma_chan *chan = host->chan_tx;
+
host->chan_tx = NULL;
dma_release_channel(chan);
}
if (host->chan_rx) {
struct dma_chan *chan = host->chan_rx;
+
host->chan_rx = NULL;
dma_release_channel(chan);
}
@@ -457,10 +460,10 @@ static int renesas_sdhi_sys_dmac_probe(struct platform_device *pdev)
static const struct dev_pm_ops renesas_sdhi_sys_dmac_dev_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
- pm_runtime_force_resume)
+ pm_runtime_force_resume)
SET_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
- tmio_mmc_host_runtime_resume,
- NULL)
+ tmio_mmc_host_runtime_resume,
+ NULL)
};
static struct platform_driver renesas_sys_dmac_sdhi_driver = {
--
2.1.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH mmc/next v3 1/2] mmc: tmio: improve checkpatch cleanness
2017-06-16 16:11 ` [PATCH mmc/next v3 1/2] mmc: tmio: improve checkpatch cleanness Simon Horman
@ 2017-06-16 16:34 ` Wolfram Sang
2017-06-19 9:09 ` Simon Horman
2017-06-19 12:43 ` Ulf Hansson
1 sibling, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2017-06-16 16:34 UTC (permalink / raw)
To: Simon Horman
Cc: Wolfram Sang, Ulf Hansson, Magnus Damm, linux-mmc, linux-renesas-soc
[-- Attachment #1: Type: text/plain, Size: 394 bytes --]
On Fri, Jun 16, 2017 at 06:11:03PM +0200, Simon Horman wrote:
> Trivial updates to improve checkpatch cleanness.
>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Thanks for updating it!
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
I can still move files around (and the checksums match) :)
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH mmc/next v3 1/2] mmc: tmio: improve checkpatch cleanness
2017-06-16 16:34 ` Wolfram Sang
@ 2017-06-19 9:09 ` Simon Horman
0 siblings, 0 replies; 7+ messages in thread
From: Simon Horman @ 2017-06-19 9:09 UTC (permalink / raw)
To: Wolfram Sang
Cc: Wolfram Sang, Ulf Hansson, Magnus Damm, linux-mmc, linux-renesas-soc
On Fri, Jun 16, 2017 at 06:34:47PM +0200, Wolfram Sang wrote:
> On Fri, Jun 16, 2017 at 06:11:03PM +0200, Simon Horman wrote:
> > Trivial updates to improve checkpatch cleanness.
> >
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
>
> Thanks for updating it!
Thanks for your patience :)
> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
>
> I can still move files around (and the checksums match) :)
Great. Ulf, I think these are good for mmc/next now.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH mmc/next v3 1/2] mmc: tmio: improve checkpatch cleanness
2017-06-16 16:11 ` [PATCH mmc/next v3 1/2] mmc: tmio: improve checkpatch cleanness Simon Horman
2017-06-16 16:34 ` Wolfram Sang
@ 2017-06-19 12:43 ` Ulf Hansson
1 sibling, 0 replies; 7+ messages in thread
From: Ulf Hansson @ 2017-06-19 12:43 UTC (permalink / raw)
To: Simon Horman
Cc: Wolfram Sang, Magnus Damm, linux-mmc, Linux-Renesas, Lee Jones
+Lee
On 16 June 2017 at 18:11, Simon Horman <horms+renesas@verge.net.au> wrote:
> Trivial updates to improve checkpatch cleanness.
>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
> v3
> * Really don't add bogus ',' after KERN_DEBUG
> * Adjustments as per Wolfram's preferences
>
> v2
> * Don't add bogus ',' after KERN_DEBUG
> * Leave some lines over 80 columns as it seems to be the more readable option
> (very subjective)
> ---
> drivers/mmc/host/renesas_sdhi.h | 2 +-
> drivers/mmc/host/tmio_mmc.c | 8 ++---
> drivers/mmc/host/tmio_mmc.h | 17 ++++++-----
> drivers/mmc/host/tmio_mmc_core.c | 66 +++++++++++++++++++++-------------------
> include/linux/mfd/tmio.h | 33 ++++++++++----------
This change requires an ack from Lee Jones, the mfd maintainer.
However, because of the trivial nature of the change, I will apply it
anyways. If there are any objections later on from Lee, than I can
drop it.
Thanks, applied for next!
Kind regards
Uffe
> 5 files changed, 66 insertions(+), 60 deletions(-)
>
> diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
> index eb3ea15ff92d..6b4a79508c6b 100644
> --- a/drivers/mmc/host/renesas_sdhi.h
> +++ b/drivers/mmc/host/renesas_sdhi.h
> @@ -27,7 +27,7 @@ struct renesas_sdhi_of_data {
> unsigned long capabilities2;
> enum dma_slave_buswidth dma_buswidth;
> dma_addr_t dma_rx_offset;
> - unsigned bus_shift;
> + unsigned int bus_shift;
> int scc_offset;
> struct renesas_sdhi_scc *taps;
> int taps_num;
> diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
> index 61cf36fb270b..64b7e9f18361 100644
> --- a/drivers/mmc/host/tmio_mmc.c
> +++ b/drivers/mmc/host/tmio_mmc.c
> @@ -104,8 +104,8 @@ static int tmio_mmc_probe(struct platform_device *pdev)
> goto host_free;
>
> ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_irq,
> - IRQF_TRIGGER_FALLING,
> - dev_name(&pdev->dev), host);
> + IRQF_TRIGGER_FALLING,
> + dev_name(&pdev->dev), host);
> if (ret)
> goto host_remove;
>
> @@ -132,6 +132,7 @@ static int tmio_mmc_remove(struct platform_device *pdev)
>
> if (mmc) {
> struct tmio_mmc_host *host = mmc_priv(mmc);
> +
> tmio_mmc_host_remove(host);
> if (cell->disable)
> cell->disable(pdev);
> @@ -145,8 +146,7 @@ static int tmio_mmc_remove(struct platform_device *pdev)
> static const struct dev_pm_ops tmio_mmc_dev_pm_ops = {
> SET_SYSTEM_SLEEP_PM_OPS(tmio_mmc_suspend, tmio_mmc_resume)
> SET_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
> - tmio_mmc_host_runtime_resume,
> - NULL)
> + tmio_mmc_host_runtime_resume, NULL)
> };
>
> static struct platform_driver tmio_mmc_driver = {
> diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
> index 768c8abaedda..6ad6704175dc 100644
> --- a/drivers/mmc/host/tmio_mmc.h
> +++ b/drivers/mmc/host/tmio_mmc.h
> @@ -239,24 +239,26 @@ static inline u16 sd_ctrl_read16(struct tmio_mmc_host *host, int addr)
> }
>
> static inline void sd_ctrl_read16_rep(struct tmio_mmc_host *host, int addr,
> - u16 *buf, int count)
> + u16 *buf, int count)
> {
> readsw(host->ctl + (addr << host->bus_shift), buf, count);
> }
>
> -static inline u32 sd_ctrl_read16_and_16_as_32(struct tmio_mmc_host *host, int addr)
> +static inline u32 sd_ctrl_read16_and_16_as_32(struct tmio_mmc_host *host,
> + int addr)
> {
> return readw(host->ctl + (addr << host->bus_shift)) |
> readw(host->ctl + ((addr + 2) << host->bus_shift)) << 16;
> }
>
> static inline void sd_ctrl_read32_rep(struct tmio_mmc_host *host, int addr,
> - u32 *buf, int count)
> + u32 *buf, int count)
> {
> readsl(host->ctl + (addr << host->bus_shift), buf, count);
> }
>
> -static inline void sd_ctrl_write16(struct tmio_mmc_host *host, int addr, u16 val)
> +static inline void sd_ctrl_write16(struct tmio_mmc_host *host, int addr,
> + u16 val)
> {
> /* If there is a hook and it returns non-zero then there
> * is an error and the write should be skipped
> @@ -267,19 +269,20 @@ static inline void sd_ctrl_write16(struct tmio_mmc_host *host, int addr, u16 val
> }
>
> static inline void sd_ctrl_write16_rep(struct tmio_mmc_host *host, int addr,
> - u16 *buf, int count)
> + u16 *buf, int count)
> {
> writesw(host->ctl + (addr << host->bus_shift), buf, count);
> }
>
> -static inline void sd_ctrl_write32_as_16_and_16(struct tmio_mmc_host *host, int addr, u32 val)
> +static inline void sd_ctrl_write32_as_16_and_16(struct tmio_mmc_host *host,
> + int addr, u32 val)
> {
> writew(val & 0xffff, host->ctl + (addr << host->bus_shift));
> writew(val >> 16, host->ctl + ((addr + 2) << host->bus_shift));
> }
>
> static inline void sd_ctrl_write32_rep(struct tmio_mmc_host *host, int addr,
> - const u32 *buf, int count)
> + const u32 *buf, int count)
> {
> writesl(host->ctl + (addr << host->bus_shift), buf, count);
> }
> diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c
> index fbe38464e7d7..82b80d42f7ae 100644
> --- a/drivers/mmc/host/tmio_mmc_core.c
> +++ b/drivers/mmc/host/tmio_mmc_core.c
> @@ -127,16 +127,17 @@ static int tmio_mmc_next_sg(struct tmio_mmc_host *host)
>
> #define STATUS_TO_TEXT(a, status, i) \
> do { \
> - if (status & TMIO_STAT_##a) { \
> - if (i++) \
> - printk(" | "); \
> - printk(#a); \
> + if ((status) & TMIO_STAT_##a) { \
> + if ((i)++) \
> + printk(KERN_DEBUG " | "); \
> + printk(KERN_DEBUG #a); \
> } \
> } while (0)
>
> static void pr_debug_status(u32 status)
> {
> int i = 0;
> +
> pr_debug("status: %08x = ", status);
> STATUS_TO_TEXT(CARD_REMOVE, status, i);
> STATUS_TO_TEXT(CARD_INSERT, status, i);
> @@ -177,8 +178,7 @@ static void tmio_mmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
> pm_runtime_get_sync(mmc_dev(mmc));
>
> host->sdio_irq_enabled = true;
> - host->sdio_irq_mask = TMIO_SDIO_MASK_ALL &
> - ~TMIO_SDIO_STAT_IOIRQ;
> + host->sdio_irq_mask = TMIO_SDIO_MASK_ALL & ~TMIO_SDIO_STAT_IOIRQ;
>
> /* Clear obsolete interrupts before enabling */
> sdio_status = sd_ctrl_read16(host, CTL_SDIO_STATUS) & ~TMIO_SDIO_MASK_ALL;
> @@ -222,7 +222,7 @@ static void tmio_mmc_clk_stop(struct tmio_mmc_host *host)
> }
>
> static void tmio_mmc_set_clock(struct tmio_mmc_host *host,
> - unsigned int new_clock)
> + unsigned int new_clock)
> {
> u32 clk = 0, clock;
>
> @@ -289,16 +289,16 @@ static void tmio_mmc_reset_work(struct work_struct *work)
> * cancel_delayed_work(), it can happen, that a .set_ios() call preempts
> * us, so, have to check for IS_ERR(host->mrq)
> */
> - if (IS_ERR_OR_NULL(mrq)
> - || time_is_after_jiffies(host->last_req_ts +
> - msecs_to_jiffies(CMDREQ_TIMEOUT))) {
> + if (IS_ERR_OR_NULL(mrq) ||
> + time_is_after_jiffies(host->last_req_ts +
> + msecs_to_jiffies(CMDREQ_TIMEOUT))) {
> spin_unlock_irqrestore(&host->lock, flags);
> return;
> }
>
> dev_warn(&host->pdev->dev,
> - "timeout waiting for hardware interrupt (CMD%u)\n",
> - mrq->cmd->opcode);
> + "timeout waiting for hardware interrupt (CMD%u)\n",
> + mrq->cmd->opcode);
>
> if (host->data)
> host->data->error = -ETIMEDOUT;
> @@ -336,7 +336,8 @@ static void tmio_mmc_reset_work(struct work_struct *work)
> #define SECURITY_CMD 0x4000
> #define NO_CMD12_ISSUE 0x4000 /* TMIO_MMC_HAVE_CMD12_CTRL */
>
> -static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command *cmd)
> +static int tmio_mmc_start_command(struct tmio_mmc_host *host,
> + struct mmc_command *cmd)
> {
> struct mmc_data *data = host->data;
> int c = cmd->opcode;
> @@ -375,8 +376,8 @@ static int tmio_mmc_start_command(struct tmio_mmc_host *host, struct mmc_command
> c |= TRANSFER_MULTI;
>
> /*
> - * Disable auto CMD12 at IO_RW_EXTENDED and SET_BLOCK_COUNT
> - * when doing multiple block transfer
> + * Disable auto CMD12 at IO_RW_EXTENDED and
> + * SET_BLOCK_COUNT when doing multiple block transfer
> */
> if ((host->pdata->flags & TMIO_MMC_HAVE_CMD12_CTRL) &&
> (cmd->opcode == SD_IO_RW_EXTENDED || host->mrq->sbc))
> @@ -501,8 +502,6 @@ static void tmio_mmc_pio_irq(struct tmio_mmc_host *host)
>
> if (host->sg_off == host->sg_ptr->length)
> tmio_mmc_next_sg(host);
> -
> - return;
> }
>
> static void tmio_mmc_check_bounce_buffer(struct tmio_mmc_host *host)
> @@ -510,6 +509,7 @@ static void tmio_mmc_check_bounce_buffer(struct tmio_mmc_host *host)
> if (host->sg_ptr == &host->bounce_sg) {
> unsigned long flags;
> void *sg_vaddr = tmio_mmc_kmap_atomic(host->sg_orig, &flags);
> +
> memcpy(sg_vaddr, host->bounce_buf, host->bounce_sg.length);
> tmio_mmc_kunmap_atomic(host->sg_orig, &flags, sg_vaddr);
> }
> @@ -574,6 +574,7 @@ EXPORT_SYMBOL_GPL(tmio_mmc_do_data_irq);
> static void tmio_mmc_data_irq(struct tmio_mmc_host *host, unsigned int stat)
> {
> struct mmc_data *data;
> +
> spin_lock(&host->lock);
> data = host->data;
>
> @@ -618,8 +619,7 @@ static void tmio_mmc_data_irq(struct tmio_mmc_host *host, unsigned int stat)
> spin_unlock(&host->lock);
> }
>
> -static void tmio_mmc_cmd_irq(struct tmio_mmc_host *host,
> - unsigned int stat)
> +static void tmio_mmc_cmd_irq(struct tmio_mmc_host *host, unsigned int stat)
> {
> struct mmc_command *cmd = host->cmd;
> int i, addr;
> @@ -680,7 +680,7 @@ static void tmio_mmc_cmd_irq(struct tmio_mmc_host *host,
> }
>
> static bool __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host,
> - int ireg, int status)
> + int ireg, int status)
> {
> struct mmc_host *mmc = host->mmc;
>
> @@ -698,14 +698,13 @@ static bool __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host,
> return false;
> }
>
> -static bool __tmio_mmc_sdcard_irq(struct tmio_mmc_host *host,
> - int ireg, int status)
> +static bool __tmio_mmc_sdcard_irq(struct tmio_mmc_host *host, int ireg,
> + int status)
> {
> /* Command completion */
> if (ireg & (TMIO_STAT_CMDRESPEND | TMIO_STAT_CMDTIMEOUT)) {
> - tmio_mmc_ack_mmc_irqs(host,
> - TMIO_STAT_CMDRESPEND |
> - TMIO_STAT_CMDTIMEOUT);
> + tmio_mmc_ack_mmc_irqs(host, TMIO_STAT_CMDRESPEND |
> + TMIO_STAT_CMDTIMEOUT);
> tmio_mmc_cmd_irq(host, status);
> return true;
> }
> @@ -776,7 +775,7 @@ irqreturn_t tmio_mmc_irq(int irq, void *devid)
> EXPORT_SYMBOL_GPL(tmio_mmc_irq);
>
> static int tmio_mmc_start_data(struct tmio_mmc_host *host,
> - struct mmc_data *data)
> + struct mmc_data *data)
> {
> struct tmio_mmc_data *pdata = host->pdata;
>
> @@ -831,7 +830,7 @@ static int tmio_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode)
>
> if (host->tap_num * 2 >= sizeof(host->taps) * BITS_PER_BYTE) {
> dev_warn_once(&host->pdev->dev,
> - "Too many taps, skipping tuning. Please consider updating size of taps field of tmio_mmc_host\n");
> + "Too many taps, skipping tuning. Please consider updating size of taps field of tmio_mmc_host\n");
> goto out;
> }
>
> @@ -862,7 +861,8 @@ static int tmio_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode)
> return ret;
> }
>
> -static void tmio_process_mrq(struct tmio_mmc_host *host, struct mmc_request *mrq)
> +static void tmio_process_mrq(struct tmio_mmc_host *host,
> + struct mmc_request *mrq)
> {
> struct mmc_command *cmd;
> int ret;
> @@ -1030,7 +1030,7 @@ static void tmio_mmc_power_off(struct tmio_mmc_host *host)
> }
>
> static void tmio_mmc_set_bus_width(struct tmio_mmc_host *host,
> - unsigned char bus_width)
> + unsigned char bus_width)
> {
> u16 reg = sd_ctrl_read16(host, CTL_SD_MEM_CARD_OPT)
> & ~(CARD_OPT_WIDTH | CARD_OPT_WIDTH8);
> @@ -1070,7 +1070,8 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
> dev_dbg(dev,
> "%s.%d: CMD%u active since %lu, now %lu!\n",
> current->comm, task_pid_nr(current),
> - host->mrq->cmd->opcode, host->last_req_ts, jiffies);
> + host->mrq->cmd->opcode, host->last_req_ts,
> + jiffies);
> }
> spin_unlock_irqrestore(&host->lock, flags);
>
> @@ -1117,6 +1118,7 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc)
> struct tmio_mmc_host *host = mmc_priv(mmc);
> struct tmio_mmc_data *pdata = host->pdata;
> int ret = mmc_gpio_get_ro(mmc);
> +
> if (ret >= 0)
> return ret;
>
> @@ -1173,6 +1175,7 @@ static void tmio_mmc_of_parse(struct platform_device *pdev,
> struct tmio_mmc_data *pdata)
> {
> const struct device_node *np = pdev->dev.of_node;
> +
> if (!np)
> return;
>
> @@ -1243,7 +1246,8 @@ int tmio_mmc_host_probe(struct tmio_mmc_host *_host,
> return -ENOMEM;
>
> tmio_mmc_ops.card_busy = _host->card_busy;
> - tmio_mmc_ops.start_signal_voltage_switch = _host->start_signal_voltage_switch;
> + tmio_mmc_ops.start_signal_voltage_switch =
> + _host->start_signal_voltage_switch;
> mmc->ops = &tmio_mmc_ops;
>
> mmc->caps |= MMC_CAP_4_BIT_DATA | pdata->capabilities;
> diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
> index c83c16b931a8..26e8f8c0a6db 100644
> --- a/include/linux/mfd/tmio.h
> +++ b/include/linux/mfd/tmio.h
> @@ -13,15 +13,15 @@
> #define tmio_ioread16(addr) readw(addr)
> #define tmio_ioread16_rep(r, b, l) readsw(r, b, l)
> #define tmio_ioread32(addr) \
> - (((u32) readw((addr))) | (((u32) readw((addr) + 2)) << 16))
> + (((u32)readw((addr))) | (((u32)readw((addr) + 2)) << 16))
>
> #define tmio_iowrite8(val, addr) writeb((val), (addr))
> #define tmio_iowrite16(val, addr) writew((val), (addr))
> #define tmio_iowrite16_rep(r, b, l) writesw(r, b, l)
> #define tmio_iowrite32(val, addr) \
> do { \
> - writew((val), (addr)); \
> - writew((val) >> 16, (addr) + 2); \
> + writew((val), (addr)); \
> + writew((val) >> 16, (addr) + 2); \
> } while (0)
>
> #define CNF_CMD 0x04
> @@ -55,57 +55,57 @@
> } while (0)
>
> /* tmio MMC platform flags */
> -#define TMIO_MMC_WRPROTECT_DISABLE (1 << 0)
> +#define TMIO_MMC_WRPROTECT_DISABLE BIT(0)
> /*
> * Some controllers can support a 2-byte block size when the bus width
> * is configured in 4-bit mode.
> */
> -#define TMIO_MMC_BLKSZ_2BYTES (1 << 1)
> +#define TMIO_MMC_BLKSZ_2BYTES BIT(1)
> /*
> * Some controllers can support SDIO IRQ signalling.
> */
> -#define TMIO_MMC_SDIO_IRQ (1 << 2)
> +#define TMIO_MMC_SDIO_IRQ BIT(2)
>
> /* Some features are only available or tested on R-Car Gen2 or later */
> -#define TMIO_MMC_MIN_RCAR2 (1 << 3)
> +#define TMIO_MMC_MIN_RCAR2 BIT(3)
>
> /*
> * Some controllers require waiting for the SD bus to become
> * idle before writing to some registers.
> */
> -#define TMIO_MMC_HAS_IDLE_WAIT (1 << 4)
> +#define TMIO_MMC_HAS_IDLE_WAIT BIT(4)
> /*
> * A GPIO is used for card hotplug detection. We need an extra flag for this,
> * because 0 is a valid GPIO number too, and requiring users to specify
> * cd_gpio < 0 to disable GPIO hotplug would break backwards compatibility.
> */
> -#define TMIO_MMC_USE_GPIO_CD (1 << 5)
> +#define TMIO_MMC_USE_GPIO_CD BIT(5)
>
> /*
> * Some controllers doesn't have over 0x100 register.
> * it is used to checking accessibility of
> * CTL_SD_CARD_CLK_CTL / CTL_CLK_AND_WAIT_CTL
> */
> -#define TMIO_MMC_HAVE_HIGH_REG (1 << 6)
> +#define TMIO_MMC_HAVE_HIGH_REG BIT(6)
>
> /*
> * Some controllers have CMD12 automatically
> * issue/non-issue register
> */
> -#define TMIO_MMC_HAVE_CMD12_CTRL (1 << 7)
> +#define TMIO_MMC_HAVE_CMD12_CTRL BIT(7)
>
> /* Controller has some SDIO status bits which must be 1 */
> -#define TMIO_MMC_SDIO_STATUS_SETBITS (1 << 8)
> +#define TMIO_MMC_SDIO_STATUS_SETBITS BIT(8)
>
> /*
> * Some controllers have a 32-bit wide data port register
> */
> -#define TMIO_MMC_32BIT_DATA_PORT (1 << 9)
> +#define TMIO_MMC_32BIT_DATA_PORT BIT(9)
>
> /*
> * Some controllers allows to set SDx actual clock
> */
> -#define TMIO_MMC_CLK_ACTUAL (1 << 10)
> +#define TMIO_MMC_CLK_ACTUAL BIT(10)
>
> int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
> int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
> @@ -146,9 +146,9 @@ struct tmio_nand_data {
>
> struct tmio_fb_data {
> int (*lcd_set_power)(struct platform_device *fb_dev,
> - bool on);
> + bool on);
> int (*lcd_mode)(struct platform_device *fb_dev,
> - const struct fb_videomode *mode);
> + const struct fb_videomode *mode);
> int num_modes;
> struct fb_videomode *modes;
>
> @@ -157,5 +157,4 @@ struct tmio_fb_data {
> int width;
> };
>
> -
> #endif
> --
> 2.1.4
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH mmc/next v3 2/2] mmc: renesas-sdhi: improve checkpatch cleanness
2017-06-16 16:11 ` [PATCH mmc/next v3 2/2] mmc: renesas-sdhi: " Simon Horman
@ 2017-06-19 12:43 ` Ulf Hansson
0 siblings, 0 replies; 7+ messages in thread
From: Ulf Hansson @ 2017-06-19 12:43 UTC (permalink / raw)
To: Simon Horman; +Cc: Wolfram Sang, Magnus Damm, linux-mmc, Linux-Renesas
On 16 June 2017 at 18:11, Simon Horman <horms+renesas@verge.net.au> wrote:
> Trivial updates to improve checkpatch cleanness.
>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Thanks, applied for next!
Kind regards
Uffe
> ---
> v2
> * Correct one-line comment style
> * Leave bus_shift size comments unchanged
> ---
> drivers/mmc/host/renesas_sdhi.h | 2 +-
> drivers/mmc/host/renesas_sdhi_core.c | 43 ++++++++++++++++----------------
> drivers/mmc/host/renesas_sdhi_sys_dmac.c | 25 +++++++++++--------
> 3 files changed, 37 insertions(+), 33 deletions(-)
>
> diff --git a/drivers/mmc/host/renesas_sdhi.h b/drivers/mmc/host/renesas_sdhi.h
> index 6b4a79508c6b..ca83acc113b8 100644
> --- a/drivers/mmc/host/renesas_sdhi.h
> +++ b/drivers/mmc/host/renesas_sdhi.h
> @@ -34,6 +34,6 @@ struct renesas_sdhi_of_data {
> };
>
> int renesas_sdhi_probe(struct platform_device *pdev,
> - const struct tmio_mmc_dma_ops *dma_ops);
> + const struct tmio_mmc_dma_ops *dma_ops);
> int renesas_sdhi_remove(struct platform_device *pdev);
> #endif
> diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
> index f4690cba3443..a4fb07d0ea91 100644
> --- a/drivers/mmc/host/renesas_sdhi_core.c
> +++ b/drivers/mmc/host/renesas_sdhi_core.c
> @@ -45,7 +45,8 @@
> #define SDHI_VER_GEN3_SD 0xcc10
> #define SDHI_VER_GEN3_SDMMC 0xcd10
>
> -#define host_to_priv(host) container_of((host)->pdata, struct renesas_sdhi, mmc_data)
> +#define host_to_priv(host) \
> + container_of((host)->pdata, struct renesas_sdhi, mmc_data)
>
> struct renesas_sdhi {
> struct clk *clk;
> @@ -94,6 +95,7 @@ static int renesas_sdhi_clk_enable(struct tmio_mmc_host *host)
> struct mmc_host *mmc = host->mmc;
> struct renesas_sdhi *priv = host_to_priv(host);
> int ret = clk_prepare_enable(priv->clk);
> +
> if (ret < 0)
> return ret;
>
> @@ -125,7 +127,7 @@ static int renesas_sdhi_clk_enable(struct tmio_mmc_host *host)
> }
>
> static unsigned int renesas_sdhi_clk_update(struct tmio_mmc_host *host,
> - unsigned int new_clock)
> + unsigned int new_clock)
> {
> struct renesas_sdhi *priv = host_to_priv(host);
> unsigned int freq, diff, best_freq = 0, diff_min = ~0;
> @@ -175,11 +177,12 @@ static int renesas_sdhi_card_busy(struct mmc_host *mmc)
> {
> struct tmio_mmc_host *host = mmc_priv(mmc);
>
> - return !(sd_ctrl_read16_and_16_as_32(host, CTL_STATUS) & TMIO_STAT_DAT0);
> + return !(sd_ctrl_read16_and_16_as_32(host, CTL_STATUS) &
> + TMIO_STAT_DAT0);
> }
>
> static int renesas_sdhi_start_signal_voltage_switch(struct mmc_host *mmc,
> - struct mmc_ios *ios)
> + struct mmc_ios *ios)
> {
> struct tmio_mmc_host *host = mmc_priv(mmc);
> struct renesas_sdhi *priv = host_to_priv(host);
> @@ -285,7 +288,7 @@ static unsigned int renesas_sdhi_init_tuning(struct tmio_mmc_host *host)
> }
>
> static void renesas_sdhi_prepare_tuning(struct tmio_mmc_host *host,
> - unsigned long tap)
> + unsigned long tap)
> {
> struct renesas_sdhi *priv = host_to_priv(host);
>
> @@ -318,9 +321,9 @@ static int renesas_sdhi_select_tuning(struct tmio_mmc_host *host)
> tap_start = 0;
> tap_end = 0;
> for (i = 0; i < host->tap_num * 2; i++) {
> - if (test_bit(i, host->taps))
> + if (test_bit(i, host->taps)) {
> ntap++;
> - else {
> + } else {
> if (ntap > tap_cnt) {
> tap_start = i - ntap;
> tap_end = i - 1;
> @@ -352,7 +355,6 @@ static int renesas_sdhi_select_tuning(struct tmio_mmc_host *host)
> return 0;
> }
>
> -
> static bool renesas_sdhi_check_scc_error(struct tmio_mmc_host *host)
> {
> struct renesas_sdhi *priv = host_to_priv(host);
> @@ -414,8 +416,7 @@ static int renesas_sdhi_wait_idle(struct tmio_mmc_host *host)
>
> static int renesas_sdhi_write16_hook(struct tmio_mmc_host *host, int addr)
> {
> - switch (addr)
> - {
> + switch (addr) {
> case CTL_SD_CMD:
> case CTL_STOP_INTERNAL_ACTION:
> case CTL_XFER_BLK_COUNT:
> @@ -432,7 +433,7 @@ static int renesas_sdhi_write16_hook(struct tmio_mmc_host *host, int addr)
> }
>
> static int renesas_sdhi_multi_io_quirk(struct mmc_card *card,
> - unsigned int direction, int blk_size)
> + unsigned int direction, int blk_size)
> {
> /*
> * In Renesas controllers, when performing a
> @@ -460,20 +461,23 @@ static void renesas_sdhi_enable_dma(struct tmio_mmc_host *host, bool enable)
> int renesas_sdhi_probe(struct platform_device *pdev,
> const struct tmio_mmc_dma_ops *dma_ops)
> {
> - const struct renesas_sdhi_of_data *of_data = of_device_get_match_data( &pdev->dev);
> - struct renesas_sdhi *priv;
> - struct tmio_mmc_data *mmc_data;
> struct tmio_mmc_data *mmd = pdev->dev.platform_data;
> + const struct renesas_sdhi_of_data *of_data;
> + struct tmio_mmc_data *mmc_data;
> + struct tmio_mmc_dma *dma_priv;
> struct tmio_mmc_host *host;
> + struct renesas_sdhi *priv;
> struct resource *res;
> int irq, ret, i;
> - struct tmio_mmc_dma *dma_priv;
> +
> + of_data = of_device_get_match_data(&pdev->dev);
>
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> if (!res)
> return -EINVAL;
>
> - priv = devm_kzalloc(&pdev->dev, sizeof(struct renesas_sdhi), GFP_KERNEL);
> + priv = devm_kzalloc(&pdev->dev, sizeof(struct renesas_sdhi),
> + GFP_KERNEL);
> if (!priv)
> return -ENOMEM;
>
> @@ -516,7 +520,6 @@ int renesas_sdhi_probe(struct platform_device *pdev,
> goto eprobe;
> }
>
> -
> if (of_data) {
> mmc_data->flags |= of_data->tmio_flags;
> mmc_data->ocr_mask = of_data->tmio_ocr_mask;
> @@ -566,9 +569,7 @@ int renesas_sdhi_probe(struct platform_device *pdev,
> */
> mmc_data->flags |= TMIO_MMC_SDIO_IRQ;
>
> - /*
> - * All SDHI have CMD12 controll bit
> - */
> + /* All SDHI have CMD12 control bit */
> mmc_data->flags |= TMIO_MMC_HAVE_CMD12_CTRL;
>
> /* All SDHI have SDIO status bits which must be 1 */
> @@ -614,7 +615,7 @@ int renesas_sdhi_probe(struct platform_device *pdev,
> break;
> i++;
> ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_irq, 0,
> - dev_name(&pdev->dev), host);
> + dev_name(&pdev->dev), host);
> if (ret)
> goto eirq;
> }
> diff --git a/drivers/mmc/host/renesas_sdhi_sys_dmac.c b/drivers/mmc/host/renesas_sdhi_sys_dmac.c
> index 202cf4346fdf..642a0dcc8c5c 100644
> --- a/drivers/mmc/host/renesas_sdhi_sys_dmac.c
> +++ b/drivers/mmc/host/renesas_sdhi_sys_dmac.c
> @@ -104,7 +104,6 @@ static const struct of_device_id renesas_sdhi_sys_dmac_of_match[] = {
> };
> MODULE_DEVICE_TABLE(of, renesas_sdhi_sys_dmac_of_match);
>
> -
> static void renesas_sdhi_sys_dmac_enable_dma(struct tmio_mmc_host *host,
> bool enable)
> {
> @@ -196,8 +195,8 @@ static void renesas_sdhi_sys_dmac_start_dma_rx(struct tmio_mmc_host *host)
>
> ret = dma_map_sg(chan->device->dev, sg, host->sg_len, DMA_FROM_DEVICE);
> if (ret > 0)
> - desc = dmaengine_prep_slave_sg(chan, sg, ret,
> - DMA_DEV_TO_MEM, DMA_CTRL_ACK);
> + desc = dmaengine_prep_slave_sg(chan, sg, ret, DMA_DEV_TO_MEM,
> + DMA_CTRL_ACK);
>
> if (desc) {
> reinit_completion(&host->dma_dataend);
> @@ -265,6 +264,7 @@ static void renesas_sdhi_sys_dmac_start_dma_tx(struct tmio_mmc_host *host)
> if (!aligned) {
> unsigned long flags;
> void *sg_vaddr = tmio_mmc_kmap_atomic(sg, &flags);
> +
> sg_init_one(&host->bounce_sg, host->bounce_buf, sg->length);
> memcpy(host->bounce_buf, sg_vaddr, host->bounce_sg.length);
> tmio_mmc_kunmap_atomic(sg, &flags, sg_vaddr);
> @@ -274,8 +274,8 @@ static void renesas_sdhi_sys_dmac_start_dma_tx(struct tmio_mmc_host *host)
>
> ret = dma_map_sg(chan->device->dev, sg, host->sg_len, DMA_TO_DEVICE);
> if (ret > 0)
> - desc = dmaengine_prep_slave_sg(chan, sg, ret,
> - DMA_MEM_TO_DEV, DMA_CTRL_ACK);
> + desc = dmaengine_prep_slave_sg(chan, sg, ret, DMA_MEM_TO_DEV,
> + DMA_CTRL_ACK);
>
> if (desc) {
> reinit_completion(&host->dma_dataend);
> @@ -308,7 +308,7 @@ static void renesas_sdhi_sys_dmac_start_dma_tx(struct tmio_mmc_host *host)
> }
>
> static void renesas_sdhi_sys_dmac_start_dma(struct tmio_mmc_host *host,
> - struct mmc_data *data)
> + struct mmc_data *data)
> {
> if (data->flags & MMC_DATA_READ) {
> if (host->chan_rx)
> @@ -346,7 +346,7 @@ static void renesas_sdhi_sys_dmac_request_dma(struct tmio_mmc_host *host,
> {
> /* We can only either use DMA for both Tx and Rx or not use it at all */
> if (!host->dma || (!host->pdev->dev.of_node &&
> - (!pdata->chan_priv_tx || !pdata->chan_priv_rx)))
> + (!pdata->chan_priv_tx || !pdata->chan_priv_rx)))
> return;
>
> if (!host->chan_tx && !host->chan_rx) {
> @@ -372,7 +372,8 @@ static void renesas_sdhi_sys_dmac_request_dma(struct tmio_mmc_host *host,
> return;
>
> cfg.direction = DMA_MEM_TO_DEV;
> - cfg.dst_addr = res->start + (CTL_SD_DATA_PORT << host->bus_shift);
> + cfg.dst_addr = res->start +
> + (CTL_SD_DATA_PORT << host->bus_shift);
> cfg.dst_addr_width = host->dma->dma_buswidth;
> if (!cfg.dst_addr_width)
> cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
> @@ -428,11 +429,13 @@ static void renesas_sdhi_sys_dmac_release_dma(struct tmio_mmc_host *host)
> {
> if (host->chan_tx) {
> struct dma_chan *chan = host->chan_tx;
> +
> host->chan_tx = NULL;
> dma_release_channel(chan);
> }
> if (host->chan_rx) {
> struct dma_chan *chan = host->chan_rx;
> +
> host->chan_rx = NULL;
> dma_release_channel(chan);
> }
> @@ -457,10 +460,10 @@ static int renesas_sdhi_sys_dmac_probe(struct platform_device *pdev)
>
> static const struct dev_pm_ops renesas_sdhi_sys_dmac_dev_pm_ops = {
> SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend,
> - pm_runtime_force_resume)
> + pm_runtime_force_resume)
> SET_RUNTIME_PM_OPS(tmio_mmc_host_runtime_suspend,
> - tmio_mmc_host_runtime_resume,
> - NULL)
> + tmio_mmc_host_runtime_resume,
> + NULL)
> };
>
> static struct platform_driver renesas_sys_dmac_sdhi_driver = {
> --
> 2.1.4
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-06-19 12:43 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-16 16:11 [PATCH mmc/next v3 0/2] mmc: tmio, renesas-sdhi: cleanups Simon Horman
2017-06-16 16:11 ` [PATCH mmc/next v3 1/2] mmc: tmio: improve checkpatch cleanness Simon Horman
2017-06-16 16:34 ` Wolfram Sang
2017-06-19 9:09 ` Simon Horman
2017-06-19 12:43 ` Ulf Hansson
2017-06-16 16:11 ` [PATCH mmc/next v3 2/2] mmc: renesas-sdhi: " Simon Horman
2017-06-19 12:43 ` Ulf Hansson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.