linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] mmc: tmio/sdhi: clean up cruft
@ 2016-04-06  9:25 Wolfram Sang
  2016-04-06  9:25 ` [PATCH 1/6] mmc: sh_mobile_sdhi: don't use array for DT configs Wolfram Sang
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Wolfram Sang @ 2016-04-06  9:25 UTC (permalink / raw)
  To: linux-mmc
  Cc: Wolfram Sang, linux-renesas-soc, linux-sh, Simon Horman,
	Kuninori Morimoto

Largely due to DT unification, some parts of the code became obsolete. Let's
remove that, the code is complex enough still:

* There are no boards anymore with named interrupt support. Drop support for
  that (patches 2-4)
* No need anymore for a public mmc/tmio.h header file. Merge it into the
  private one (patch 5)

Patches 1+6 are small cleanups found on the way :)

Based on latest renesas-drivers which is based on v4.6-rc1 with my sdr50
patches on top. Tested on a Renesas Lager board and build bot is happy, too
(after finding some issues initially). A branch for testing is here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/sdhi-uhs

I'd think this should all go via mmc, so an ACK from a sh-maintainer on patch 2
would be much appreciated.

Please test, comment, apply...

   Wolfram


Wolfram Sang (6):
  mmc: sh_mobile_sdhi: don't use array for DT configs
  mmc: sh_mobile_sdhi: remove obsolete irq_by_name registration
  mmc: tmio: remove now unneeded seperate irq handlers
  mmc: tmio: simplify irq handler
  mmc: tmio: merge distributed include files
  mmc: sh_mobile_sdhi: simplify code for voltage switching

 arch/sh/boards/board-sh7757lcr.c     |  1 -
 arch/sh/boards/mach-ap325rxa/setup.c |  1 -
 arch/sh/boards/mach-ecovec24/setup.c |  1 -
 arch/sh/boards/mach-kfr2r09/setup.c  |  1 -
 arch/sh/boards/mach-migor/setup.c    |  1 -
 arch/sh/boards/mach-se/7724/setup.c  |  1 -
 drivers/mmc/host/sh_mobile_sdhi.c    | 75 +++++++-----------------------------
 drivers/mmc/host/tmio_mmc.h          | 59 ++++++++++++++++++++++++++--
 drivers/mmc/host/tmio_mmc_dma.c      |  1 -
 drivers/mmc/host/tmio_mmc_pio.c      | 55 +++++---------------------
 include/linux/mmc/sh_mobile_sdhi.h   | 10 -----
 include/linux/mmc/tmio.h             | 73 -----------------------------------
 12 files changed, 79 insertions(+), 200 deletions(-)
 delete mode 100644 include/linux/mmc/sh_mobile_sdhi.h
 delete mode 100644 include/linux/mmc/tmio.h

-- 
2.7.0


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 1/6] mmc: sh_mobile_sdhi: don't use array for DT configs
  2016-04-06  9:25 [PATCH 0/6] mmc: tmio/sdhi: clean up cruft Wolfram Sang
@ 2016-04-06  9:25 ` Wolfram Sang
  2016-04-06  9:56   ` Geert Uytterhoeven
  2016-04-06  9:25 ` [PATCH 2/6] mmc: sh_mobile_sdhi: remove obsolete irq_by_name registration Wolfram Sang
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Wolfram Sang @ 2016-04-06  9:25 UTC (permalink / raw)
  To: linux-mmc
  Cc: Wolfram Sang, linux-renesas-soc, linux-sh, Simon Horman,
	Kuninori Morimoto

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

We won't access an index based array to get our DT config, but create
seperate structs instead. So, remove the array which only wastes memory.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index cf10f8cca9ee2d..9beee48d2e280d 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -51,10 +51,8 @@ struct sh_mobile_sdhi_of_data {
 	unsigned bus_shift;
 };
 
-static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
-	{
-		.tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
-	},
+static const struct sh_mobile_sdhi_of_data of_default_cfg = {
+	.tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
 };
 
 static const struct sh_mobile_sdhi_of_data of_rcar_gen1_compatible = {
@@ -81,9 +79,9 @@ static const struct sh_mobile_sdhi_of_data of_rcar_gen3_compatible = {
 static const struct of_device_id sh_mobile_sdhi_of_match[] = {
 	{ .compatible = "renesas,sdhi-shmobile" },
 	{ .compatible = "renesas,sdhi-sh7372" },
-	{ .compatible = "renesas,sdhi-sh73a0", .data = &sh_mobile_sdhi_of_cfg[0], },
-	{ .compatible = "renesas,sdhi-r8a73a4", .data = &sh_mobile_sdhi_of_cfg[0], },
-	{ .compatible = "renesas,sdhi-r8a7740", .data = &sh_mobile_sdhi_of_cfg[0], },
+	{ .compatible = "renesas,sdhi-sh73a0", .data = &of_default_cfg, },
+	{ .compatible = "renesas,sdhi-r8a73a4", .data = &of_default_cfg, },
+	{ .compatible = "renesas,sdhi-r8a7740", .data = &of_default_cfg, },
 	{ .compatible = "renesas,sdhi-r8a7778", .data = &of_rcar_gen1_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7779", .data = &of_rcar_gen1_compatible, },
 	{ .compatible = "renesas,sdhi-r8a7790", .data = &of_rcar_gen2_compatible, },
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 2/6] mmc: sh_mobile_sdhi: remove obsolete irq_by_name registration
  2016-04-06  9:25 [PATCH 0/6] mmc: tmio/sdhi: clean up cruft Wolfram Sang
  2016-04-06  9:25 ` [PATCH 1/6] mmc: sh_mobile_sdhi: don't use array for DT configs Wolfram Sang
@ 2016-04-06  9:25 ` Wolfram Sang
  2016-04-18  8:21   ` Ulf Hansson
  2016-04-06  9:25 ` [PATCH 3/6] mmc: tmio: remove now unneeded seperate irq handlers Wolfram Sang
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Wolfram Sang @ 2016-04-06  9:25 UTC (permalink / raw)
  To: linux-mmc
  Cc: Wolfram Sang, linux-renesas-soc, linux-sh, Simon Horman,
	Kuninori Morimoto

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

There is no user left in the kernel, so this code can be removed.
(Legacy, non-DT sh_mobile boards have been removed a while ago.) The
diff looks more complicated than it is: The if-block for multiplexed isr
is now the main code path, the rest is removed. A number of sh boards
included the now deleted include file without needing it. Remove that,
too.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 arch/sh/boards/board-sh7757lcr.c     |  1 -
 arch/sh/boards/mach-ap325rxa/setup.c |  1 -
 arch/sh/boards/mach-ecovec24/setup.c |  1 -
 arch/sh/boards/mach-kfr2r09/setup.c  |  1 -
 arch/sh/boards/mach-migor/setup.c    |  1 -
 arch/sh/boards/mach-se/7724/setup.c  |  1 -
 drivers/mmc/host/sh_mobile_sdhi.c    | 57 +++++-------------------------------
 include/linux/mmc/sh_mobile_sdhi.h   | 10 -------
 8 files changed, 8 insertions(+), 65 deletions(-)
 delete mode 100644 include/linux/mmc/sh_mobile_sdhi.h

diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
index 324599bfad1420..0104c8199c48fe 100644
--- a/arch/sh/boards/board-sh7757lcr.c
+++ b/arch/sh/boards/board-sh7757lcr.c
@@ -20,7 +20,6 @@
 #include <linux/mfd/tmio.h>
 #include <linux/mmc/host.h>
 #include <linux/mmc/sh_mmcif.h>
-#include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/sh_eth.h>
 #include <linux/sh_intc.h>
 #include <linux/usb/renesas_usbhs.h>
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
index 62c3b81300ed28..de8393cb7313bc 100644
--- a/arch/sh/boards/mach-ap325rxa/setup.c
+++ b/arch/sh/boards/mach-ap325rxa/setup.c
@@ -15,7 +15,6 @@
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
 #include <linux/mmc/host.h>
-#include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/mtd/physmap.h>
 #include <linux/mtd/sh_flctl.h>
 #include <linux/mfd/tmio.h>
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index a9c0c07386fddd..6d612792f6b8ec 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -13,7 +13,6 @@
 #include <linux/platform_device.h>
 #include <linux/mmc/host.h>
 #include <linux/mmc/sh_mmcif.h>
-#include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/mtd/physmap.h>
 #include <linux/mfd/tmio.h>
 #include <linux/gpio.h>
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
index 6bd9230e64e300..5deb2d82f19f78 100644
--- a/arch/sh/boards/mach-kfr2r09/setup.c
+++ b/arch/sh/boards/mach-kfr2r09/setup.c
@@ -11,7 +11,6 @@
 #include <linux/platform_device.h>
 #include <linux/interrupt.h>
 #include <linux/mmc/host.h>
-#include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/mfd/tmio.h>
 #include <linux/mtd/physmap.h>
 #include <linux/mtd/onenand.h>
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
index 7a04da3efce402..5de60a77eaa1ab 100644
--- a/arch/sh/boards/mach-migor/setup.c
+++ b/arch/sh/boards/mach-migor/setup.c
@@ -13,7 +13,6 @@
 #include <linux/input.h>
 #include <linux/input/sh_keysc.h>
 #include <linux/mmc/host.h>
-#include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/mtd/physmap.h>
 #include <linux/mfd/tmio.h>
 #include <linux/mtd/nand.h>
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index e0e1df136642cd..f1fecd395679ae 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -15,7 +15,6 @@
 #include <linux/interrupt.h>
 #include <linux/platform_device.h>
 #include <linux/mmc/host.h>
-#include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/mfd/tmio.h>
 #include <linux/mtd/physmap.h>
 #include <linux/delay.h>
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 9beee48d2e280d..51d8dbd5b06a3e 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -28,7 +28,6 @@
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
 #include <linux/mmc/host.h>
-#include <linux/mmc/sh_mobile_sdhi.h>
 #include <linux/mfd/tmio.h>
 #include <linux/sh_dma.h>
 #include <linux/delay.h>
@@ -315,7 +314,6 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	struct tmio_mmc_host *host;
 	struct resource *res;
 	int irq, ret, i = 0;
-	bool multiplexed_isr = true;
 	struct tmio_mmc_dma *dma_priv;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -405,62 +403,23 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
 	if (ret < 0)
 		goto efree;
 
-	/*
-	 * Allow one or more specific (named) ISRs or
-	 * one or more multiplexed (un-named) ISRs.
-	 */
-
-	irq = platform_get_irq_byname(pdev, SH_MOBILE_SDHI_IRQ_CARD_DETECT);
-	if (irq >= 0) {
-		multiplexed_isr = false;
-		ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_card_detect_irq, 0,
+	while (1) {
+		irq = platform_get_irq(pdev, i);
+		if (irq < 0)
+			break;
+		i++;
+		ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_irq, 0,
 				  dev_name(&pdev->dev), host);
 		if (ret)
 			goto eirq;
 	}
 
-	irq = platform_get_irq_byname(pdev, SH_MOBILE_SDHI_IRQ_SDIO);
-	if (irq >= 0) {
-		multiplexed_isr = false;
-		ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_sdio_irq, 0,
-				  dev_name(&pdev->dev), host);
-		if (ret)
-			goto eirq;
-	}
-
-	irq = platform_get_irq_byname(pdev, SH_MOBILE_SDHI_IRQ_SDCARD);
-	if (irq >= 0) {
-		multiplexed_isr = false;
-		ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_sdcard_irq, 0,
-				  dev_name(&pdev->dev), host);
-		if (ret)
-			goto eirq;
-	} else if (!multiplexed_isr) {
-		dev_err(&pdev->dev,
-			"Principal SD-card IRQ is missing among named interrupts\n");
+	/* There must be at least one IRQ source */
+	if (!i) {
 		ret = irq;
 		goto eirq;
 	}
 
-	if (multiplexed_isr) {
-		while (1) {
-			irq = platform_get_irq(pdev, i);
-			if (irq < 0)
-				break;
-			i++;
-			ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_irq, 0,
-					  dev_name(&pdev->dev), host);
-			if (ret)
-				goto eirq;
-		}
-
-		/* There must be at least one IRQ source */
-		if (!i) {
-			ret = irq;
-			goto eirq;
-		}
-	}
-
 	dev_info(&pdev->dev, "%s base at 0x%08lx max clock rate %u MHz\n",
 		 mmc_hostname(host->mmc), (unsigned long)
 		 (platform_get_resource(pdev, IORESOURCE_MEM, 0)->start),
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h
deleted file mode 100644
index 95d6f0314a7ded..00000000000000
--- a/include/linux/mmc/sh_mobile_sdhi.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef LINUX_MMC_SH_MOBILE_SDHI_H
-#define LINUX_MMC_SH_MOBILE_SDHI_H
-
-#include <linux/types.h>
-
-#define SH_MOBILE_SDHI_IRQ_CARD_DETECT	"card_detect"
-#define SH_MOBILE_SDHI_IRQ_SDCARD	"sdcard"
-#define SH_MOBILE_SDHI_IRQ_SDIO		"sdio"
-
-#endif /* LINUX_MMC_SH_MOBILE_SDHI_H */
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 3/6] mmc: tmio: remove now unneeded seperate irq handlers
  2016-04-06  9:25 [PATCH 0/6] mmc: tmio/sdhi: clean up cruft Wolfram Sang
  2016-04-06  9:25 ` [PATCH 1/6] mmc: sh_mobile_sdhi: don't use array for DT configs Wolfram Sang
  2016-04-06  9:25 ` [PATCH 2/6] mmc: sh_mobile_sdhi: remove obsolete irq_by_name registration Wolfram Sang
@ 2016-04-06  9:25 ` Wolfram Sang
  2016-04-06  9:25 ` [PATCH 4/6] mmc: tmio: simplify irq handler Wolfram Sang
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 17+ messages in thread
From: Wolfram Sang @ 2016-04-06  9:25 UTC (permalink / raw)
  To: linux-mmc
  Cc: Wolfram Sang, linux-renesas-soc, linux-sh, Simon Horman,
	Kuninori Morimoto

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

We removed installation of seperate handlers previously, so we can also
remove the seperate handlers.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/host/tmio_mmc.h     |  3 ---
 drivers/mmc/host/tmio_mmc_pio.c | 31 ++-----------------------------
 2 files changed, 2 insertions(+), 32 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
index b1819c74965b47..032188b766defd 100644
--- a/drivers/mmc/host/tmio_mmc.h
+++ b/drivers/mmc/host/tmio_mmc.h
@@ -115,9 +115,6 @@ void tmio_mmc_do_data_irq(struct tmio_mmc_host *host);
 void tmio_mmc_enable_mmc_irqs(struct tmio_mmc_host *host, u32 i);
 void tmio_mmc_disable_mmc_irqs(struct tmio_mmc_host *host, u32 i);
 irqreturn_t tmio_mmc_irq(int irq, void *devid);
-irqreturn_t tmio_mmc_sdcard_irq(int irq, void *devid);
-irqreturn_t tmio_mmc_card_detect_irq(int irq, void *devid);
-irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid);
 
 static inline char *tmio_mmc_kmap_atomic(struct scatterlist *sg,
 					 unsigned long *flags)
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 8e2fef7c5e481c..a7250a5fa670c5 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -664,18 +664,6 @@ static bool __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host,
 	return false;
 }
 
-irqreturn_t tmio_mmc_card_detect_irq(int irq, void *devid)
-{
-	unsigned int ireg, status;
-	struct tmio_mmc_host *host = devid;
-
-	tmio_mmc_card_irq_status(host, &ireg, &status);
-	__tmio_mmc_card_detect_irq(host, ireg, status);
-
-	return IRQ_HANDLED;
-}
-EXPORT_SYMBOL(tmio_mmc_card_detect_irq);
-
 static bool __tmio_mmc_sdcard_irq(struct tmio_mmc_host *host,
 				 int ireg, int status)
 {
@@ -705,19 +693,7 @@ static bool __tmio_mmc_sdcard_irq(struct tmio_mmc_host *host,
 	return false;
 }
 
-irqreturn_t tmio_mmc_sdcard_irq(int irq, void *devid)
-{
-	unsigned int ireg, status;
-	struct tmio_mmc_host *host = devid;
-
-	tmio_mmc_card_irq_status(host, &ireg, &status);
-	__tmio_mmc_sdcard_irq(host, ireg, status);
-
-	return IRQ_HANDLED;
-}
-EXPORT_SYMBOL(tmio_mmc_sdcard_irq);
-
-irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)
+static void tmio_mmc_sdio_irq(int irq, void *devid)
 {
 	struct tmio_mmc_host *host = devid;
 	struct mmc_host *mmc = host->mmc;
@@ -726,7 +702,7 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)
 	unsigned int sdio_status;
 
 	if (!(pdata->flags & TMIO_MMC_SDIO_IRQ))
-		return IRQ_HANDLED;
+		return;
 
 	status = sd_ctrl_read16(host, CTL_SDIO_STATUS);
 	ireg = status & TMIO_SDIO_MASK_ALL & ~host->sdcard_irq_mask;
@@ -739,10 +715,7 @@ irqreturn_t tmio_mmc_sdio_irq(int irq, void *devid)
 
 	if (mmc->caps & MMC_CAP_SDIO_IRQ && ireg & TMIO_SDIO_STAT_IOIRQ)
 		mmc_signal_sdio_irq(mmc);
-
-	return IRQ_HANDLED;
 }
-EXPORT_SYMBOL(tmio_mmc_sdio_irq);
 
 irqreturn_t tmio_mmc_irq(int irq, void *devid)
 {
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 4/6] mmc: tmio: simplify irq handler
  2016-04-06  9:25 [PATCH 0/6] mmc: tmio/sdhi: clean up cruft Wolfram Sang
                   ` (2 preceding siblings ...)
  2016-04-06  9:25 ` [PATCH 3/6] mmc: tmio: remove now unneeded seperate irq handlers Wolfram Sang
@ 2016-04-06  9:25 ` Wolfram Sang
  2016-04-06  9:25 ` [PATCH 5/6] mmc: tmio: merge distributed include files Wolfram Sang
  2016-04-06  9:25 ` [PATCH 6/6] mmc: sh_mobile_sdhi: simplify code for voltage switching Wolfram Sang
  5 siblings, 0 replies; 17+ messages in thread
From: Wolfram Sang @ 2016-04-06  9:25 UTC (permalink / raw)
  To: linux-mmc
  Cc: Wolfram Sang, linux-renesas-soc, linux-sh, Simon Horman,
	Kuninori Morimoto

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

Having just one irq handler again, let's include the 'card_status'
function in the main handler which is way more readable. Drop a useless
debug output while here. It should be a dev_dbg in case we ever need it
again.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/host/tmio_mmc_pio.c | 23 ++++++++---------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index a7250a5fa670c5..879e0f5455ef44 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -632,19 +632,6 @@ out:
 	spin_unlock(&host->lock);
 }
 
-static void tmio_mmc_card_irq_status(struct tmio_mmc_host *host,
-				       int *ireg, int *status)
-{
-	*status = sd_ctrl_read32(host, CTL_STATUS);
-	*ireg = *status & TMIO_MASK_IRQ & ~host->sdcard_irq_mask;
-
-	pr_debug_status(*status);
-	pr_debug_status(*ireg);
-
-	/* Clear the status except the interrupt status */
-	sd_ctrl_write32(host, CTL_STATUS, TMIO_MASK_IRQ);
-}
-
 static bool __tmio_mmc_card_detect_irq(struct tmio_mmc_host *host,
 				      int ireg, int status)
 {
@@ -722,9 +709,15 @@ irqreturn_t tmio_mmc_irq(int irq, void *devid)
 	struct tmio_mmc_host *host = devid;
 	unsigned int ireg, status;
 
-	pr_debug("MMC IRQ begin\n");
+	status = sd_ctrl_read32(host, CTL_STATUS);
+	ireg = status & TMIO_MASK_IRQ & ~host->sdcard_irq_mask;
+
+	pr_debug_status(status);
+	pr_debug_status(ireg);
+
+	/* Clear the status except the interrupt status */
+	sd_ctrl_write32(host, CTL_STATUS, TMIO_MASK_IRQ);
 
-	tmio_mmc_card_irq_status(host, &ireg, &status);
 	if (__tmio_mmc_card_detect_irq(host, ireg, status))
 		return IRQ_HANDLED;
 	if (__tmio_mmc_sdcard_irq(host, ireg, status))
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 5/6] mmc: tmio: merge distributed include files
  2016-04-06  9:25 [PATCH 0/6] mmc: tmio/sdhi: clean up cruft Wolfram Sang
                   ` (3 preceding siblings ...)
  2016-04-06  9:25 ` [PATCH 4/6] mmc: tmio: simplify irq handler Wolfram Sang
@ 2016-04-06  9:25 ` Wolfram Sang
  2016-04-06  9:34   ` [PATCH v2 " Wolfram Sang
  2016-04-06  9:25 ` [PATCH 6/6] mmc: sh_mobile_sdhi: simplify code for voltage switching Wolfram Sang
  5 siblings, 1 reply; 17+ messages in thread
From: Wolfram Sang @ 2016-04-06  9:25 UTC (permalink / raw)
  To: linux-mmc
  Cc: Wolfram Sang, linux-renesas-soc, linux-sh, Simon Horman,
	Kuninori Morimoto

There is no reason to have a public and private header file. Merge them
into a private one, so looking up symbols is less confusing.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
 drivers/mmc/host/tmio_mmc.h     | 56 ++++++++++++++++++++++++++++++-
 drivers/mmc/host/tmio_mmc_dma.c |  1 -
 drivers/mmc/host/tmio_mmc_pio.c |  1 -
 include/linux/mmc/tmio.h        | 73 -----------------------------------------
 4 files changed, 55 insertions(+), 76 deletions(-)
 delete mode 100644 include/linux/mmc/tmio.h

diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
index 032188b766defd..439fdad2bad91d 100644
--- a/drivers/mmc/host/tmio_mmc.h
+++ b/drivers/mmc/host/tmio_mmc.h
@@ -1,6 +1,8 @@
 /*
  * linux/drivers/mmc/host/tmio_mmc.h
  *
+ * Copyright (C) 2016 Sang Engineering, Wolfram Sang
+ * Copyright (C) 2015-16 Renesas Electronics Corporation
  * Copyright (C) 2007 Ian Molton
  * Copyright (C) 2004 Ian Molton
  *
@@ -18,12 +20,64 @@
 
 #include <linux/dmaengine.h>
 #include <linux/highmem.h>
-#include <linux/mmc/tmio.h>
 #include <linux/mutex.h>
 #include <linux/pagemap.h>
 #include <linux/scatterlist.h>
 #include <linux/spinlock.h>
 
+#define CTL_SD_CMD 0x00
+#define CTL_ARG_REG 0x04
+#define CTL_STOP_INTERNAL_ACTION 0x08
+#define CTL_XFER_BLK_COUNT 0xa
+#define CTL_RESPONSE 0x0c
+#define CTL_STATUS 0x1c
+#define CTL_STATUS2 0x1e
+#define CTL_IRQ_MASK 0x20
+#define CTL_SD_CARD_CLK_CTL 0x24
+#define CTL_SD_XFER_LEN 0x26
+#define CTL_SD_MEM_CARD_OPT 0x28
+#define CTL_SD_ERROR_DETAIL_STATUS 0x2c
+#define CTL_SD_DATA_PORT 0x30
+#define CTL_TRANSACTION_CTL 0x34
+#define CTL_SDIO_STATUS 0x36
+#define CTL_SDIO_IRQ_MASK 0x38
+#define CTL_DMA_ENABLE 0xd8
+#define CTL_RESET_SD 0xe0
+#define CTL_VERSION 0xe2
+#define CTL_SDIO_REGS 0x100
+#define CTL_CLK_AND_WAIT_CTL 0x138
+#define CTL_RESET_SDIO 0x1e0
+
+/* Definitions for values the CTRL_STATUS register can take. */
+#define TMIO_STAT_CMDRESPEND    0x00000001
+#define TMIO_STAT_DATAEND       0x00000004
+#define TMIO_STAT_CARD_REMOVE   0x00000008
+#define TMIO_STAT_CARD_INSERT   0x00000010
+#define TMIO_STAT_SIGSTATE      0x00000020
+#define TMIO_STAT_WRPROTECT     0x00000080
+#define TMIO_STAT_CARD_REMOVE_A 0x00000100
+#define TMIO_STAT_CARD_INSERT_A 0x00000200
+#define TMIO_STAT_SIGSTATE_A    0x00000400
+#define TMIO_STAT_CMD_IDX_ERR   0x00010000
+#define TMIO_STAT_CRCFAIL       0x00020000
+#define TMIO_STAT_STOPBIT_ERR   0x00040000
+#define TMIO_STAT_DATATIMEOUT   0x00080000
+#define TMIO_STAT_RXOVERFLOW    0x00100000
+#define TMIO_STAT_TXUNDERRUN    0x00200000
+#define TMIO_STAT_CMDTIMEOUT    0x00400000
+#define TMIO_STAT_RXRDY         0x01000000
+#define TMIO_STAT_TXRQ          0x02000000
+#define TMIO_STAT_ILL_FUNC      0x20000000
+#define TMIO_STAT_CMD_BUSY      0x40000000
+#define TMIO_STAT_ILL_ACCESS    0x80000000
+
+#define TMIO_STATUS2_DAT0	BIT(7)
+
+#define	CLK_CTL_DIV_MASK	0xff
+#define	CLK_CTL_SCLKEN		BIT(8)
+
+#define TMIO_BBS		512		/* Boot block size */
+
 /* Definitions for values the CTRL_SDIO_STATUS register can take. */
 #define TMIO_SDIO_STAT_IOIRQ	0x0001
 #define TMIO_SDIO_STAT_EXPUB52	0x4000
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index 67543587382312..d1573687515d2c 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -15,7 +15,6 @@
 #include <linux/dmaengine.h>
 #include <linux/mfd/tmio.h>
 #include <linux/mmc/host.h>
-#include <linux/mmc/tmio.h>
 #include <linux/pagemap.h>
 #include <linux/scatterlist.h>
 
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 879e0f5455ef44..15e6f6d5a42337 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -39,7 +39,6 @@
 #include <linux/mmc/host.h>
 #include <linux/mmc/mmc.h>
 #include <linux/mmc/slot-gpio.h>
-#include <linux/mmc/tmio.h>
 #include <linux/module.h>
 #include <linux/pagemap.h>
 #include <linux/platform_device.h>
diff --git a/include/linux/mmc/tmio.h b/include/linux/mmc/tmio.h
deleted file mode 100644
index b2f28e99503383..00000000000000
--- a/include/linux/mmc/tmio.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * include/linux/mmc/tmio.h
- *
- * Copyright (C) 2016 Sang Engineering, Wolfram Sang
- * Copyright (C) 2015-16 Renesas Electronics Corporation
- * Copyright (C) 2007 Ian Molton
- * Copyright (C) 2004 Ian Molton
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Driver for the MMC / SD / SDIO cell found in:
- *
- * TC6393XB TC6391XB TC6387XB T7L66XB ASIC3
- */
-#ifndef LINUX_MMC_TMIO_H
-#define LINUX_MMC_TMIO_H
-
-#define CTL_SD_CMD 0x00
-#define CTL_ARG_REG 0x04
-#define CTL_STOP_INTERNAL_ACTION 0x08
-#define CTL_XFER_BLK_COUNT 0xa
-#define CTL_RESPONSE 0x0c
-#define CTL_STATUS 0x1c
-#define CTL_STATUS2 0x1e
-#define CTL_IRQ_MASK 0x20
-#define CTL_SD_CARD_CLK_CTL 0x24
-#define CTL_SD_XFER_LEN 0x26
-#define CTL_SD_MEM_CARD_OPT 0x28
-#define CTL_SD_ERROR_DETAIL_STATUS 0x2c
-#define CTL_SD_DATA_PORT 0x30
-#define CTL_TRANSACTION_CTL 0x34
-#define CTL_SDIO_STATUS 0x36
-#define CTL_SDIO_IRQ_MASK 0x38
-#define CTL_DMA_ENABLE 0xd8
-#define CTL_RESET_SD 0xe0
-#define CTL_VERSION 0xe2
-#define CTL_SDIO_REGS 0x100
-#define CTL_CLK_AND_WAIT_CTL 0x138
-#define CTL_RESET_SDIO 0x1e0
-
-/* Definitions for values the CTRL_STATUS register can take. */
-#define TMIO_STAT_CMDRESPEND    0x00000001
-#define TMIO_STAT_DATAEND       0x00000004
-#define TMIO_STAT_CARD_REMOVE   0x00000008
-#define TMIO_STAT_CARD_INSERT   0x00000010
-#define TMIO_STAT_SIGSTATE      0x00000020
-#define TMIO_STAT_WRPROTECT     0x00000080
-#define TMIO_STAT_CARD_REMOVE_A 0x00000100
-#define TMIO_STAT_CARD_INSERT_A 0x00000200
-#define TMIO_STAT_SIGSTATE_A    0x00000400
-#define TMIO_STAT_CMD_IDX_ERR   0x00010000
-#define TMIO_STAT_CRCFAIL       0x00020000
-#define TMIO_STAT_STOPBIT_ERR   0x00040000
-#define TMIO_STAT_DATATIMEOUT   0x00080000
-#define TMIO_STAT_RXOVERFLOW    0x00100000
-#define TMIO_STAT_TXUNDERRUN    0x00200000
-#define TMIO_STAT_CMDTIMEOUT    0x00400000
-#define TMIO_STAT_RXRDY         0x01000000
-#define TMIO_STAT_TXRQ          0x02000000
-#define TMIO_STAT_ILL_FUNC      0x20000000
-#define TMIO_STAT_CMD_BUSY      0x40000000
-#define TMIO_STAT_ILL_ACCESS    0x80000000
-
-#define TMIO_STATUS2_DAT0	BIT(7)
-
-#define	CLK_CTL_DIV_MASK	0xff
-#define	CLK_CTL_SCLKEN		BIT(8)
-
-#define TMIO_BBS		512		/* Boot block size */
-
-#endif /* LINUX_MMC_TMIO_H */
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 6/6] mmc: sh_mobile_sdhi: simplify code for voltage switching
  2016-04-06  9:25 [PATCH 0/6] mmc: tmio/sdhi: clean up cruft Wolfram Sang
                   ` (4 preceding siblings ...)
  2016-04-06  9:25 ` [PATCH 5/6] mmc: tmio: merge distributed include files Wolfram Sang
@ 2016-04-06  9:25 ` Wolfram Sang
  5 siblings, 0 replies; 17+ messages in thread
From: Wolfram Sang @ 2016-04-06  9:25 UTC (permalink / raw)
  To: linux-mmc
  Cc: Wolfram Sang, linux-renesas-soc, linux-sh, Simon Horman,
	Kuninori Morimoto

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

A last minute fix applied by Ulf made room for some simplification.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/mmc/host/sh_mobile_sdhi.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
index 51d8dbd5b06a3e..b85b87eb55009f 100644
--- a/drivers/mmc/host/sh_mobile_sdhi.c
+++ b/drivers/mmc/host/sh_mobile_sdhi.c
@@ -237,11 +237,7 @@ static int sh_mobile_sdhi_start_signal_voltage_switch(struct mmc_host *mmc,
 	if (ret)
 		return ret;
 
-	ret = pinctrl_select_state(priv->pinctrl, pin_state);
-	if (ret)
-		return ret;
-
-	return 0;
+	return pinctrl_select_state(priv->pinctrl, pin_state);
 }
 
 static int sh_mobile_sdhi_wait_idle(struct tmio_mmc_host *host)
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH v2 5/6] mmc: tmio: merge distributed include files
  2016-04-06  9:25 ` [PATCH 5/6] mmc: tmio: merge distributed include files Wolfram Sang
@ 2016-04-06  9:34   ` Wolfram Sang
  0 siblings, 0 replies; 17+ messages in thread
From: Wolfram Sang @ 2016-04-06  9:34 UTC (permalink / raw)
  To: linux-mmc
  Cc: Wolfram Sang, linux-renesas-soc, linux-sh, Simon Horman,
	Kuninori Morimoto

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

There is no reason to have a public and private header file. Merge them
into a private one, so looking up symbols is less confusing.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

change since v1: correct authorship. Sorry for the noise.

 drivers/mmc/host/tmio_mmc.h     | 56 ++++++++++++++++++++++++++++++-
 drivers/mmc/host/tmio_mmc_dma.c |  1 -
 drivers/mmc/host/tmio_mmc_pio.c |  1 -
 include/linux/mmc/tmio.h        | 73 -----------------------------------------
 4 files changed, 55 insertions(+), 76 deletions(-)
 delete mode 100644 include/linux/mmc/tmio.h

diff --git a/drivers/mmc/host/tmio_mmc.h b/drivers/mmc/host/tmio_mmc.h
index 032188b766defd..439fdad2bad91d 100644
--- a/drivers/mmc/host/tmio_mmc.h
+++ b/drivers/mmc/host/tmio_mmc.h
@@ -1,6 +1,8 @@
 /*
  * linux/drivers/mmc/host/tmio_mmc.h
  *
+ * Copyright (C) 2016 Sang Engineering, Wolfram Sang
+ * Copyright (C) 2015-16 Renesas Electronics Corporation
  * Copyright (C) 2007 Ian Molton
  * Copyright (C) 2004 Ian Molton
  *
@@ -18,12 +20,64 @@
 
 #include <linux/dmaengine.h>
 #include <linux/highmem.h>
-#include <linux/mmc/tmio.h>
 #include <linux/mutex.h>
 #include <linux/pagemap.h>
 #include <linux/scatterlist.h>
 #include <linux/spinlock.h>
 
+#define CTL_SD_CMD 0x00
+#define CTL_ARG_REG 0x04
+#define CTL_STOP_INTERNAL_ACTION 0x08
+#define CTL_XFER_BLK_COUNT 0xa
+#define CTL_RESPONSE 0x0c
+#define CTL_STATUS 0x1c
+#define CTL_STATUS2 0x1e
+#define CTL_IRQ_MASK 0x20
+#define CTL_SD_CARD_CLK_CTL 0x24
+#define CTL_SD_XFER_LEN 0x26
+#define CTL_SD_MEM_CARD_OPT 0x28
+#define CTL_SD_ERROR_DETAIL_STATUS 0x2c
+#define CTL_SD_DATA_PORT 0x30
+#define CTL_TRANSACTION_CTL 0x34
+#define CTL_SDIO_STATUS 0x36
+#define CTL_SDIO_IRQ_MASK 0x38
+#define CTL_DMA_ENABLE 0xd8
+#define CTL_RESET_SD 0xe0
+#define CTL_VERSION 0xe2
+#define CTL_SDIO_REGS 0x100
+#define CTL_CLK_AND_WAIT_CTL 0x138
+#define CTL_RESET_SDIO 0x1e0
+
+/* Definitions for values the CTRL_STATUS register can take. */
+#define TMIO_STAT_CMDRESPEND    0x00000001
+#define TMIO_STAT_DATAEND       0x00000004
+#define TMIO_STAT_CARD_REMOVE   0x00000008
+#define TMIO_STAT_CARD_INSERT   0x00000010
+#define TMIO_STAT_SIGSTATE      0x00000020
+#define TMIO_STAT_WRPROTECT     0x00000080
+#define TMIO_STAT_CARD_REMOVE_A 0x00000100
+#define TMIO_STAT_CARD_INSERT_A 0x00000200
+#define TMIO_STAT_SIGSTATE_A    0x00000400
+#define TMIO_STAT_CMD_IDX_ERR   0x00010000
+#define TMIO_STAT_CRCFAIL       0x00020000
+#define TMIO_STAT_STOPBIT_ERR   0x00040000
+#define TMIO_STAT_DATATIMEOUT   0x00080000
+#define TMIO_STAT_RXOVERFLOW    0x00100000
+#define TMIO_STAT_TXUNDERRUN    0x00200000
+#define TMIO_STAT_CMDTIMEOUT    0x00400000
+#define TMIO_STAT_RXRDY         0x01000000
+#define TMIO_STAT_TXRQ          0x02000000
+#define TMIO_STAT_ILL_FUNC      0x20000000
+#define TMIO_STAT_CMD_BUSY      0x40000000
+#define TMIO_STAT_ILL_ACCESS    0x80000000
+
+#define TMIO_STATUS2_DAT0	BIT(7)
+
+#define	CLK_CTL_DIV_MASK	0xff
+#define	CLK_CTL_SCLKEN		BIT(8)
+
+#define TMIO_BBS		512		/* Boot block size */
+
 /* Definitions for values the CTRL_SDIO_STATUS register can take. */
 #define TMIO_SDIO_STAT_IOIRQ	0x0001
 #define TMIO_SDIO_STAT_EXPUB52	0x4000
diff --git a/drivers/mmc/host/tmio_mmc_dma.c b/drivers/mmc/host/tmio_mmc_dma.c
index 67543587382312..d1573687515d2c 100644
--- a/drivers/mmc/host/tmio_mmc_dma.c
+++ b/drivers/mmc/host/tmio_mmc_dma.c
@@ -15,7 +15,6 @@
 #include <linux/dmaengine.h>
 #include <linux/mfd/tmio.h>
 #include <linux/mmc/host.h>
-#include <linux/mmc/tmio.h>
 #include <linux/pagemap.h>
 #include <linux/scatterlist.h>
 
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 879e0f5455ef44..15e6f6d5a42337 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -39,7 +39,6 @@
 #include <linux/mmc/host.h>
 #include <linux/mmc/mmc.h>
 #include <linux/mmc/slot-gpio.h>
-#include <linux/mmc/tmio.h>
 #include <linux/module.h>
 #include <linux/pagemap.h>
 #include <linux/platform_device.h>
diff --git a/include/linux/mmc/tmio.h b/include/linux/mmc/tmio.h
deleted file mode 100644
index b2f28e99503383..00000000000000
--- a/include/linux/mmc/tmio.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * include/linux/mmc/tmio.h
- *
- * Copyright (C) 2016 Sang Engineering, Wolfram Sang
- * Copyright (C) 2015-16 Renesas Electronics Corporation
- * Copyright (C) 2007 Ian Molton
- * Copyright (C) 2004 Ian Molton
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * Driver for the MMC / SD / SDIO cell found in:
- *
- * TC6393XB TC6391XB TC6387XB T7L66XB ASIC3
- */
-#ifndef LINUX_MMC_TMIO_H
-#define LINUX_MMC_TMIO_H
-
-#define CTL_SD_CMD 0x00
-#define CTL_ARG_REG 0x04
-#define CTL_STOP_INTERNAL_ACTION 0x08
-#define CTL_XFER_BLK_COUNT 0xa
-#define CTL_RESPONSE 0x0c
-#define CTL_STATUS 0x1c
-#define CTL_STATUS2 0x1e
-#define CTL_IRQ_MASK 0x20
-#define CTL_SD_CARD_CLK_CTL 0x24
-#define CTL_SD_XFER_LEN 0x26
-#define CTL_SD_MEM_CARD_OPT 0x28
-#define CTL_SD_ERROR_DETAIL_STATUS 0x2c
-#define CTL_SD_DATA_PORT 0x30
-#define CTL_TRANSACTION_CTL 0x34
-#define CTL_SDIO_STATUS 0x36
-#define CTL_SDIO_IRQ_MASK 0x38
-#define CTL_DMA_ENABLE 0xd8
-#define CTL_RESET_SD 0xe0
-#define CTL_VERSION 0xe2
-#define CTL_SDIO_REGS 0x100
-#define CTL_CLK_AND_WAIT_CTL 0x138
-#define CTL_RESET_SDIO 0x1e0
-
-/* Definitions for values the CTRL_STATUS register can take. */
-#define TMIO_STAT_CMDRESPEND    0x00000001
-#define TMIO_STAT_DATAEND       0x00000004
-#define TMIO_STAT_CARD_REMOVE   0x00000008
-#define TMIO_STAT_CARD_INSERT   0x00000010
-#define TMIO_STAT_SIGSTATE      0x00000020
-#define TMIO_STAT_WRPROTECT     0x00000080
-#define TMIO_STAT_CARD_REMOVE_A 0x00000100
-#define TMIO_STAT_CARD_INSERT_A 0x00000200
-#define TMIO_STAT_SIGSTATE_A    0x00000400
-#define TMIO_STAT_CMD_IDX_ERR   0x00010000
-#define TMIO_STAT_CRCFAIL       0x00020000
-#define TMIO_STAT_STOPBIT_ERR   0x00040000
-#define TMIO_STAT_DATATIMEOUT   0x00080000
-#define TMIO_STAT_RXOVERFLOW    0x00100000
-#define TMIO_STAT_TXUNDERRUN    0x00200000
-#define TMIO_STAT_CMDTIMEOUT    0x00400000
-#define TMIO_STAT_RXRDY         0x01000000
-#define TMIO_STAT_TXRQ          0x02000000
-#define TMIO_STAT_ILL_FUNC      0x20000000
-#define TMIO_STAT_CMD_BUSY      0x40000000
-#define TMIO_STAT_ILL_ACCESS    0x80000000
-
-#define TMIO_STATUS2_DAT0	BIT(7)
-
-#define	CLK_CTL_DIV_MASK	0xff
-#define	CLK_CTL_SCLKEN		BIT(8)
-
-#define TMIO_BBS		512		/* Boot block size */
-
-#endif /* LINUX_MMC_TMIO_H */
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [PATCH 1/6] mmc: sh_mobile_sdhi: don't use array for DT configs
  2016-04-06  9:25 ` [PATCH 1/6] mmc: sh_mobile_sdhi: don't use array for DT configs Wolfram Sang
@ 2016-04-06  9:56   ` Geert Uytterhoeven
  2016-04-06 10:27     ` Wolfram Sang
  0 siblings, 1 reply; 17+ messages in thread
From: Geert Uytterhoeven @ 2016-04-06  9:56 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Linux MMC List, linux-renesas-soc, Linux-sh list, Simon Horman,
	Kuninori Morimoto

Hi Wolfram,

On Wed, Apr 6, 2016 at 11:25 AM, Wolfram Sang <wsa@the-dreams.de> wrote:
> From: Wolfram Sang <wsa+renesas@sang-engineering.com>
>
> We won't access an index based array to get our DT config, but create
> seperate structs instead. So, remove the array which only wastes memory.

While I agree with your patch, I don't agree with the memory consumption
comment...

It does remove 2 lines of source code ;-)

> --- a/drivers/mmc/host/sh_mobile_sdhi.c
> +++ b/drivers/mmc/host/sh_mobile_sdhi.c
> @@ -51,10 +51,8 @@ struct sh_mobile_sdhi_of_data {
>         unsigned bus_shift;
>  };
>
> -static const struct sh_mobile_sdhi_of_data sh_mobile_sdhi_of_cfg[] = {
> -       {
> -               .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
> -       },

Array of a single element.

> +static const struct sh_mobile_sdhi_of_data of_default_cfg = {
> +       .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
>  };

Single element.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 1/6] mmc: sh_mobile_sdhi: don't use array for DT configs
  2016-04-06  9:56   ` Geert Uytterhoeven
@ 2016-04-06 10:27     ` Wolfram Sang
  0 siblings, 0 replies; 17+ messages in thread
From: Wolfram Sang @ 2016-04-06 10:27 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linux MMC List, linux-renesas-soc, Linux-sh list, Simon Horman,
	Kuninori Morimoto

[-- Attachment #1: Type: text/plain, Size: 65 bytes --]


> It does remove 2 lines of source code ;-)

Memory on disk :)


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/6] mmc: sh_mobile_sdhi: remove obsolete irq_by_name registration
  2016-04-06  9:25 ` [PATCH 2/6] mmc: sh_mobile_sdhi: remove obsolete irq_by_name registration Wolfram Sang
@ 2016-04-18  8:21   ` Ulf Hansson
  2016-04-19  9:37     ` Wolfram Sang
  2016-04-26 15:47     ` Wolfram Sang
  0 siblings, 2 replies; 17+ messages in thread
From: Ulf Hansson @ 2016-04-18  8:21 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-mmc, linux-renesas-soc, Linux-sh list, Simon Horman,
	Kuninori Morimoto

On 6 April 2016 at 11:25, Wolfram Sang <wsa@the-dreams.de> wrote:
> From: Wolfram Sang <wsa+renesas@sang-engineering.com>
>
> There is no user left in the kernel, so this code can be removed.
> (Legacy, non-DT sh_mobile boards have been removed a while ago.) The
> diff looks more complicated than it is: The if-block for multiplexed isr
> is now the main code path, the rest is removed. A number of sh boards
> included the now deleted include file without needing it. Remove that,
> too.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>  arch/sh/boards/board-sh7757lcr.c     |  1 -
>  arch/sh/boards/mach-ap325rxa/setup.c |  1 -
>  arch/sh/boards/mach-ecovec24/setup.c |  1 -
>  arch/sh/boards/mach-kfr2r09/setup.c  |  1 -
>  arch/sh/boards/mach-migor/setup.c    |  1 -
>  arch/sh/boards/mach-se/7724/setup.c  |  1 -
>  drivers/mmc/host/sh_mobile_sdhi.c    | 57 +++++-------------------------------
>  include/linux/mmc/sh_mobile_sdhi.h   | 10 -------
>  8 files changed, 8 insertions(+), 65 deletions(-)
>  delete mode 100644 include/linux/mmc/sh_mobile_sdhi.h

Hi Wolfram,

I need and ack from the Superh arch maintainer to apply this one.

It seems like you didn't include them on "to/cc" list, perhaps repost!?

Kind regards
Uffe

>
> diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
> index 324599bfad1420..0104c8199c48fe 100644
> --- a/arch/sh/boards/board-sh7757lcr.c
> +++ b/arch/sh/boards/board-sh7757lcr.c
> @@ -20,7 +20,6 @@
>  #include <linux/mfd/tmio.h>
>  #include <linux/mmc/host.h>
>  #include <linux/mmc/sh_mmcif.h>
> -#include <linux/mmc/sh_mobile_sdhi.h>
>  #include <linux/sh_eth.h>
>  #include <linux/sh_intc.h>
>  #include <linux/usb/renesas_usbhs.h>
> diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
> index 62c3b81300ed28..de8393cb7313bc 100644
> --- a/arch/sh/boards/mach-ap325rxa/setup.c
> +++ b/arch/sh/boards/mach-ap325rxa/setup.c
> @@ -15,7 +15,6 @@
>  #include <linux/interrupt.h>
>  #include <linux/platform_device.h>
>  #include <linux/mmc/host.h>
> -#include <linux/mmc/sh_mobile_sdhi.h>
>  #include <linux/mtd/physmap.h>
>  #include <linux/mtd/sh_flctl.h>
>  #include <linux/mfd/tmio.h>
> diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
> index a9c0c07386fddd..6d612792f6b8ec 100644
> --- a/arch/sh/boards/mach-ecovec24/setup.c
> +++ b/arch/sh/boards/mach-ecovec24/setup.c
> @@ -13,7 +13,6 @@
>  #include <linux/platform_device.h>
>  #include <linux/mmc/host.h>
>  #include <linux/mmc/sh_mmcif.h>
> -#include <linux/mmc/sh_mobile_sdhi.h>
>  #include <linux/mtd/physmap.h>
>  #include <linux/mfd/tmio.h>
>  #include <linux/gpio.h>
> diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
> index 6bd9230e64e300..5deb2d82f19f78 100644
> --- a/arch/sh/boards/mach-kfr2r09/setup.c
> +++ b/arch/sh/boards/mach-kfr2r09/setup.c
> @@ -11,7 +11,6 @@
>  #include <linux/platform_device.h>
>  #include <linux/interrupt.h>
>  #include <linux/mmc/host.h>
> -#include <linux/mmc/sh_mobile_sdhi.h>
>  #include <linux/mfd/tmio.h>
>  #include <linux/mtd/physmap.h>
>  #include <linux/mtd/onenand.h>
> diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
> index 7a04da3efce402..5de60a77eaa1ab 100644
> --- a/arch/sh/boards/mach-migor/setup.c
> +++ b/arch/sh/boards/mach-migor/setup.c
> @@ -13,7 +13,6 @@
>  #include <linux/input.h>
>  #include <linux/input/sh_keysc.h>
>  #include <linux/mmc/host.h>
> -#include <linux/mmc/sh_mobile_sdhi.h>
>  #include <linux/mtd/physmap.h>
>  #include <linux/mfd/tmio.h>
>  #include <linux/mtd/nand.h>
> diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
> index e0e1df136642cd..f1fecd395679ae 100644
> --- a/arch/sh/boards/mach-se/7724/setup.c
> +++ b/arch/sh/boards/mach-se/7724/setup.c
> @@ -15,7 +15,6 @@
>  #include <linux/interrupt.h>
>  #include <linux/platform_device.h>
>  #include <linux/mmc/host.h>
> -#include <linux/mmc/sh_mobile_sdhi.h>
>  #include <linux/mfd/tmio.h>
>  #include <linux/mtd/physmap.h>
>  #include <linux/delay.h>
> diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
> index 9beee48d2e280d..51d8dbd5b06a3e 100644
> --- a/drivers/mmc/host/sh_mobile_sdhi.c
> +++ b/drivers/mmc/host/sh_mobile_sdhi.c
> @@ -28,7 +28,6 @@
>  #include <linux/of_device.h>
>  #include <linux/platform_device.h>
>  #include <linux/mmc/host.h>
> -#include <linux/mmc/sh_mobile_sdhi.h>
>  #include <linux/mfd/tmio.h>
>  #include <linux/sh_dma.h>
>  #include <linux/delay.h>
> @@ -315,7 +314,6 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
>         struct tmio_mmc_host *host;
>         struct resource *res;
>         int irq, ret, i = 0;
> -       bool multiplexed_isr = true;
>         struct tmio_mmc_dma *dma_priv;
>
>         res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> @@ -405,62 +403,23 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
>         if (ret < 0)
>                 goto efree;
>
> -       /*
> -        * Allow one or more specific (named) ISRs or
> -        * one or more multiplexed (un-named) ISRs.
> -        */
> -
> -       irq = platform_get_irq_byname(pdev, SH_MOBILE_SDHI_IRQ_CARD_DETECT);
> -       if (irq >= 0) {
> -               multiplexed_isr = false;
> -               ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_card_detect_irq, 0,
> +       while (1) {
> +               irq = platform_get_irq(pdev, i);
> +               if (irq < 0)
> +                       break;
> +               i++;
> +               ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_irq, 0,
>                                   dev_name(&pdev->dev), host);
>                 if (ret)
>                         goto eirq;
>         }
>
> -       irq = platform_get_irq_byname(pdev, SH_MOBILE_SDHI_IRQ_SDIO);
> -       if (irq >= 0) {
> -               multiplexed_isr = false;
> -               ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_sdio_irq, 0,
> -                                 dev_name(&pdev->dev), host);
> -               if (ret)
> -                       goto eirq;
> -       }
> -
> -       irq = platform_get_irq_byname(pdev, SH_MOBILE_SDHI_IRQ_SDCARD);
> -       if (irq >= 0) {
> -               multiplexed_isr = false;
> -               ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_sdcard_irq, 0,
> -                                 dev_name(&pdev->dev), host);
> -               if (ret)
> -                       goto eirq;
> -       } else if (!multiplexed_isr) {
> -               dev_err(&pdev->dev,
> -                       "Principal SD-card IRQ is missing among named interrupts\n");
> +       /* There must be at least one IRQ source */
> +       if (!i) {
>                 ret = irq;
>                 goto eirq;
>         }
>
> -       if (multiplexed_isr) {
> -               while (1) {
> -                       irq = platform_get_irq(pdev, i);
> -                       if (irq < 0)
> -                               break;
> -                       i++;
> -                       ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_irq, 0,
> -                                         dev_name(&pdev->dev), host);
> -                       if (ret)
> -                               goto eirq;
> -               }
> -
> -               /* There must be at least one IRQ source */
> -               if (!i) {
> -                       ret = irq;
> -                       goto eirq;
> -               }
> -       }
> -
>         dev_info(&pdev->dev, "%s base at 0x%08lx max clock rate %u MHz\n",
>                  mmc_hostname(host->mmc), (unsigned long)
>                  (platform_get_resource(pdev, IORESOURCE_MEM, 0)->start),
> diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h
> deleted file mode 100644
> index 95d6f0314a7ded..00000000000000
> --- a/include/linux/mmc/sh_mobile_sdhi.h
> +++ /dev/null
> @@ -1,10 +0,0 @@
> -#ifndef LINUX_MMC_SH_MOBILE_SDHI_H
> -#define LINUX_MMC_SH_MOBILE_SDHI_H
> -
> -#include <linux/types.h>
> -
> -#define SH_MOBILE_SDHI_IRQ_CARD_DETECT "card_detect"
> -#define SH_MOBILE_SDHI_IRQ_SDCARD      "sdcard"
> -#define SH_MOBILE_SDHI_IRQ_SDIO                "sdio"
> -
> -#endif /* LINUX_MMC_SH_MOBILE_SDHI_H */
> --
> 2.7.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/6] mmc: sh_mobile_sdhi: remove obsolete irq_by_name registration
  2016-04-18  8:21   ` Ulf Hansson
@ 2016-04-19  9:37     ` Wolfram Sang
  2016-04-27 22:54       ` Rich Felker
  2016-04-26 15:47     ` Wolfram Sang
  1 sibling, 1 reply; 17+ messages in thread
From: Wolfram Sang @ 2016-04-19  9:37 UTC (permalink / raw)
  To: Ulf Hansson, Rich Felker, Yoshinori Sato
  Cc: linux-mmc, linux-renesas-soc, Linux-sh list, Simon Horman,
	Kuninori Morimoto

[-- Attachment #1: Type: text/plain, Size: 9618 bytes --]

On Mon, Apr 18, 2016 at 10:21:41AM +0200, Ulf Hansson wrote:
> On 6 April 2016 at 11:25, Wolfram Sang <wsa@the-dreams.de> wrote:
> > From: Wolfram Sang <wsa+renesas@sang-engineering.com>
> >
> > There is no user left in the kernel, so this code can be removed.
> > (Legacy, non-DT sh_mobile boards have been removed a while ago.) The
> > diff looks more complicated than it is: The if-block for multiplexed isr
> > is now the main code path, the rest is removed. A number of sh boards
> > included the now deleted include file without needing it. Remove that,
> > too.
> >
> > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > ---
> >  arch/sh/boards/board-sh7757lcr.c     |  1 -
> >  arch/sh/boards/mach-ap325rxa/setup.c |  1 -
> >  arch/sh/boards/mach-ecovec24/setup.c |  1 -
> >  arch/sh/boards/mach-kfr2r09/setup.c  |  1 -
> >  arch/sh/boards/mach-migor/setup.c    |  1 -
> >  arch/sh/boards/mach-se/7724/setup.c  |  1 -
> >  drivers/mmc/host/sh_mobile_sdhi.c    | 57 +++++-------------------------------
> >  include/linux/mmc/sh_mobile_sdhi.h   | 10 -------
> >  8 files changed, 8 insertions(+), 65 deletions(-)
> >  delete mode 100644 include/linux/mmc/sh_mobile_sdhi.h
> 
> Hi Wolfram,
> 
> I need and ack from the Superh arch maintainer to apply this one.
> 
> It seems like you didn't include them on "to/cc" list, perhaps repost!?

I hoped adding the sh-list will be enough. Adding them to this mail
explicitly now, maybe this will do?

@SH-maintainers: some SH board files include a file with platform_data
they are not really using. Since I want to remove the platform_data
file, I remove inclusion of this file. That's all to it. Build bot was
happy, too.

Thanks,

   Wolfram

> 
> Kind regards
> Uffe
> 
> >
> > diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
> > index 324599bfad1420..0104c8199c48fe 100644
> > --- a/arch/sh/boards/board-sh7757lcr.c
> > +++ b/arch/sh/boards/board-sh7757lcr.c
> > @@ -20,7 +20,6 @@
> >  #include <linux/mfd/tmio.h>
> >  #include <linux/mmc/host.h>
> >  #include <linux/mmc/sh_mmcif.h>
> > -#include <linux/mmc/sh_mobile_sdhi.h>
> >  #include <linux/sh_eth.h>
> >  #include <linux/sh_intc.h>
> >  #include <linux/usb/renesas_usbhs.h>
> > diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
> > index 62c3b81300ed28..de8393cb7313bc 100644
> > --- a/arch/sh/boards/mach-ap325rxa/setup.c
> > +++ b/arch/sh/boards/mach-ap325rxa/setup.c
> > @@ -15,7 +15,6 @@
> >  #include <linux/interrupt.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/mmc/host.h>
> > -#include <linux/mmc/sh_mobile_sdhi.h>
> >  #include <linux/mtd/physmap.h>
> >  #include <linux/mtd/sh_flctl.h>
> >  #include <linux/mfd/tmio.h>
> > diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
> > index a9c0c07386fddd..6d612792f6b8ec 100644
> > --- a/arch/sh/boards/mach-ecovec24/setup.c
> > +++ b/arch/sh/boards/mach-ecovec24/setup.c
> > @@ -13,7 +13,6 @@
> >  #include <linux/platform_device.h>
> >  #include <linux/mmc/host.h>
> >  #include <linux/mmc/sh_mmcif.h>
> > -#include <linux/mmc/sh_mobile_sdhi.h>
> >  #include <linux/mtd/physmap.h>
> >  #include <linux/mfd/tmio.h>
> >  #include <linux/gpio.h>
> > diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
> > index 6bd9230e64e300..5deb2d82f19f78 100644
> > --- a/arch/sh/boards/mach-kfr2r09/setup.c
> > +++ b/arch/sh/boards/mach-kfr2r09/setup.c
> > @@ -11,7 +11,6 @@
> >  #include <linux/platform_device.h>
> >  #include <linux/interrupt.h>
> >  #include <linux/mmc/host.h>
> > -#include <linux/mmc/sh_mobile_sdhi.h>
> >  #include <linux/mfd/tmio.h>
> >  #include <linux/mtd/physmap.h>
> >  #include <linux/mtd/onenand.h>
> > diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
> > index 7a04da3efce402..5de60a77eaa1ab 100644
> > --- a/arch/sh/boards/mach-migor/setup.c
> > +++ b/arch/sh/boards/mach-migor/setup.c
> > @@ -13,7 +13,6 @@
> >  #include <linux/input.h>
> >  #include <linux/input/sh_keysc.h>
> >  #include <linux/mmc/host.h>
> > -#include <linux/mmc/sh_mobile_sdhi.h>
> >  #include <linux/mtd/physmap.h>
> >  #include <linux/mfd/tmio.h>
> >  #include <linux/mtd/nand.h>
> > diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
> > index e0e1df136642cd..f1fecd395679ae 100644
> > --- a/arch/sh/boards/mach-se/7724/setup.c
> > +++ b/arch/sh/boards/mach-se/7724/setup.c
> > @@ -15,7 +15,6 @@
> >  #include <linux/interrupt.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/mmc/host.h>
> > -#include <linux/mmc/sh_mobile_sdhi.h>
> >  #include <linux/mfd/tmio.h>
> >  #include <linux/mtd/physmap.h>
> >  #include <linux/delay.h>
> > diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
> > index 9beee48d2e280d..51d8dbd5b06a3e 100644
> > --- a/drivers/mmc/host/sh_mobile_sdhi.c
> > +++ b/drivers/mmc/host/sh_mobile_sdhi.c
> > @@ -28,7 +28,6 @@
> >  #include <linux/of_device.h>
> >  #include <linux/platform_device.h>
> >  #include <linux/mmc/host.h>
> > -#include <linux/mmc/sh_mobile_sdhi.h>
> >  #include <linux/mfd/tmio.h>
> >  #include <linux/sh_dma.h>
> >  #include <linux/delay.h>
> > @@ -315,7 +314,6 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
> >         struct tmio_mmc_host *host;
> >         struct resource *res;
> >         int irq, ret, i = 0;
> > -       bool multiplexed_isr = true;
> >         struct tmio_mmc_dma *dma_priv;
> >
> >         res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > @@ -405,62 +403,23 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
> >         if (ret < 0)
> >                 goto efree;
> >
> > -       /*
> > -        * Allow one or more specific (named) ISRs or
> > -        * one or more multiplexed (un-named) ISRs.
> > -        */
> > -
> > -       irq = platform_get_irq_byname(pdev, SH_MOBILE_SDHI_IRQ_CARD_DETECT);
> > -       if (irq >= 0) {
> > -               multiplexed_isr = false;
> > -               ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_card_detect_irq, 0,
> > +       while (1) {
> > +               irq = platform_get_irq(pdev, i);
> > +               if (irq < 0)
> > +                       break;
> > +               i++;
> > +               ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_irq, 0,
> >                                   dev_name(&pdev->dev), host);
> >                 if (ret)
> >                         goto eirq;
> >         }
> >
> > -       irq = platform_get_irq_byname(pdev, SH_MOBILE_SDHI_IRQ_SDIO);
> > -       if (irq >= 0) {
> > -               multiplexed_isr = false;
> > -               ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_sdio_irq, 0,
> > -                                 dev_name(&pdev->dev), host);
> > -               if (ret)
> > -                       goto eirq;
> > -       }
> > -
> > -       irq = platform_get_irq_byname(pdev, SH_MOBILE_SDHI_IRQ_SDCARD);
> > -       if (irq >= 0) {
> > -               multiplexed_isr = false;
> > -               ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_sdcard_irq, 0,
> > -                                 dev_name(&pdev->dev), host);
> > -               if (ret)
> > -                       goto eirq;
> > -       } else if (!multiplexed_isr) {
> > -               dev_err(&pdev->dev,
> > -                       "Principal SD-card IRQ is missing among named interrupts\n");
> > +       /* There must be at least one IRQ source */
> > +       if (!i) {
> >                 ret = irq;
> >                 goto eirq;
> >         }
> >
> > -       if (multiplexed_isr) {
> > -               while (1) {
> > -                       irq = platform_get_irq(pdev, i);
> > -                       if (irq < 0)
> > -                               break;
> > -                       i++;
> > -                       ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_irq, 0,
> > -                                         dev_name(&pdev->dev), host);
> > -                       if (ret)
> > -                               goto eirq;
> > -               }
> > -
> > -               /* There must be at least one IRQ source */
> > -               if (!i) {
> > -                       ret = irq;
> > -                       goto eirq;
> > -               }
> > -       }
> > -
> >         dev_info(&pdev->dev, "%s base at 0x%08lx max clock rate %u MHz\n",
> >                  mmc_hostname(host->mmc), (unsigned long)
> >                  (platform_get_resource(pdev, IORESOURCE_MEM, 0)->start),
> > diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h
> > deleted file mode 100644
> > index 95d6f0314a7ded..00000000000000
> > --- a/include/linux/mmc/sh_mobile_sdhi.h
> > +++ /dev/null
> > @@ -1,10 +0,0 @@
> > -#ifndef LINUX_MMC_SH_MOBILE_SDHI_H
> > -#define LINUX_MMC_SH_MOBILE_SDHI_H
> > -
> > -#include <linux/types.h>
> > -
> > -#define SH_MOBILE_SDHI_IRQ_CARD_DETECT "card_detect"
> > -#define SH_MOBILE_SDHI_IRQ_SDCARD      "sdcard"
> > -#define SH_MOBILE_SDHI_IRQ_SDIO                "sdio"
> > -
> > -#endif /* LINUX_MMC_SH_MOBILE_SDHI_H */
> > --
> > 2.7.0
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/6] mmc: sh_mobile_sdhi: remove obsolete irq_by_name registration
  2016-04-18  8:21   ` Ulf Hansson
  2016-04-19  9:37     ` Wolfram Sang
@ 2016-04-26 15:47     ` Wolfram Sang
  1 sibling, 0 replies; 17+ messages in thread
From: Wolfram Sang @ 2016-04-26 15:47 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: linux-mmc, linux-renesas-soc, Linux-sh list, Simon Horman,
	Kuninori Morimoto

[-- Attachment #1: Type: text/plain, Size: 422 bytes --]


> I need and ack from the Superh arch maintainer to apply this one.
> 
> It seems like you didn't include them on "to/cc" list, perhaps repost!?

Nothing happened...

So, I'll repost the series without the removal of the include file and
not touching SH boards. It will be your realm only then.

I'll repost the SH relevant parts as a seperate patch to the SH list, so
this can have then its own timeframe.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/6] mmc: sh_mobile_sdhi: remove obsolete irq_by_name registration
  2016-04-19  9:37     ` Wolfram Sang
@ 2016-04-27 22:54       ` Rich Felker
  2016-04-28  3:59         ` Yoshinori Sato
                           ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Rich Felker @ 2016-04-27 22:54 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Ulf Hansson, Yoshinori Sato, linux-mmc, linux-renesas-soc,
	Linux-sh list, Simon Horman, Kuninori Morimoto

On Tue, Apr 19, 2016 at 11:37:13AM +0200, Wolfram Sang wrote:
> On Mon, Apr 18, 2016 at 10:21:41AM +0200, Ulf Hansson wrote:
> > On 6 April 2016 at 11:25, Wolfram Sang <wsa@the-dreams.de> wrote:
> > > From: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > >
> > > There is no user left in the kernel, so this code can be removed.
> > > (Legacy, non-DT sh_mobile boards have been removed a while ago.) The
> > > diff looks more complicated than it is: The if-block for multiplexed isr
> > > is now the main code path, the rest is removed. A number of sh boards
> > > included the now deleted include file without needing it. Remove that,
> > > too.
> > >
> > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > > ---
> > >  arch/sh/boards/board-sh7757lcr.c     |  1 -
> > >  arch/sh/boards/mach-ap325rxa/setup.c |  1 -
> > >  arch/sh/boards/mach-ecovec24/setup.c |  1 -
> > >  arch/sh/boards/mach-kfr2r09/setup.c  |  1 -
> > >  arch/sh/boards/mach-migor/setup.c    |  1 -
> > >  arch/sh/boards/mach-se/7724/setup.c  |  1 -
> > >  drivers/mmc/host/sh_mobile_sdhi.c    | 57 +++++-------------------------------
> > >  include/linux/mmc/sh_mobile_sdhi.h   | 10 -------
> > >  8 files changed, 8 insertions(+), 65 deletions(-)
> > >  delete mode 100644 include/linux/mmc/sh_mobile_sdhi.h
> > 
> > Hi Wolfram,
> > 
> > I need and ack from the Superh arch maintainer to apply this one.
> > 
> > It seems like you didn't include them on "to/cc" list, perhaps repost!?
> 
> I hoped adding the sh-list will be enough. Adding them to this mail
> explicitly now, maybe this will do?
> 
> @SH-maintainers: some SH board files include a file with platform_data
> they are not really using. Since I want to remove the platform_data
> file, I remove inclusion of this file. That's all to it. Build bot was
> happy, too.

Hi! Sorry I didn't notice this before. I saw sh_mobile in the subject
lines and guessed it was not making changes in arch/sh.

I don't have any of the affected boards to test, but as long as
they're not actually using the include file you're removing, I don't
see any harm. It's my intent to remove all of these board files full
of platform devices as soon as we get working device tree bindings for
everything, anyway. So,

Acked-by: Rich Felker <dalias@libc.org>

Sato-san, do you have any objections?

Rich


> > > diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
> > > index 324599bfad1420..0104c8199c48fe 100644
> > > --- a/arch/sh/boards/board-sh7757lcr.c
> > > +++ b/arch/sh/boards/board-sh7757lcr.c
> > > @@ -20,7 +20,6 @@
> > >  #include <linux/mfd/tmio.h>
> > >  #include <linux/mmc/host.h>
> > >  #include <linux/mmc/sh_mmcif.h>
> > > -#include <linux/mmc/sh_mobile_sdhi.h>
> > >  #include <linux/sh_eth.h>
> > >  #include <linux/sh_intc.h>
> > >  #include <linux/usb/renesas_usbhs.h>
> > > diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
> > > index 62c3b81300ed28..de8393cb7313bc 100644
> > > --- a/arch/sh/boards/mach-ap325rxa/setup.c
> > > +++ b/arch/sh/boards/mach-ap325rxa/setup.c
> > > @@ -15,7 +15,6 @@
> > >  #include <linux/interrupt.h>
> > >  #include <linux/platform_device.h>
> > >  #include <linux/mmc/host.h>
> > > -#include <linux/mmc/sh_mobile_sdhi.h>
> > >  #include <linux/mtd/physmap.h>
> > >  #include <linux/mtd/sh_flctl.h>
> > >  #include <linux/mfd/tmio.h>
> > > diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
> > > index a9c0c07386fddd..6d612792f6b8ec 100644
> > > --- a/arch/sh/boards/mach-ecovec24/setup.c
> > > +++ b/arch/sh/boards/mach-ecovec24/setup.c
> > > @@ -13,7 +13,6 @@
> > >  #include <linux/platform_device.h>
> > >  #include <linux/mmc/host.h>
> > >  #include <linux/mmc/sh_mmcif.h>
> > > -#include <linux/mmc/sh_mobile_sdhi.h>
> > >  #include <linux/mtd/physmap.h>
> > >  #include <linux/mfd/tmio.h>
> > >  #include <linux/gpio.h>
> > > diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
> > > index 6bd9230e64e300..5deb2d82f19f78 100644
> > > --- a/arch/sh/boards/mach-kfr2r09/setup.c
> > > +++ b/arch/sh/boards/mach-kfr2r09/setup.c
> > > @@ -11,7 +11,6 @@
> > >  #include <linux/platform_device.h>
> > >  #include <linux/interrupt.h>
> > >  #include <linux/mmc/host.h>
> > > -#include <linux/mmc/sh_mobile_sdhi.h>
> > >  #include <linux/mfd/tmio.h>
> > >  #include <linux/mtd/physmap.h>
> > >  #include <linux/mtd/onenand.h>
> > > diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
> > > index 7a04da3efce402..5de60a77eaa1ab 100644
> > > --- a/arch/sh/boards/mach-migor/setup.c
> > > +++ b/arch/sh/boards/mach-migor/setup.c
> > > @@ -13,7 +13,6 @@
> > >  #include <linux/input.h>
> > >  #include <linux/input/sh_keysc.h>
> > >  #include <linux/mmc/host.h>
> > > -#include <linux/mmc/sh_mobile_sdhi.h>
> > >  #include <linux/mtd/physmap.h>
> > >  #include <linux/mfd/tmio.h>
> > >  #include <linux/mtd/nand.h>
> > > diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
> > > index e0e1df136642cd..f1fecd395679ae 100644
> > > --- a/arch/sh/boards/mach-se/7724/setup.c
> > > +++ b/arch/sh/boards/mach-se/7724/setup.c
> > > @@ -15,7 +15,6 @@
> > >  #include <linux/interrupt.h>
> > >  #include <linux/platform_device.h>
> > >  #include <linux/mmc/host.h>
> > > -#include <linux/mmc/sh_mobile_sdhi.h>
> > >  #include <linux/mfd/tmio.h>
> > >  #include <linux/mtd/physmap.h>
> > >  #include <linux/delay.h>
> > > diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
> > > index 9beee48d2e280d..51d8dbd5b06a3e 100644
> > > --- a/drivers/mmc/host/sh_mobile_sdhi.c
> > > +++ b/drivers/mmc/host/sh_mobile_sdhi.c
> > > @@ -28,7 +28,6 @@
> > >  #include <linux/of_device.h>
> > >  #include <linux/platform_device.h>
> > >  #include <linux/mmc/host.h>
> > > -#include <linux/mmc/sh_mobile_sdhi.h>
> > >  #include <linux/mfd/tmio.h>
> > >  #include <linux/sh_dma.h>
> > >  #include <linux/delay.h>
> > > @@ -315,7 +314,6 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
> > >         struct tmio_mmc_host *host;
> > >         struct resource *res;
> > >         int irq, ret, i = 0;
> > > -       bool multiplexed_isr = true;
> > >         struct tmio_mmc_dma *dma_priv;
> > >
> > >         res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > > @@ -405,62 +403,23 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
> > >         if (ret < 0)
> > >                 goto efree;
> > >
> > > -       /*
> > > -        * Allow one or more specific (named) ISRs or
> > > -        * one or more multiplexed (un-named) ISRs.
> > > -        */
> > > -
> > > -       irq = platform_get_irq_byname(pdev, SH_MOBILE_SDHI_IRQ_CARD_DETECT);
> > > -       if (irq >= 0) {
> > > -               multiplexed_isr = false;
> > > -               ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_card_detect_irq, 0,
> > > +       while (1) {
> > > +               irq = platform_get_irq(pdev, i);
> > > +               if (irq < 0)
> > > +                       break;
> > > +               i++;
> > > +               ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_irq, 0,
> > >                                   dev_name(&pdev->dev), host);
> > >                 if (ret)
> > >                         goto eirq;
> > >         }
> > >
> > > -       irq = platform_get_irq_byname(pdev, SH_MOBILE_SDHI_IRQ_SDIO);
> > > -       if (irq >= 0) {
> > > -               multiplexed_isr = false;
> > > -               ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_sdio_irq, 0,
> > > -                                 dev_name(&pdev->dev), host);
> > > -               if (ret)
> > > -                       goto eirq;
> > > -       }
> > > -
> > > -       irq = platform_get_irq_byname(pdev, SH_MOBILE_SDHI_IRQ_SDCARD);
> > > -       if (irq >= 0) {
> > > -               multiplexed_isr = false;
> > > -               ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_sdcard_irq, 0,
> > > -                                 dev_name(&pdev->dev), host);
> > > -               if (ret)
> > > -                       goto eirq;
> > > -       } else if (!multiplexed_isr) {
> > > -               dev_err(&pdev->dev,
> > > -                       "Principal SD-card IRQ is missing among named interrupts\n");
> > > +       /* There must be at least one IRQ source */
> > > +       if (!i) {
> > >                 ret = irq;
> > >                 goto eirq;
> > >         }
> > >
> > > -       if (multiplexed_isr) {
> > > -               while (1) {
> > > -                       irq = platform_get_irq(pdev, i);
> > > -                       if (irq < 0)
> > > -                               break;
> > > -                       i++;
> > > -                       ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_irq, 0,
> > > -                                         dev_name(&pdev->dev), host);
> > > -                       if (ret)
> > > -                               goto eirq;
> > > -               }
> > > -
> > > -               /* There must be at least one IRQ source */
> > > -               if (!i) {
> > > -                       ret = irq;
> > > -                       goto eirq;
> > > -               }
> > > -       }
> > > -
> > >         dev_info(&pdev->dev, "%s base at 0x%08lx max clock rate %u MHz\n",
> > >                  mmc_hostname(host->mmc), (unsigned long)
> > >                  (platform_get_resource(pdev, IORESOURCE_MEM, 0)->start),
> > > diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h
> > > deleted file mode 100644
> > > index 95d6f0314a7ded..00000000000000
> > > --- a/include/linux/mmc/sh_mobile_sdhi.h
> > > +++ /dev/null
> > > @@ -1,10 +0,0 @@
> > > -#ifndef LINUX_MMC_SH_MOBILE_SDHI_H
> > > -#define LINUX_MMC_SH_MOBILE_SDHI_H
> > > -
> > > -#include <linux/types.h>
> > > -
> > > -#define SH_MOBILE_SDHI_IRQ_CARD_DETECT "card_detect"
> > > -#define SH_MOBILE_SDHI_IRQ_SDCARD      "sdcard"
> > > -#define SH_MOBILE_SDHI_IRQ_SDIO                "sdio"
> > > -
> > > -#endif /* LINUX_MMC_SH_MOBILE_SDHI_H */
> > > --
> > > 2.7.0
> > >
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> > > the body of a message to majordomo@vger.kernel.org
> > > More majordomo info at  http://vger.kernel.org/majordomo-info.html



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/6] mmc: sh_mobile_sdhi: remove obsolete irq_by_name registration
  2016-04-27 22:54       ` Rich Felker
@ 2016-04-28  3:59         ` Yoshinori Sato
  2016-04-28  6:19         ` Wolfram Sang
  2016-04-28  8:03         ` Geert Uytterhoeven
  2 siblings, 0 replies; 17+ messages in thread
From: Yoshinori Sato @ 2016-04-28  3:59 UTC (permalink / raw)
  To: Rich Felker
  Cc: Wolfram Sang, Ulf Hansson, linux-mmc, linux-renesas-soc,
	Linux-sh list, Simon Horman, Kuninori Morimoto

On Thu, 28 Apr 2016 07:54:57 +0900,
Rich Felker wrote:
> 
> On Tue, Apr 19, 2016 at 11:37:13AM +0200, Wolfram Sang wrote:
> > On Mon, Apr 18, 2016 at 10:21:41AM +0200, Ulf Hansson wrote:
> > > On 6 April 2016 at 11:25, Wolfram Sang <wsa@the-dreams.de> wrote:
> > > > From: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > > >
> > > > There is no user left in the kernel, so this code can be removed.
> > > > (Legacy, non-DT sh_mobile boards have been removed a while ago.) The
> > > > diff looks more complicated than it is: The if-block for multiplexed isr
> > > > is now the main code path, the rest is removed. A number of sh boards
> > > > included the now deleted include file without needing it. Remove that,
> > > > too.
> > > >
> > > > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> > > > ---
> > > >  arch/sh/boards/board-sh7757lcr.c     |  1 -
> > > >  arch/sh/boards/mach-ap325rxa/setup.c |  1 -
> > > >  arch/sh/boards/mach-ecovec24/setup.c |  1 -
> > > >  arch/sh/boards/mach-kfr2r09/setup.c  |  1 -
> > > >  arch/sh/boards/mach-migor/setup.c    |  1 -
> > > >  arch/sh/boards/mach-se/7724/setup.c  |  1 -
> > > >  drivers/mmc/host/sh_mobile_sdhi.c    | 57 +++++-------------------------------
> > > >  include/linux/mmc/sh_mobile_sdhi.h   | 10 -------
> > > >  8 files changed, 8 insertions(+), 65 deletions(-)
> > > >  delete mode 100644 include/linux/mmc/sh_mobile_sdhi.h
> > > 
> > > Hi Wolfram,
> > > 
> > > I need and ack from the Superh arch maintainer to apply this one.
> > > 
> > > It seems like you didn't include them on "to/cc" list, perhaps repost!?
> > 
> > I hoped adding the sh-list will be enough. Adding them to this mail
> > explicitly now, maybe this will do?
> > 
> > @SH-maintainers: some SH board files include a file with platform_data
> > they are not really using. Since I want to remove the platform_data
> > file, I remove inclusion of this file. That's all to it. Build bot was
> > happy, too.
> 
> Hi! Sorry I didn't notice this before. I saw sh_mobile in the subject
> lines and guessed it was not making changes in arch/sh.
> 
> I don't have any of the affected boards to test, but as long as
> they're not actually using the include file you're removing, I don't
> see any harm. It's my intent to remove all of these board files full
> of platform devices as soon as we get working device tree bindings for
> everything, anyway. So,
> 
> Acked-by: Rich Felker <dalias@libc.org>
> 
> Sato-san, do you have any objections?

I have no objection. It looks standard style.

> Rich
> 
> 
> > > > diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
> > > > index 324599bfad1420..0104c8199c48fe 100644
> > > > --- a/arch/sh/boards/board-sh7757lcr.c
> > > > +++ b/arch/sh/boards/board-sh7757lcr.c
> > > > @@ -20,7 +20,6 @@
> > > >  #include <linux/mfd/tmio.h>
> > > >  #include <linux/mmc/host.h>
> > > >  #include <linux/mmc/sh_mmcif.h>
> > > > -#include <linux/mmc/sh_mobile_sdhi.h>
> > > >  #include <linux/sh_eth.h>
> > > >  #include <linux/sh_intc.h>
> > > >  #include <linux/usb/renesas_usbhs.h>
> > > > diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
> > > > index 62c3b81300ed28..de8393cb7313bc 100644
> > > > --- a/arch/sh/boards/mach-ap325rxa/setup.c
> > > > +++ b/arch/sh/boards/mach-ap325rxa/setup.c
> > > > @@ -15,7 +15,6 @@
> > > >  #include <linux/interrupt.h>
> > > >  #include <linux/platform_device.h>
> > > >  #include <linux/mmc/host.h>
> > > > -#include <linux/mmc/sh_mobile_sdhi.h>
> > > >  #include <linux/mtd/physmap.h>
> > > >  #include <linux/mtd/sh_flctl.h>
> > > >  #include <linux/mfd/tmio.h>
> > > > diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
> > > > index a9c0c07386fddd..6d612792f6b8ec 100644
> > > > --- a/arch/sh/boards/mach-ecovec24/setup.c
> > > > +++ b/arch/sh/boards/mach-ecovec24/setup.c
> > > > @@ -13,7 +13,6 @@
> > > >  #include <linux/platform_device.h>
> > > >  #include <linux/mmc/host.h>
> > > >  #include <linux/mmc/sh_mmcif.h>
> > > > -#include <linux/mmc/sh_mobile_sdhi.h>
> > > >  #include <linux/mtd/physmap.h>
> > > >  #include <linux/mfd/tmio.h>
> > > >  #include <linux/gpio.h>
> > > > diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
> > > > index 6bd9230e64e300..5deb2d82f19f78 100644
> > > > --- a/arch/sh/boards/mach-kfr2r09/setup.c
> > > > +++ b/arch/sh/boards/mach-kfr2r09/setup.c
> > > > @@ -11,7 +11,6 @@
> > > >  #include <linux/platform_device.h>
> > > >  #include <linux/interrupt.h>
> > > >  #include <linux/mmc/host.h>
> > > > -#include <linux/mmc/sh_mobile_sdhi.h>
> > > >  #include <linux/mfd/tmio.h>
> > > >  #include <linux/mtd/physmap.h>
> > > >  #include <linux/mtd/onenand.h>
> > > > diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
> > > > index 7a04da3efce402..5de60a77eaa1ab 100644
> > > > --- a/arch/sh/boards/mach-migor/setup.c
> > > > +++ b/arch/sh/boards/mach-migor/setup.c
> > > > @@ -13,7 +13,6 @@
> > > >  #include <linux/input.h>
> > > >  #include <linux/input/sh_keysc.h>
> > > >  #include <linux/mmc/host.h>
> > > > -#include <linux/mmc/sh_mobile_sdhi.h>
> > > >  #include <linux/mtd/physmap.h>
> > > >  #include <linux/mfd/tmio.h>
> > > >  #include <linux/mtd/nand.h>
> > > > diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
> > > > index e0e1df136642cd..f1fecd395679ae 100644
> > > > --- a/arch/sh/boards/mach-se/7724/setup.c
> > > > +++ b/arch/sh/boards/mach-se/7724/setup.c
> > > > @@ -15,7 +15,6 @@
> > > >  #include <linux/interrupt.h>
> > > >  #include <linux/platform_device.h>
> > > >  #include <linux/mmc/host.h>
> > > > -#include <linux/mmc/sh_mobile_sdhi.h>
> > > >  #include <linux/mfd/tmio.h>
> > > >  #include <linux/mtd/physmap.h>
> > > >  #include <linux/delay.h>
> > > > diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c
> > > > index 9beee48d2e280d..51d8dbd5b06a3e 100644
> > > > --- a/drivers/mmc/host/sh_mobile_sdhi.c
> > > > +++ b/drivers/mmc/host/sh_mobile_sdhi.c
> > > > @@ -28,7 +28,6 @@
> > > >  #include <linux/of_device.h>
> > > >  #include <linux/platform_device.h>
> > > >  #include <linux/mmc/host.h>
> > > > -#include <linux/mmc/sh_mobile_sdhi.h>
> > > >  #include <linux/mfd/tmio.h>
> > > >  #include <linux/sh_dma.h>
> > > >  #include <linux/delay.h>
> > > > @@ -315,7 +314,6 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
> > > >         struct tmio_mmc_host *host;
> > > >         struct resource *res;
> > > >         int irq, ret, i = 0;
> > > > -       bool multiplexed_isr = true;
> > > >         struct tmio_mmc_dma *dma_priv;
> > > >
> > > >         res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > > > @@ -405,62 +403,23 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev)
> > > >         if (ret < 0)
> > > >                 goto efree;
> > > >
> > > > -       /*
> > > > -        * Allow one or more specific (named) ISRs or
> > > > -        * one or more multiplexed (un-named) ISRs.
> > > > -        */
> > > > -
> > > > -       irq = platform_get_irq_byname(pdev, SH_MOBILE_SDHI_IRQ_CARD_DETECT);
> > > > -       if (irq >= 0) {
> > > > -               multiplexed_isr = false;
> > > > -               ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_card_detect_irq, 0,
> > > > +       while (1) {
> > > > +               irq = platform_get_irq(pdev, i);
> > > > +               if (irq < 0)
> > > > +                       break;
> > > > +               i++;
> > > > +               ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_irq, 0,
> > > >                                   dev_name(&pdev->dev), host);
> > > >                 if (ret)
> > > >                         goto eirq;
> > > >         }
> > > >
> > > > -       irq = platform_get_irq_byname(pdev, SH_MOBILE_SDHI_IRQ_SDIO);
> > > > -       if (irq >= 0) {
> > > > -               multiplexed_isr = false;
> > > > -               ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_sdio_irq, 0,
> > > > -                                 dev_name(&pdev->dev), host);
> > > > -               if (ret)
> > > > -                       goto eirq;
> > > > -       }
> > > > -
> > > > -       irq = platform_get_irq_byname(pdev, SH_MOBILE_SDHI_IRQ_SDCARD);
> > > > -       if (irq >= 0) {
> > > > -               multiplexed_isr = false;
> > > > -               ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_sdcard_irq, 0,
> > > > -                                 dev_name(&pdev->dev), host);
> > > > -               if (ret)
> > > > -                       goto eirq;
> > > > -       } else if (!multiplexed_isr) {
> > > > -               dev_err(&pdev->dev,
> > > > -                       "Principal SD-card IRQ is missing among named interrupts\n");
> > > > +       /* There must be at least one IRQ source */
> > > > +       if (!i) {
> > > >                 ret = irq;
> > > >                 goto eirq;
> > > >         }
> > > >
> > > > -       if (multiplexed_isr) {
> > > > -               while (1) {
> > > > -                       irq = platform_get_irq(pdev, i);
> > > > -                       if (irq < 0)
> > > > -                               break;
> > > > -                       i++;
> > > > -                       ret = devm_request_irq(&pdev->dev, irq, tmio_mmc_irq, 0,
> > > > -                                         dev_name(&pdev->dev), host);
> > > > -                       if (ret)
> > > > -                               goto eirq;
> > > > -               }
> > > > -
> > > > -               /* There must be at least one IRQ source */
> > > > -               if (!i) {
> > > > -                       ret = irq;
> > > > -                       goto eirq;
> > > > -               }
> > > > -       }
> > > > -
> > > >         dev_info(&pdev->dev, "%s base at 0x%08lx max clock rate %u MHz\n",
> > > >                  mmc_hostname(host->mmc), (unsigned long)
> > > >                  (platform_get_resource(pdev, IORESOURCE_MEM, 0)->start),
> > > > diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h
> > > > deleted file mode 100644
> > > > index 95d6f0314a7ded..00000000000000
> > > > --- a/include/linux/mmc/sh_mobile_sdhi.h
> > > > +++ /dev/null
> > > > @@ -1,10 +0,0 @@
> > > > -#ifndef LINUX_MMC_SH_MOBILE_SDHI_H
> > > > -#define LINUX_MMC_SH_MOBILE_SDHI_H
> > > > -
> > > > -#include <linux/types.h>
> > > > -
> > > > -#define SH_MOBILE_SDHI_IRQ_CARD_DETECT "card_detect"
> > > > -#define SH_MOBILE_SDHI_IRQ_SDCARD      "sdcard"
> > > > -#define SH_MOBILE_SDHI_IRQ_SDIO                "sdio"
> > > > -
> > > > -#endif /* LINUX_MMC_SH_MOBILE_SDHI_H */
> > > > --
> > > > 2.7.0
> > > >
> > > > --
> > > > To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> > > > the body of a message to majordomo@vger.kernel.org
> > > > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 

-- 
Yoshinori Sato
<ysato@users.sourceforge.jp>

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/6] mmc: sh_mobile_sdhi: remove obsolete irq_by_name registration
  2016-04-27 22:54       ` Rich Felker
  2016-04-28  3:59         ` Yoshinori Sato
@ 2016-04-28  6:19         ` Wolfram Sang
  2016-04-28  8:03         ` Geert Uytterhoeven
  2 siblings, 0 replies; 17+ messages in thread
From: Wolfram Sang @ 2016-04-28  6:19 UTC (permalink / raw)
  To: Rich Felker
  Cc: Ulf Hansson, Yoshinori Sato, linux-mmc, linux-renesas-soc,
	Linux-sh list, Simon Horman, Kuninori Morimoto

[-- Attachment #1: Type: text/plain, Size: 605 bytes --]


> I don't have any of the affected boards to test, but as long as
> they're not actually using the include file you're removing, I don't
> see any harm. It's my intent to remove all of these board files full
> of platform devices as soon as we get working device tree bindings for
> everything, anyway. So,
> 
> Acked-by: Rich Felker <dalias@libc.org>

Thanks! Ulf already applied a version with the SH specific bits factored
out. I'll send out a seperate patch for this right now. To make things
easier for all, I assume your acks will extend to this new patch as well.

Thanks again...


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH 2/6] mmc: sh_mobile_sdhi: remove obsolete irq_by_name registration
  2016-04-27 22:54       ` Rich Felker
  2016-04-28  3:59         ` Yoshinori Sato
  2016-04-28  6:19         ` Wolfram Sang
@ 2016-04-28  8:03         ` Geert Uytterhoeven
  2 siblings, 0 replies; 17+ messages in thread
From: Geert Uytterhoeven @ 2016-04-28  8:03 UTC (permalink / raw)
  To: Rich Felker
  Cc: Wolfram Sang, Ulf Hansson, Yoshinori Sato, linux-mmc,
	linux-renesas-soc, Linux-sh list, Simon Horman, Kuninori Morimoto

Hi Rich,

On Thu, Apr 28, 2016 at 12:54 AM, Rich Felker <dalias@libc.org> wrote:
> Hi! Sorry I didn't notice this before. I saw sh_mobile in the subject
> lines and guessed it was not making changes in arch/sh.

Yeah, it's confusing that "SH-Mobile" was used for both SH (only) and
ARM (+SH ;-) SoCs.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2016-04-28  8:03 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-06  9:25 [PATCH 0/6] mmc: tmio/sdhi: clean up cruft Wolfram Sang
2016-04-06  9:25 ` [PATCH 1/6] mmc: sh_mobile_sdhi: don't use array for DT configs Wolfram Sang
2016-04-06  9:56   ` Geert Uytterhoeven
2016-04-06 10:27     ` Wolfram Sang
2016-04-06  9:25 ` [PATCH 2/6] mmc: sh_mobile_sdhi: remove obsolete irq_by_name registration Wolfram Sang
2016-04-18  8:21   ` Ulf Hansson
2016-04-19  9:37     ` Wolfram Sang
2016-04-27 22:54       ` Rich Felker
2016-04-28  3:59         ` Yoshinori Sato
2016-04-28  6:19         ` Wolfram Sang
2016-04-28  8:03         ` Geert Uytterhoeven
2016-04-26 15:47     ` Wolfram Sang
2016-04-06  9:25 ` [PATCH 3/6] mmc: tmio: remove now unneeded seperate irq handlers Wolfram Sang
2016-04-06  9:25 ` [PATCH 4/6] mmc: tmio: simplify irq handler Wolfram Sang
2016-04-06  9:25 ` [PATCH 5/6] mmc: tmio: merge distributed include files Wolfram Sang
2016-04-06  9:34   ` [PATCH v2 " Wolfram Sang
2016-04-06  9:25 ` [PATCH 6/6] mmc: sh_mobile_sdhi: simplify code for voltage switching Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).