linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] mmc: omap_hsmmc: convert to use devm_* and fixes
@ 2014-05-09 16:46 Balaji T K
  2014-05-09 16:46 ` [PATCH v2 1/6] mmc: omap_hsmmc: use devm_clk_get Balaji T K
                   ` (6 more replies)
  0 siblings, 7 replies; 20+ messages in thread
From: Balaji T K @ 2014-05-09 16:46 UTC (permalink / raw)
  To: linux-mmc, chris, ulf.hansson; +Cc: linux-omap, Balaji T K

v2:
use devm_ioremap_resource
add cmd23 multiblock read/write fix

Balaji T K (6):
  mmc: omap_hsmmc: use devm_clk_get
  mmc: omap_hsmmc: use devm_request_irq
  mmc: omap_hsmmc: use devm_request_threaded_irq
  mmc: omap_hsmmc: use devm_ioremap_resource
  mmc: omap_hsmmc: fix cmd23 multiblock read/write
  mmc: omap_hsmmc: split omap-dma header file

 drivers/mmc/host/omap_hsmmc.c  |   57 ++++++++++++---------------------------
 include/linux/omap-dma.h       |   19 +------------
 include/linux/omap-dmaengine.h |   21 ++++++++++++++
 3 files changed, 40 insertions(+), 57 deletions(-)
 create mode 100644 include/linux/omap-dmaengine.h

-- 
1.7.5.4


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

* [PATCH v2 1/6] mmc: omap_hsmmc: use devm_clk_get
  2014-05-09 16:46 [PATCH v2 0/6] mmc: omap_hsmmc: convert to use devm_* and fixes Balaji T K
@ 2014-05-09 16:46 ` Balaji T K
  2014-05-12  8:33   ` Ulf Hansson
  2014-05-09 16:46 ` [PATCH v2 2/6] mmc: omap_hsmmc: use devm_request_irq Balaji T K
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 20+ messages in thread
From: Balaji T K @ 2014-05-09 16:46 UTC (permalink / raw)
  To: linux-mmc, chris, ulf.hansson; +Cc: linux-omap, Balaji T K

With devm_clk_get conversion clk_put can be removed in clean up path

Signed-off-by: Balaji T K <balajitk@ti.com>
---
 drivers/mmc/host/omap_hsmmc.c |   15 ++++-----------
 1 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index b4de63b..b8ae7ee 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1922,7 +1922,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 
 	spin_lock_init(&host->irq_lock);
 
-	host->fclk = clk_get(&pdev->dev, "fck");
+	host->fclk = devm_clk_get(&pdev->dev, "fck");
 	if (IS_ERR(host->fclk)) {
 		ret = PTR_ERR(host->fclk);
 		host->fclk = NULL;
@@ -1941,7 +1941,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 
 	omap_hsmmc_context_save(host);
 
-	host->dbclk = clk_get(&pdev->dev, "mmchsdb_fck");
+	host->dbclk = devm_clk_get(&pdev->dev, "mmchsdb_fck");
 	/*
 	 * MMC can still work without debounce clock.
 	 */
@@ -1949,7 +1949,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 		host->dbclk = NULL;
 	} else if (clk_prepare_enable(host->dbclk) != 0) {
 		dev_warn(mmc_dev(host->mmc), "Failed to enable debounce clk\n");
-		clk_put(host->dbclk);
 		host->dbclk = NULL;
 	}
 
@@ -2105,11 +2104,8 @@ err_irq:
 		dma_release_channel(host->rx_chan);
 	pm_runtime_put_sync(host->dev);
 	pm_runtime_disable(host->dev);
-	clk_put(host->fclk);
-	if (host->dbclk) {
+	if (host->dbclk)
 		clk_disable_unprepare(host->dbclk);
-		clk_put(host->dbclk);
-	}
 err1:
 	iounmap(host->base);
 	mmc_free_host(mmc);
@@ -2144,11 +2140,8 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
 
 	pm_runtime_put_sync(host->dev);
 	pm_runtime_disable(host->dev);
-	clk_put(host->fclk);
-	if (host->dbclk) {
+	if (host->dbclk)
 		clk_disable_unprepare(host->dbclk);
-		clk_put(host->dbclk);
-	}
 
 	omap_hsmmc_gpio_free(host->pdata);
 	iounmap(host->base);
-- 
1.7.5.4


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

* [PATCH v2 2/6] mmc: omap_hsmmc: use devm_request_irq
  2014-05-09 16:46 [PATCH v2 0/6] mmc: omap_hsmmc: convert to use devm_* and fixes Balaji T K
  2014-05-09 16:46 ` [PATCH v2 1/6] mmc: omap_hsmmc: use devm_clk_get Balaji T K
@ 2014-05-09 16:46 ` Balaji T K
  2014-05-09 16:46 ` [PATCH v2 3/6] mmc: omap_hsmmc: use devm_request_threaded_irq Balaji T K
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 20+ messages in thread
From: Balaji T K @ 2014-05-09 16:46 UTC (permalink / raw)
  To: linux-mmc, chris, ulf.hansson; +Cc: linux-omap, Balaji T K

With devm_request_irq conversion free_irq can be removed in clean up path

Signed-off-by: Balaji T K <balajitk@ti.com>
---
 drivers/mmc/host/omap_hsmmc.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index b8ae7ee..ef7e48a 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2017,7 +2017,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 	}
 
 	/* Request IRQ for MMC operations */
-	ret = request_irq(host->irq, omap_hsmmc_irq, 0,
+	ret = devm_request_irq(&pdev->dev, host->irq, omap_hsmmc_irq, 0,
 			mmc_hostname(mmc), host);
 	if (ret) {
 		dev_err(mmc_dev(host->mmc), "Unable to grab HSMMC IRQ\n");
@@ -2028,7 +2028,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 		if (pdata->init(&pdev->dev) != 0) {
 			dev_err(mmc_dev(host->mmc),
 				"Unable to configure MMC IRQs\n");
-			goto err_irq_cd_init;
+			goto err_irq;
 		}
 	}
 
@@ -2095,8 +2095,6 @@ err_irq_cd:
 err_reg:
 	if (host->pdata->cleanup)
 		host->pdata->cleanup(&pdev->dev);
-err_irq_cd_init:
-	free_irq(host->irq, host);
 err_irq:
 	if (host->tx_chan)
 		dma_release_channel(host->tx_chan);
@@ -2129,7 +2127,6 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
 		omap_hsmmc_reg_put(host);
 	if (host->pdata->cleanup)
 		host->pdata->cleanup(&pdev->dev);
-	free_irq(host->irq, host);
 	if (mmc_slot(host).card_detect_irq)
 		free_irq(mmc_slot(host).card_detect_irq, host);
 
-- 
1.7.5.4


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

* [PATCH v2 3/6] mmc: omap_hsmmc: use devm_request_threaded_irq
  2014-05-09 16:46 [PATCH v2 0/6] mmc: omap_hsmmc: convert to use devm_* and fixes Balaji T K
  2014-05-09 16:46 ` [PATCH v2 1/6] mmc: omap_hsmmc: use devm_clk_get Balaji T K
  2014-05-09 16:46 ` [PATCH v2 2/6] mmc: omap_hsmmc: use devm_request_irq Balaji T K
@ 2014-05-09 16:46 ` Balaji T K
  2014-05-09 16:46 ` [PATCH v2 4/6] mmc: omap_hsmmc: use devm_ioremap_resource Balaji T K
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 20+ messages in thread
From: Balaji T K @ 2014-05-09 16:46 UTC (permalink / raw)
  To: linux-mmc, chris, ulf.hansson; +Cc: linux-omap, Balaji T K

With devm_request_threaded_irq conversion free_irq can be removed
in clean up path

Signed-off-by: Balaji T K <balajitk@ti.com>
---
 drivers/mmc/host/omap_hsmmc.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index ef7e48a..6179fe3 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -2043,9 +2043,9 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 
 	/* Request IRQ for card detect */
 	if ((mmc_slot(host).card_detect_irq)) {
-		ret = request_threaded_irq(mmc_slot(host).card_detect_irq,
-					   NULL,
-					   omap_hsmmc_detect,
+		ret = devm_request_threaded_irq(&pdev->dev,
+						mmc_slot(host).card_detect_irq,
+						NULL, omap_hsmmc_detect,
 					   IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
 					   mmc_hostname(mmc), host);
 		if (ret) {
@@ -2088,7 +2088,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 
 err_slot_name:
 	mmc_remove_host(mmc);
-	free_irq(mmc_slot(host).card_detect_irq, host);
 err_irq_cd:
 	if (host->use_reg)
 		omap_hsmmc_reg_put(host);
@@ -2127,8 +2126,6 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
 		omap_hsmmc_reg_put(host);
 	if (host->pdata->cleanup)
 		host->pdata->cleanup(&pdev->dev);
-	if (mmc_slot(host).card_detect_irq)
-		free_irq(mmc_slot(host).card_detect_irq, host);
 
 	if (host->tx_chan)
 		dma_release_channel(host->tx_chan);
-- 
1.7.5.4


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

* [PATCH v2 4/6] mmc: omap_hsmmc: use devm_ioremap_resource
  2014-05-09 16:46 [PATCH v2 0/6] mmc: omap_hsmmc: convert to use devm_* and fixes Balaji T K
                   ` (2 preceding siblings ...)
  2014-05-09 16:46 ` [PATCH v2 3/6] mmc: omap_hsmmc: use devm_request_threaded_irq Balaji T K
@ 2014-05-09 16:46 ` Balaji T K
  2014-05-09 16:46 ` [PATCH v2 5/6] mmc: omap_hsmmc: fix cmd23 multiblock read/write Balaji T K
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 20+ messages in thread
From: Balaji T K @ 2014-05-09 16:46 UTC (permalink / raw)
  To: linux-mmc, chris, ulf.hansson; +Cc: linux-omap, Balaji T K

With devm_ioremap_resource conversion release_mem_region, iounmap can be
removed in clean up path

Signed-off-by: Balaji T K <balajitk@ti.com>
---
 drivers/mmc/host/omap_hsmmc.c |   19 +++++--------------
 1 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 6179fe3..140425c 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1851,6 +1851,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 	unsigned tx_req, rx_req;
 	struct pinctrl *pinctrl;
 	const struct omap_mmc_of_data *data;
+	void __iomem *base;
 
 	match = of_match_device(of_match_ptr(omap_mmc_of_match), &pdev->dev);
 	if (match) {
@@ -1881,9 +1882,9 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 	if (res == NULL || irq < 0)
 		return -ENXIO;
 
-	res = request_mem_region(res->start, resource_size(res), pdev->name);
-	if (res == NULL)
-		return -EBUSY;
+	base = devm_ioremap_resource(&pdev->dev, res);
+	if (IS_ERR(base))
+		return PTR_ERR(base);
 
 	ret = omap_hsmmc_gpio_init(pdata);
 	if (ret)
@@ -1904,7 +1905,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 	host->irq	= irq;
 	host->slot_id	= 0;
 	host->mapbase	= res->start + pdata->reg_offset;
-	host->base	= ioremap(host->mapbase, SZ_4K);
+	host->base	= base + pdata->reg_offset;
 	host->power_mode = MMC_POWER_OFF;
 	host->next_data.cookie = 1;
 	host->pbias_enabled = 0;
@@ -2104,21 +2105,16 @@ err_irq:
 	if (host->dbclk)
 		clk_disable_unprepare(host->dbclk);
 err1:
-	iounmap(host->base);
 	mmc_free_host(mmc);
 err_alloc:
 	omap_hsmmc_gpio_free(pdata);
 err:
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (res)
-		release_mem_region(res->start, resource_size(res));
 	return ret;
 }
 
 static int omap_hsmmc_remove(struct platform_device *pdev)
 {
 	struct omap_hsmmc_host *host = platform_get_drvdata(pdev);
-	struct resource *res;
 
 	pm_runtime_get_sync(host->dev);
 	mmc_remove_host(host->mmc);
@@ -2138,13 +2134,8 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
 		clk_disable_unprepare(host->dbclk);
 
 	omap_hsmmc_gpio_free(host->pdata);
-	iounmap(host->base);
 	mmc_free_host(host->mmc);
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (res)
-		release_mem_region(res->start, resource_size(res));
-
 	return 0;
 }
 
-- 
1.7.5.4


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

* [PATCH v2 5/6] mmc: omap_hsmmc: fix cmd23 multiblock read/write
  2014-05-09 16:46 [PATCH v2 0/6] mmc: omap_hsmmc: convert to use devm_* and fixes Balaji T K
                   ` (3 preceding siblings ...)
  2014-05-09 16:46 ` [PATCH v2 4/6] mmc: omap_hsmmc: use devm_ioremap_resource Balaji T K
@ 2014-05-09 16:46 ` Balaji T K
  2014-05-09 16:46 ` [PATCH v2 6/6] mmc: omap_hsmmc: split omap-dma header file Balaji T K
  2014-05-21 10:09 ` [PATCH v2 0/6] mmc: omap_hsmmc: convert to use devm_* and fixes Ulf Hansson
  6 siblings, 0 replies; 20+ messages in thread
From: Balaji T K @ 2014-05-09 16:46 UTC (permalink / raw)
  To: linux-mmc, chris, ulf.hansson; +Cc: linux-omap, Balaji T K

Check for set block count command fails always since host->cmd is
set to NULL in the same function incorrectly. Correct host->cmd usage properly.

Signed-off-by: Balaji T K <balajitk@ti.com>
---
 drivers/mmc/host/omap_hsmmc.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 140425c..cba71d6 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -920,16 +920,17 @@ omap_hsmmc_xfer_done(struct omap_hsmmc_host *host, struct mmc_data *data)
 static void
 omap_hsmmc_cmd_done(struct omap_hsmmc_host *host, struct mmc_command *cmd)
 {
-	host->cmd = NULL;
-
 	if (host->mrq->sbc && (host->cmd == host->mrq->sbc) &&
 	    !host->mrq->sbc->error && !(host->flags & AUTO_CMD23)) {
+		host->cmd = NULL;
 		omap_hsmmc_start_dma_transfer(host);
 		omap_hsmmc_start_command(host, host->mrq->cmd,
 						host->mrq->data);
 		return;
 	}
 
+	host->cmd = NULL;
+
 	if (cmd->flags & MMC_RSP_PRESENT) {
 		if (cmd->flags & MMC_RSP_136) {
 			/* response type 2 */
-- 
1.7.5.4


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

* [PATCH v2 6/6] mmc: omap_hsmmc: split omap-dma header file
  2014-05-09 16:46 [PATCH v2 0/6] mmc: omap_hsmmc: convert to use devm_* and fixes Balaji T K
                   ` (4 preceding siblings ...)
  2014-05-09 16:46 ` [PATCH v2 5/6] mmc: omap_hsmmc: fix cmd23 multiblock read/write Balaji T K
@ 2014-05-09 16:46 ` Balaji T K
  2014-05-15 13:38   ` Balaji T K
  2014-05-16 21:41   ` Tony Lindgren
  2014-05-21 10:09 ` [PATCH v2 0/6] mmc: omap_hsmmc: convert to use devm_* and fixes Ulf Hansson
  6 siblings, 2 replies; 20+ messages in thread
From: Balaji T K @ 2014-05-09 16:46 UTC (permalink / raw)
  To: linux-mmc, chris, ulf.hansson
  Cc: linux-omap, Balaji T K, Russell King - ARM Linux, Tony Lindgren

moving dmaengine consumer specific function to omap-dmaengine.h
to Resolve build failure seen with sh-allmodconfig:
    include/linux/omap-dma.h:171:8: error: expected identifier before numeric constant
    make[4]: *** [drivers/mmc/host/omap_hsmmc.o] Error 1

Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Balaji T K <balajitk@ti.com>
---
 drivers/mmc/host/omap_hsmmc.c  |    2 +-
 include/linux/omap-dma.h       |   19 +------------------
 include/linux/omap-dmaengine.h |   21 +++++++++++++++++++++
 3 files changed, 23 insertions(+), 19 deletions(-)
 create mode 100644 include/linux/omap-dmaengine.h

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index cba71d6..6b7b755 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -31,7 +31,7 @@
 #include <linux/of.h>
 #include <linux/of_gpio.h>
 #include <linux/of_device.h>
-#include <linux/omap-dma.h>
+#include <linux/omap-dmaengine.h>
 #include <linux/mmc/host.h>
 #include <linux/mmc/core.h>
 #include <linux/mmc/mmc.h>
diff --git a/include/linux/omap-dma.h b/include/linux/omap-dma.h
index 41a13e7..999f52d 100644
--- a/include/linux/omap-dma.h
+++ b/include/linux/omap-dma.h
@@ -1,23 +1,6 @@
-/*
- * OMAP DMA Engine support
- *
- * 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.
- */
 #ifndef __LINUX_OMAP_DMA_H
 #define __LINUX_OMAP_DMA_H
-
-struct dma_chan;
-
-#if defined(CONFIG_DMA_OMAP) || defined(CONFIG_DMA_OMAP_MODULE)
-bool omap_dma_filter_fn(struct dma_chan *, void *);
-#else
-static inline bool omap_dma_filter_fn(struct dma_chan *c, void *d)
-{
-	return false;
-}
-#endif
+#include <linux/omap-dmaengine.h>
 
 /*
  *  Legacy OMAP DMA handling defines and functions
diff --git a/include/linux/omap-dmaengine.h b/include/linux/omap-dmaengine.h
new file mode 100644
index 0000000..2b0b6aa
--- /dev/null
+++ b/include/linux/omap-dmaengine.h
@@ -0,0 +1,21 @@
+/*
+ * OMAP DMA Engine support
+ *
+ * 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.
+ */
+#ifndef __LINUX_OMAP_DMAENGINE_H
+#define __LINUX_OMAP_DMAENGINE_H
+
+struct dma_chan;
+
+#if defined(CONFIG_DMA_OMAP) || defined(CONFIG_DMA_OMAP_MODULE)
+bool omap_dma_filter_fn(struct dma_chan *, void *);
+#else
+static inline bool omap_dma_filter_fn(struct dma_chan *c, void *d)
+{
+	return false;
+}
+#endif
+#endif /* __LINUX_OMAP_DMAENGINE_H */
-- 
1.7.5.4


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

* Re: [PATCH v2 1/6] mmc: omap_hsmmc: use devm_clk_get
  2014-05-09 16:46 ` [PATCH v2 1/6] mmc: omap_hsmmc: use devm_clk_get Balaji T K
@ 2014-05-12  8:33   ` Ulf Hansson
  2014-05-12 13:33     ` Balaji T K
  0 siblings, 1 reply; 20+ messages in thread
From: Ulf Hansson @ 2014-05-12  8:33 UTC (permalink / raw)
  To: Balaji T K; +Cc: linux-mmc, Chris Ball, linux-omap

On 9 May 2014 18:46, Balaji T K <balajitk@ti.com> wrote:
> With devm_clk_get conversion clk_put can be removed in clean up path
>
> Signed-off-by: Balaji T K <balajitk@ti.com>
> ---
>  drivers/mmc/host/omap_hsmmc.c |   15 ++++-----------
>  1 files changed, 4 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index b4de63b..b8ae7ee 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -1922,7 +1922,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
>
>         spin_lock_init(&host->irq_lock);
>
> -       host->fclk = clk_get(&pdev->dev, "fck");
> +       host->fclk = devm_clk_get(&pdev->dev, "fck");
>         if (IS_ERR(host->fclk)) {
>                 ret = PTR_ERR(host->fclk);
>                 host->fclk = NULL;
> @@ -1941,7 +1941,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
>
>         omap_hsmmc_context_save(host);
>
> -       host->dbclk = clk_get(&pdev->dev, "mmchsdb_fck");
> +       host->dbclk = devm_clk_get(&pdev->dev, "mmchsdb_fck");
>         /*
>          * MMC can still work without debounce clock.
>          */
> @@ -1949,7 +1949,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
>                 host->dbclk = NULL;
>         } else if (clk_prepare_enable(host->dbclk) != 0) {
>                 dev_warn(mmc_dev(host->mmc), "Failed to enable debounce clk\n");
> -               clk_put(host->dbclk);
>                 host->dbclk = NULL;

You should use the IS_ERR macro, no need to reset dbclk to NULL.

>         }
>
> @@ -2105,11 +2104,8 @@ err_irq:
>                 dma_release_channel(host->rx_chan);
>         pm_runtime_put_sync(host->dev);
>         pm_runtime_disable(host->dev);
> -       clk_put(host->fclk);
> -       if (host->dbclk) {
> +       if (host->dbclk)

Use IS_ERR instead.

>                 clk_disable_unprepare(host->dbclk);
> -               clk_put(host->dbclk);
> -       }
>  err1:
>         iounmap(host->base);
>         mmc_free_host(mmc);
> @@ -2144,11 +2140,8 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
>
>         pm_runtime_put_sync(host->dev);
>         pm_runtime_disable(host->dev);
> -       clk_put(host->fclk);
> -       if (host->dbclk) {
> +       if (host->dbclk)

Use IS_ERR instead.

>                 clk_disable_unprepare(host->dbclk);
> -               clk_put(host->dbclk);
> -       }
>
>         omap_hsmmc_gpio_free(host->pdata);
>         iounmap(host->base);
> --
> 1.7.5.4
>

Kind regards
Ulf Hansson

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

* Re: [PATCH v2 1/6] mmc: omap_hsmmc: use devm_clk_get
  2014-05-12  8:33   ` Ulf Hansson
@ 2014-05-12 13:33     ` Balaji T K
  2014-05-12 13:50       ` Ulf Hansson
  0 siblings, 1 reply; 20+ messages in thread
From: Balaji T K @ 2014-05-12 13:33 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-mmc, Chris Ball, linux-omap

On Monday 12 May 2014 02:03 PM, Ulf Hansson wrote:
> On 9 May 2014 18:46, Balaji T K <balajitk@ti.com> wrote:
>> With devm_clk_get conversion clk_put can be removed in clean up path
>>
>> Signed-off-by: Balaji T K <balajitk@ti.com>
>> ---
>>   drivers/mmc/host/omap_hsmmc.c |   15 ++++-----------
>>   1 files changed, 4 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
>> index b4de63b..b8ae7ee 100644
>> --- a/drivers/mmc/host/omap_hsmmc.c
>> +++ b/drivers/mmc/host/omap_hsmmc.c
>> @@ -1922,7 +1922,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
>>
>>          spin_lock_init(&host->irq_lock);
>>
>> -       host->fclk = clk_get(&pdev->dev, "fck");
>> +       host->fclk = devm_clk_get(&pdev->dev, "fck");
>>          if (IS_ERR(host->fclk)) {
>>                  ret = PTR_ERR(host->fclk);
>>                  host->fclk = NULL;
>> @@ -1941,7 +1941,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
>>
>>          omap_hsmmc_context_save(host);
>>
>> -       host->dbclk = clk_get(&pdev->dev, "mmchsdb_fck");
>> +       host->dbclk = devm_clk_get(&pdev->dev, "mmchsdb_fck");
>>          /*
>>           * MMC can still work without debounce clock.
>>           */
>> @@ -1949,7 +1949,6 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
>>                  host->dbclk = NULL;
>>          } else if (clk_prepare_enable(host->dbclk) != 0) {
>>                  dev_warn(mmc_dev(host->mmc), "Failed to enable debounce clk\n");
>> -               clk_put(host->dbclk);
>>                  host->dbclk = NULL;
>
> You should use the IS_ERR macro, no need to reset dbclk to NULL.
>

Agreed, IS_ERR macro usage deserves patch on its own.
will create separate patch on top of this series.

Thanks and Regards
Balaji T K
>>          }
>>
>> @@ -2105,11 +2104,8 @@ err_irq:
>>                  dma_release_channel(host->rx_chan);
>>          pm_runtime_put_sync(host->dev);
>>          pm_runtime_disable(host->dev);
>> -       clk_put(host->fclk);
>> -       if (host->dbclk) {
>> +       if (host->dbclk)
>
> Use IS_ERR instead.
>
>>                  clk_disable_unprepare(host->dbclk);
>> -               clk_put(host->dbclk);
>> -       }
>>   err1:
>>          iounmap(host->base);
>>          mmc_free_host(mmc);
>> @@ -2144,11 +2140,8 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
>>
>>          pm_runtime_put_sync(host->dev);
>>          pm_runtime_disable(host->dev);
>> -       clk_put(host->fclk);
>> -       if (host->dbclk) {
>> +       if (host->dbclk)
>
> Use IS_ERR instead.
>
>>                  clk_disable_unprepare(host->dbclk);
>> -               clk_put(host->dbclk);
>> -       }
>>
>>          omap_hsmmc_gpio_free(host->pdata);
>>          iounmap(host->base);
>> --
>> 1.7.5.4
>>
>
> Kind regards
> Ulf Hansson
>


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

* Re: [PATCH v2 1/6] mmc: omap_hsmmc: use devm_clk_get
  2014-05-12 13:33     ` Balaji T K
@ 2014-05-12 13:50       ` Ulf Hansson
  2014-05-15 13:23         ` [PATCH] mmc: omap_hsmmc: use IS_ERR macro for error checking Balaji T K
  2014-05-15 13:25         ` [PATCH v2 1/6] mmc: omap_hsmmc: use devm_clk_get Balaji T K
  0 siblings, 2 replies; 20+ messages in thread
From: Ulf Hansson @ 2014-05-12 13:50 UTC (permalink / raw)
  To: Balaji T K; +Cc: linux-mmc, Chris Ball, linux-omap

On 12 May 2014 15:33, Balaji T K <balajitk@ti.com> wrote:
> On Monday 12 May 2014 02:03 PM, Ulf Hansson wrote:
>>
>> On 9 May 2014 18:46, Balaji T K <balajitk@ti.com> wrote:
>>>
>>> With devm_clk_get conversion clk_put can be removed in clean up path
>>>
>>> Signed-off-by: Balaji T K <balajitk@ti.com>
>>> ---
>>>   drivers/mmc/host/omap_hsmmc.c |   15 ++++-----------
>>>   1 files changed, 4 insertions(+), 11 deletions(-)
>>>
>>> diff --git a/drivers/mmc/host/omap_hsmmc.c
>>> b/drivers/mmc/host/omap_hsmmc.c
>>> index b4de63b..b8ae7ee 100644
>>> --- a/drivers/mmc/host/omap_hsmmc.c
>>> +++ b/drivers/mmc/host/omap_hsmmc.c
>>> @@ -1922,7 +1922,7 @@ static int omap_hsmmc_probe(struct platform_device
>>> *pdev)
>>>
>>>          spin_lock_init(&host->irq_lock);
>>>
>>> -       host->fclk = clk_get(&pdev->dev, "fck");
>>> +       host->fclk = devm_clk_get(&pdev->dev, "fck");
>>>          if (IS_ERR(host->fclk)) {
>>>                  ret = PTR_ERR(host->fclk);
>>>                  host->fclk = NULL;
>>> @@ -1941,7 +1941,7 @@ static int omap_hsmmc_probe(struct platform_device
>>> *pdev)
>>>
>>>          omap_hsmmc_context_save(host);
>>>
>>> -       host->dbclk = clk_get(&pdev->dev, "mmchsdb_fck");
>>> +       host->dbclk = devm_clk_get(&pdev->dev, "mmchsdb_fck");
>>>          /*
>>>           * MMC can still work without debounce clock.
>>>           */
>>> @@ -1949,7 +1949,6 @@ static int omap_hsmmc_probe(struct platform_device
>>> *pdev)
>>>                  host->dbclk = NULL;
>>>          } else if (clk_prepare_enable(host->dbclk) != 0) {
>>>                  dev_warn(mmc_dev(host->mmc), "Failed to enable debounce
>>> clk\n");
>>> -               clk_put(host->dbclk);
>>>                  host->dbclk = NULL;
>>
>>
>> You should use the IS_ERR macro, no need to reset dbclk to NULL.
>>
>
> Agreed, IS_ERR macro usage deserves patch on its own.
> will create separate patch on top of this series.

Or you just update this patch, since it would touch there very same
piece of code. :-)

Kind regards
Ulf Hansson

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

* [PATCH] mmc: omap_hsmmc: use IS_ERR macro for error checking
  2014-05-12 13:50       ` Ulf Hansson
@ 2014-05-15 13:23         ` Balaji T K
  2014-05-21 10:10           ` Ulf Hansson
  2014-05-15 13:25         ` [PATCH v2 1/6] mmc: omap_hsmmc: use devm_clk_get Balaji T K
  1 sibling, 1 reply; 20+ messages in thread
From: Balaji T K @ 2014-05-15 13:23 UTC (permalink / raw)
  To: linux-mmc, chris, ulf.hansson; +Cc: linux-omap, Balaji T K

Debounce clock is optional, use IS_ERR macro instead of NULL pointer check.

Signed-off-by: Balaji T K <balajitk@ti.com>
---
 drivers/mmc/host/omap_hsmmc.c |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 6b7b755..521eec3 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1155,7 +1155,7 @@ static int omap_hsmmc_switch_opcond(struct omap_hsmmc_host *host, int vdd)
 
 	/* Disable the clocks */
 	pm_runtime_put_sync(host->dev);
-	if (host->dbclk)
+	if (!IS_ERR(host->dbclk))
 		clk_disable_unprepare(host->dbclk);
 
 	/* Turn the power off */
@@ -1166,7 +1166,7 @@ static int omap_hsmmc_switch_opcond(struct omap_hsmmc_host *host, int vdd)
 		ret = mmc_slot(host).set_power(host->dev, host->slot_id, 1,
 					       vdd);
 	pm_runtime_get_sync(host->dev);
-	if (host->dbclk)
+	if (!IS_ERR(host->dbclk))
 		clk_prepare_enable(host->dbclk);
 
 	if (ret != 0)
@@ -1947,12 +1947,8 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 	/*
 	 * MMC can still work without debounce clock.
 	 */
-	if (IS_ERR(host->dbclk)) {
-		host->dbclk = NULL;
-	} else if (clk_prepare_enable(host->dbclk) != 0) {
+	if (!IS_ERR(host->dbclk) && clk_prepare_enable(host->dbclk))
 		dev_warn(mmc_dev(host->mmc), "Failed to enable debounce clk\n");
-		host->dbclk = NULL;
-	}
 
 	/* Since we do only SG emulation, we can have as many segs
 	 * as we want. */
@@ -2103,7 +2099,7 @@ err_irq:
 		dma_release_channel(host->rx_chan);
 	pm_runtime_put_sync(host->dev);
 	pm_runtime_disable(host->dev);
-	if (host->dbclk)
+	if (!IS_ERR(host->dbclk))
 		clk_disable_unprepare(host->dbclk);
 err1:
 	mmc_free_host(mmc);
@@ -2131,7 +2127,7 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
 
 	pm_runtime_put_sync(host->dev);
 	pm_runtime_disable(host->dev);
-	if (host->dbclk)
+	if (!IS_ERR(host->dbclk))
 		clk_disable_unprepare(host->dbclk);
 
 	omap_hsmmc_gpio_free(host->pdata);
@@ -2175,7 +2171,7 @@ static int omap_hsmmc_suspend(struct device *dev)
 				OMAP_HSMMC_READ(host->base, HCTL) & ~SDBP);
 	}
 
-	if (host->dbclk)
+	if (!IS_ERR(host->dbclk))
 		clk_disable_unprepare(host->dbclk);
 
 	pm_runtime_put_sync(host->dev);
@@ -2192,7 +2188,7 @@ static int omap_hsmmc_resume(struct device *dev)
 
 	pm_runtime_get_sync(host->dev);
 
-	if (host->dbclk)
+	if (!IS_ERR(host->dbclk))
 		clk_prepare_enable(host->dbclk);
 
 	if (!(host->mmc->pm_flags & MMC_PM_KEEP_POWER))
-- 
1.7.5.4


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

* Re: [PATCH v2 1/6] mmc: omap_hsmmc: use devm_clk_get
  2014-05-12 13:50       ` Ulf Hansson
  2014-05-15 13:23         ` [PATCH] mmc: omap_hsmmc: use IS_ERR macro for error checking Balaji T K
@ 2014-05-15 13:25         ` Balaji T K
  1 sibling, 0 replies; 20+ messages in thread
From: Balaji T K @ 2014-05-15 13:25 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-mmc, Chris Ball, linux-omap

On Monday 12 May 2014 07:20 PM, Ulf Hansson wrote:
> On 12 May 2014 15:33, Balaji T K <balajitk@ti.com> wrote:
>> On Monday 12 May 2014 02:03 PM, Ulf Hansson wrote:
>>>
>>> On 9 May 2014 18:46, Balaji T K <balajitk@ti.com> wrote:
>>>>
>>>> With devm_clk_get conversion clk_put can be removed in clean up path
>>>>
>>>> Signed-off-by: Balaji T K <balajitk@ti.com>
>>>> ---
>>>>    drivers/mmc/host/omap_hsmmc.c |   15 ++++-----------
>>>>    1 files changed, 4 insertions(+), 11 deletions(-)
>>>>
>>>> diff --git a/drivers/mmc/host/omap_hsmmc.c
>>>> b/drivers/mmc/host/omap_hsmmc.c
>>>> index b4de63b..b8ae7ee 100644
>>>> --- a/drivers/mmc/host/omap_hsmmc.c
>>>> +++ b/drivers/mmc/host/omap_hsmmc.c
>>>> @@ -1922,7 +1922,7 @@ static int omap_hsmmc_probe(struct platform_device
>>>> *pdev)
>>>>
>>>>           spin_lock_init(&host->irq_lock);
>>>>
>>>> -       host->fclk = clk_get(&pdev->dev, "fck");
>>>> +       host->fclk = devm_clk_get(&pdev->dev, "fck");
>>>>           if (IS_ERR(host->fclk)) {
>>>>                   ret = PTR_ERR(host->fclk);
>>>>                   host->fclk = NULL;
>>>> @@ -1941,7 +1941,7 @@ static int omap_hsmmc_probe(struct platform_device
>>>> *pdev)
>>>>
>>>>           omap_hsmmc_context_save(host);
>>>>
>>>> -       host->dbclk = clk_get(&pdev->dev, "mmchsdb_fck");
>>>> +       host->dbclk = devm_clk_get(&pdev->dev, "mmchsdb_fck");
>>>>           /*
>>>>            * MMC can still work without debounce clock.
>>>>            */
>>>> @@ -1949,7 +1949,6 @@ static int omap_hsmmc_probe(struct platform_device
>>>> *pdev)
>>>>                   host->dbclk = NULL;
>>>>           } else if (clk_prepare_enable(host->dbclk) != 0) {
>>>>                   dev_warn(mmc_dev(host->mmc), "Failed to enable debounce
>>>> clk\n");
>>>> -               clk_put(host->dbclk);
>>>>                   host->dbclk = NULL;
>>>
>>>
>>> You should use the IS_ERR macro, no need to reset dbclk to NULL.
>>>
>>
>> Agreed, IS_ERR macro usage deserves patch on its own.
>> will create separate patch on top of this series.
>
> Or you just update this patch, since it would touch there very same
> piece of code. :-)

plus few more code additionally, since these are two different logical changes,
have sent a separate patch. But feel free to squash them if needed.

Thanks and Regards,
Balaji T K

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

* Re: [PATCH v2 6/6] mmc: omap_hsmmc: split omap-dma header file
  2014-05-09 16:46 ` [PATCH v2 6/6] mmc: omap_hsmmc: split omap-dma header file Balaji T K
@ 2014-05-15 13:38   ` Balaji T K
  2014-05-16 21:41   ` Tony Lindgren
  1 sibling, 0 replies; 20+ messages in thread
From: Balaji T K @ 2014-05-15 13:38 UTC (permalink / raw)
  To: Balaji T K
  Cc: linux-mmc, chris, ulf.hansson, linux-omap,
	Russell King - ARM Linux, Tony Lindgren

On Friday 09 May 2014 10:16 PM, Balaji T K wrote:
> moving dmaengine consumer specific function to omap-dmaengine.h
> to Resolve build failure seen with sh-allmodconfig:
>      include/linux/omap-dma.h:171:8: error: expected identifier before numeric constant
>      make[4]: *** [drivers/mmc/host/omap_hsmmc.o] Error 1
>
> Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
> Cc: Tony Lindgren <tony@atomide.com>
> Signed-off-by: Balaji T K <balajitk@ti.com>

Hi Russell, Tony,

Since this patches touches omap dma header file,
can you provide your comments / ack if it looks ok ?

> ---
>   drivers/mmc/host/omap_hsmmc.c  |    2 +-
>   include/linux/omap-dma.h       |   19 +------------------
>   include/linux/omap-dmaengine.h |   21 +++++++++++++++++++++
>   3 files changed, 23 insertions(+), 19 deletions(-)
>   create mode 100644 include/linux/omap-dmaengine.h
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index cba71d6..6b7b755 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -31,7 +31,7 @@
>   #include <linux/of.h>
>   #include <linux/of_gpio.h>
>   #include <linux/of_device.h>
> -#include <linux/omap-dma.h>
> +#include <linux/omap-dmaengine.h>
>   #include <linux/mmc/host.h>
>   #include <linux/mmc/core.h>
>   #include <linux/mmc/mmc.h>
> diff --git a/include/linux/omap-dma.h b/include/linux/omap-dma.h
> index 41a13e7..999f52d 100644
> --- a/include/linux/omap-dma.h
> +++ b/include/linux/omap-dma.h
> @@ -1,23 +1,6 @@
> -/*
> - * OMAP DMA Engine support
> - *
> - * 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.
> - */
>   #ifndef __LINUX_OMAP_DMA_H
>   #define __LINUX_OMAP_DMA_H
> -
> -struct dma_chan;
> -
> -#if defined(CONFIG_DMA_OMAP) || defined(CONFIG_DMA_OMAP_MODULE)
> -bool omap_dma_filter_fn(struct dma_chan *, void *);
> -#else
> -static inline bool omap_dma_filter_fn(struct dma_chan *c, void *d)
> -{
> -	return false;
> -}
> -#endif
> +#include <linux/omap-dmaengine.h>
>
>   /*
>    *  Legacy OMAP DMA handling defines and functions
> diff --git a/include/linux/omap-dmaengine.h b/include/linux/omap-dmaengine.h
> new file mode 100644
> index 0000000..2b0b6aa
> --- /dev/null
> +++ b/include/linux/omap-dmaengine.h
> @@ -0,0 +1,21 @@
> +/*
> + * OMAP DMA Engine support
> + *
> + * 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.
> + */
> +#ifndef __LINUX_OMAP_DMAENGINE_H
> +#define __LINUX_OMAP_DMAENGINE_H
> +
> +struct dma_chan;
> +
> +#if defined(CONFIG_DMA_OMAP) || defined(CONFIG_DMA_OMAP_MODULE)
> +bool omap_dma_filter_fn(struct dma_chan *, void *);
> +#else
> +static inline bool omap_dma_filter_fn(struct dma_chan *c, void *d)
> +{
> +	return false;
> +}
> +#endif
> +#endif /* __LINUX_OMAP_DMAENGINE_H */
>


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

* Re: [PATCH v2 6/6] mmc: omap_hsmmc: split omap-dma header file
  2014-05-09 16:46 ` [PATCH v2 6/6] mmc: omap_hsmmc: split omap-dma header file Balaji T K
  2014-05-15 13:38   ` Balaji T K
@ 2014-05-16 21:41   ` Tony Lindgren
  2014-05-19 11:53     ` Balaji T K
  1 sibling, 1 reply; 20+ messages in thread
From: Tony Lindgren @ 2014-05-16 21:41 UTC (permalink / raw)
  To: Balaji T K
  Cc: linux-mmc, chris, ulf.hansson, linux-omap,
	Russell King - ARM Linux

* Balaji T K <balajitk@ti.com> [140509 09:47]:
> moving dmaengine consumer specific function to omap-dmaengine.h
> to Resolve build failure seen with sh-allmodconfig:
>     include/linux/omap-dma.h:171:8: error: expected identifier before numeric constant
>     make[4]: *** [drivers/mmc/host/omap_hsmmc.o] Error 1
> 
> Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
> Cc: Tony Lindgren <tony@atomide.com>
> Signed-off-by: Balaji T K <balajitk@ti.com>
> ---
>  drivers/mmc/host/omap_hsmmc.c  |    2 +-
>  include/linux/omap-dma.h       |   19 +------------------
>  include/linux/omap-dmaengine.h |   21 +++++++++++++++++++++
>  3 files changed, 23 insertions(+), 19 deletions(-)
>  create mode 100644 include/linux/omap-dmaengine.h
> 
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index cba71d6..6b7b755 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -31,7 +31,7 @@
>  #include <linux/of.h>
>  #include <linux/of_gpio.h>
>  #include <linux/of_device.h>
> -#include <linux/omap-dma.h>
> +#include <linux/omap-dmaengine.h>
>  #include <linux/mmc/host.h>
>  #include <linux/mmc/core.h>
>  #include <linux/mmc/mmc.h>
> diff --git a/include/linux/omap-dma.h b/include/linux/omap-dma.h
> index 41a13e7..999f52d 100644
> --- a/include/linux/omap-dma.h
> +++ b/include/linux/omap-dma.h
> @@ -1,23 +1,6 @@
> -/*
> - * OMAP DMA Engine support
> - *
> - * 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.
> - */
>  #ifndef __LINUX_OMAP_DMA_H
>  #define __LINUX_OMAP_DMA_H
> -
> -struct dma_chan;
> -
> -#if defined(CONFIG_DMA_OMAP) || defined(CONFIG_DMA_OMAP_MODULE)
> -bool omap_dma_filter_fn(struct dma_chan *, void *);
> -#else
> -static inline bool omap_dma_filter_fn(struct dma_chan *c, void *d)
> -{
> -	return false;
> -}
> -#endif
> +#include <linux/omap-dmaengine.h>

Can't the drivers needing this include it directly?

Also, has this been tested with make randconfig? Changes like
this can easily cause problems elsewhere..

Regards,

Tony
  
>  /*
>   *  Legacy OMAP DMA handling defines and functions
> diff --git a/include/linux/omap-dmaengine.h b/include/linux/omap-dmaengine.h
> new file mode 100644
> index 0000000..2b0b6aa
> --- /dev/null
> +++ b/include/linux/omap-dmaengine.h
> @@ -0,0 +1,21 @@
> +/*
> + * OMAP DMA Engine support
> + *
> + * 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.
> + */
> +#ifndef __LINUX_OMAP_DMAENGINE_H
> +#define __LINUX_OMAP_DMAENGINE_H
> +
> +struct dma_chan;
> +
> +#if defined(CONFIG_DMA_OMAP) || defined(CONFIG_DMA_OMAP_MODULE)
> +bool omap_dma_filter_fn(struct dma_chan *, void *);
> +#else
> +static inline bool omap_dma_filter_fn(struct dma_chan *c, void *d)
> +{
> +	return false;
> +}
> +#endif
> +#endif /* __LINUX_OMAP_DMAENGINE_H */
> -- 
> 1.7.5.4
> 

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

* Re: [PATCH v2 6/6] mmc: omap_hsmmc: split omap-dma header file
  2014-05-16 21:41   ` Tony Lindgren
@ 2014-05-19 11:53     ` Balaji T K
  2014-05-19 16:54       ` Tony Lindgren
  0 siblings, 1 reply; 20+ messages in thread
From: Balaji T K @ 2014-05-19 11:53 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-mmc, chris, ulf.hansson, linux-omap,
	Russell King - ARM Linux

On Saturday 17 May 2014 03:11 AM, Tony Lindgren wrote:
> * Balaji T K <balajitk@ti.com> [140509 09:47]:
>> moving dmaengine consumer specific function to omap-dmaengine.h
>> to Resolve build failure seen with sh-allmodconfig:
>>      include/linux/omap-dma.h:171:8: error: expected identifier before numeric constant
>>      make[4]: *** [drivers/mmc/host/omap_hsmmc.o] Error 1
>>
>> Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>
>> Cc: Tony Lindgren <tony@atomide.com>
>> Signed-off-by: Balaji T K <balajitk@ti.com>
>> ---
>>   drivers/mmc/host/omap_hsmmc.c  |    2 +-
>>   include/linux/omap-dma.h       |   19 +------------------
>>   include/linux/omap-dmaengine.h |   21 +++++++++++++++++++++
>>   3 files changed, 23 insertions(+), 19 deletions(-)
>>   create mode 100644 include/linux/omap-dmaengine.h
>>
>> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
>> index cba71d6..6b7b755 100644
>> --- a/drivers/mmc/host/omap_hsmmc.c
>> +++ b/drivers/mmc/host/omap_hsmmc.c
>> @@ -31,7 +31,7 @@
>>   #include <linux/of.h>
>>   #include <linux/of_gpio.h>
>>   #include <linux/of_device.h>
>> -#include <linux/omap-dma.h>
>> +#include <linux/omap-dmaengine.h>
>>   #include <linux/mmc/host.h>
>>   #include <linux/mmc/core.h>
>>   #include <linux/mmc/mmc.h>
>> diff --git a/include/linux/omap-dma.h b/include/linux/omap-dma.h
>> index 41a13e7..999f52d 100644
>> --- a/include/linux/omap-dma.h
>> +++ b/include/linux/omap-dma.h
>> @@ -1,23 +1,6 @@
>> -/*
>> - * OMAP DMA Engine support
>> - *
>> - * 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.
>> - */
>>   #ifndef __LINUX_OMAP_DMA_H
>>   #define __LINUX_OMAP_DMA_H
>> -
>> -struct dma_chan;
>> -
>> -#if defined(CONFIG_DMA_OMAP) || defined(CONFIG_DMA_OMAP_MODULE)
>> -bool omap_dma_filter_fn(struct dma_chan *, void *);
>> -#else
>> -static inline bool omap_dma_filter_fn(struct dma_chan *c, void *d)
>> -{
>> -	return false;
>> -}
>> -#endif
>> +#include <linux/omap-dmaengine.h>
>
> Can't the drivers needing this include it directly?
>

Yes, I have converted omap_hsmmc as part of this patch.
Due to lack of bandwidth, I haven't touched upon all other drivers that include
omap-dma.h. Once that is done in other subsystem after this patch gets merged,
this include can then be removed from omap-dma.h

> Also, has this been tested with make randconfig? Changes like
> this can easily cause problems elsewhere..

May be I am missing something, Can you please elaborate ?
This patch is based on the discussion [1]
I just moved the dma consumer specific things needed by users
to a separate file and include the same file in place so that other users
can be converted one at a time.

[1]
https://lkml.org/lkml/2014/1/19/16
>
> Regards,
>
> Tony
>
>>   /*
>>    *  Legacy OMAP DMA handling defines and functions
>> diff --git a/include/linux/omap-dmaengine.h b/include/linux/omap-dmaengine.h
>> new file mode 100644
>> index 0000000..2b0b6aa
>> --- /dev/null
>> +++ b/include/linux/omap-dmaengine.h
>> @@ -0,0 +1,21 @@
>> +/*
>> + * OMAP DMA Engine support
>> + *
>> + * 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.
>> + */
>> +#ifndef __LINUX_OMAP_DMAENGINE_H
>> +#define __LINUX_OMAP_DMAENGINE_H
>> +
>> +struct dma_chan;
>> +
>> +#if defined(CONFIG_DMA_OMAP) || defined(CONFIG_DMA_OMAP_MODULE)
>> +bool omap_dma_filter_fn(struct dma_chan *, void *);
>> +#else
>> +static inline bool omap_dma_filter_fn(struct dma_chan *c, void *d)
>> +{
>> +	return false;
>> +}
>> +#endif
>> +#endif /* __LINUX_OMAP_DMAENGINE_H */
>> --
>> 1.7.5.4
>>


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

* Re: [PATCH v2 6/6] mmc: omap_hsmmc: split omap-dma header file
  2014-05-19 11:53     ` Balaji T K
@ 2014-05-19 16:54       ` Tony Lindgren
  2014-05-20 13:28         ` Balaji T K
  0 siblings, 1 reply; 20+ messages in thread
From: Tony Lindgren @ 2014-05-19 16:54 UTC (permalink / raw)
  To: Balaji T K
  Cc: linux-mmc, chris, ulf.hansson, linux-omap,
	Russell King - ARM Linux

* Balaji T K <balajitk@ti.com> [140519 04:54]:
> On Saturday 17 May 2014 03:11 AM, Tony Lindgren wrote:
> >>-
> >>-#if defined(CONFIG_DMA_OMAP) || defined(CONFIG_DMA_OMAP_MODULE)
> >>-bool omap_dma_filter_fn(struct dma_chan *, void *);
> >>-#else
> >>-static inline bool omap_dma_filter_fn(struct dma_chan *c, void *d)
> >>-{
> >>-	return false;
> >>-}
> >>-#endif
> >>+#include <linux/omap-dmaengine.h>
> >
> >Can't the drivers needing this include it directly?
> >
> 
> Yes, I have converted omap_hsmmc as part of this patch.
> Due to lack of bandwidth, I haven't touched upon all other drivers that include
> omap-dma.h. Once that is done in other subsystem after this patch gets merged,
> this include can then be removed from omap-dma.h

OK
 
> >Also, has this been tested with make randconfig? Changes like
> >this can easily cause problems elsewhere..
> 
> May be I am missing something, Can you please elaborate ?

You're touching a header included in many places, so you
need to make sure you're not accidentally breaking anything.

There's an option that allows you to specify some selected
options like CONFIG_ARCH_OMAP2PLUS=y with KCONFIG_ALLCONFIG
and then run make randconfig. This should expose quite fast
if there are some issues for the other drivers.

Also, have you compile tested this with omap1_defconfig?

Regards,

Tony

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

* Re: [PATCH v2 6/6] mmc: omap_hsmmc: split omap-dma header file
  2014-05-19 16:54       ` Tony Lindgren
@ 2014-05-20 13:28         ` Balaji T K
  2014-05-20 14:50           ` Tony Lindgren
  0 siblings, 1 reply; 20+ messages in thread
From: Balaji T K @ 2014-05-20 13:28 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-mmc, chris, ulf.hansson, linux-omap,
	Russell King - ARM Linux

On Monday 19 May 2014 10:24 PM, Tony Lindgren wrote:
> * Balaji T K <balajitk@ti.com> [140519 04:54]:
>> On Saturday 17 May 2014 03:11 AM, Tony Lindgren wrote:
>>>> -
>>>> -#if defined(CONFIG_DMA_OMAP) || defined(CONFIG_DMA_OMAP_MODULE)
>>>> -bool omap_dma_filter_fn(struct dma_chan *, void *);
>>>> -#else
>>>> -static inline bool omap_dma_filter_fn(struct dma_chan *c, void *d)
>>>> -{
>>>> -	return false;
>>>> -}
>>>> -#endif
>>>> +#include <linux/omap-dmaengine.h>
>>>
>>> Can't the drivers needing this include it directly?
>>>
>>
>> Yes, I have converted omap_hsmmc as part of this patch.
>> Due to lack of bandwidth, I haven't touched upon all other drivers that include
>> omap-dma.h. Once that is done in other subsystem after this patch gets merged,
>> this include can then be removed from omap-dma.h
>
> OK
>
>>> Also, has this been tested with make randconfig? Changes like
>>> this can easily cause problems elsewhere..
>>
>> May be I am missing something, Can you please elaborate ?
>
> You're touching a header included in many places, so you
> need to make sure you're not accidentally breaking anything.
>

True

> There's an option that allows you to specify some selected
> options like CONFIG_ARCH_OMAP2PLUS=y with KCONFIG_ALLCONFIG
> and then run make randconfig. This should expose quite fast
> if there are some issues for the other drivers.
>
> Also, have you compile tested this with omap1_defconfig?
>

checked omap1_defconfig and randconfig's, both are OK.

Thanks and Regards,
Balaji T K

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

* Re: [PATCH v2 6/6] mmc: omap_hsmmc: split omap-dma header file
  2014-05-20 13:28         ` Balaji T K
@ 2014-05-20 14:50           ` Tony Lindgren
  0 siblings, 0 replies; 20+ messages in thread
From: Tony Lindgren @ 2014-05-20 14:50 UTC (permalink / raw)
  To: Balaji T K
  Cc: linux-mmc, chris, ulf.hansson, linux-omap,
	Russell King - ARM Linux

* Balaji T K <balajitk@ti.com> [140520 06:29]:
> On Monday 19 May 2014 10:24 PM, Tony Lindgren wrote:
> >* Balaji T K <balajitk@ti.com> [140519 04:54]:
> >>On Saturday 17 May 2014 03:11 AM, Tony Lindgren wrote:
> >>>>-
> >>>>-#if defined(CONFIG_DMA_OMAP) || defined(CONFIG_DMA_OMAP_MODULE)
> >>>>-bool omap_dma_filter_fn(struct dma_chan *, void *);
> >>>>-#else
> >>>>-static inline bool omap_dma_filter_fn(struct dma_chan *c, void *d)
> >>>>-{
> >>>>-	return false;
> >>>>-}
> >>>>-#endif
> >>>>+#include <linux/omap-dmaengine.h>
> >>>
> >>>Can't the drivers needing this include it directly?
> >>>
> >>
> >>Yes, I have converted omap_hsmmc as part of this patch.
> >>Due to lack of bandwidth, I haven't touched upon all other drivers that include
> >>omap-dma.h. Once that is done in other subsystem after this patch gets merged,
> >>this include can then be removed from omap-dma.h
> >
> >OK
> >
> >>>Also, has this been tested with make randconfig? Changes like
> >>>this can easily cause problems elsewhere..
> >>
> >>May be I am missing something, Can you please elaborate ?
> >
> >You're touching a header included in many places, so you
> >need to make sure you're not accidentally breaking anything.
> >
> 
> True
> 
> >There's an option that allows you to specify some selected
> >options like CONFIG_ARCH_OMAP2PLUS=y with KCONFIG_ALLCONFIG
> >and then run make randconfig. This should expose quite fast
> >if there are some issues for the other drivers.
> >
> >Also, have you compile tested this with omap1_defconfig?
> >
> 
> checked omap1_defconfig and randconfig's, both are OK.

OK thanks:

Acked-by: Tony Lindgren <tony@atomide.com>

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

* Re: [PATCH v2 0/6] mmc: omap_hsmmc: convert to use devm_* and fixes
  2014-05-09 16:46 [PATCH v2 0/6] mmc: omap_hsmmc: convert to use devm_* and fixes Balaji T K
                   ` (5 preceding siblings ...)
  2014-05-09 16:46 ` [PATCH v2 6/6] mmc: omap_hsmmc: split omap-dma header file Balaji T K
@ 2014-05-21 10:09 ` Ulf Hansson
  6 siblings, 0 replies; 20+ messages in thread
From: Ulf Hansson @ 2014-05-21 10:09 UTC (permalink / raw)
  To: Balaji T K; +Cc: linux-mmc, Chris Ball, linux-omap

On 9 May 2014 18:46, Balaji T K <balajitk@ti.com> wrote:
> v2:
> use devm_ioremap_resource
> add cmd23 multiblock read/write fix
>
> Balaji T K (6):
>   mmc: omap_hsmmc: use devm_clk_get
>   mmc: omap_hsmmc: use devm_request_irq
>   mmc: omap_hsmmc: use devm_request_threaded_irq
>   mmc: omap_hsmmc: use devm_ioremap_resource
>   mmc: omap_hsmmc: fix cmd23 multiblock read/write
>   mmc: omap_hsmmc: split omap-dma header file
>
>  drivers/mmc/host/omap_hsmmc.c  |   57 ++++++++++++---------------------------
>  include/linux/omap-dma.h       |   19 +------------
>  include/linux/omap-dmaengine.h |   21 ++++++++++++++
>  3 files changed, 40 insertions(+), 57 deletions(-)
>  create mode 100644 include/linux/omap-dmaengine.h
>

Thanks Balaji,

I will include this patchset in the next PR I send to Chris.

Kind regards
Ulf Hansson

> --
> 1.7.5.4
>

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

* Re: [PATCH] mmc: omap_hsmmc: use IS_ERR macro for error checking
  2014-05-15 13:23         ` [PATCH] mmc: omap_hsmmc: use IS_ERR macro for error checking Balaji T K
@ 2014-05-21 10:10           ` Ulf Hansson
  0 siblings, 0 replies; 20+ messages in thread
From: Ulf Hansson @ 2014-05-21 10:10 UTC (permalink / raw)
  To: Balaji T K; +Cc: linux-mmc, Chris Ball, linux-omap

On 15 May 2014 15:23, Balaji T K <balajitk@ti.com> wrote:
> Debounce clock is optional, use IS_ERR macro instead of NULL pointer check.
>
> Signed-off-by: Balaji T K <balajitk@ti.com>

Thanks Balaji,

I will include this in the next PR I send to Chris.

Kind regards
Ulf Hansson

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

end of thread, other threads:[~2014-05-21 10:10 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-09 16:46 [PATCH v2 0/6] mmc: omap_hsmmc: convert to use devm_* and fixes Balaji T K
2014-05-09 16:46 ` [PATCH v2 1/6] mmc: omap_hsmmc: use devm_clk_get Balaji T K
2014-05-12  8:33   ` Ulf Hansson
2014-05-12 13:33     ` Balaji T K
2014-05-12 13:50       ` Ulf Hansson
2014-05-15 13:23         ` [PATCH] mmc: omap_hsmmc: use IS_ERR macro for error checking Balaji T K
2014-05-21 10:10           ` Ulf Hansson
2014-05-15 13:25         ` [PATCH v2 1/6] mmc: omap_hsmmc: use devm_clk_get Balaji T K
2014-05-09 16:46 ` [PATCH v2 2/6] mmc: omap_hsmmc: use devm_request_irq Balaji T K
2014-05-09 16:46 ` [PATCH v2 3/6] mmc: omap_hsmmc: use devm_request_threaded_irq Balaji T K
2014-05-09 16:46 ` [PATCH v2 4/6] mmc: omap_hsmmc: use devm_ioremap_resource Balaji T K
2014-05-09 16:46 ` [PATCH v2 5/6] mmc: omap_hsmmc: fix cmd23 multiblock read/write Balaji T K
2014-05-09 16:46 ` [PATCH v2 6/6] mmc: omap_hsmmc: split omap-dma header file Balaji T K
2014-05-15 13:38   ` Balaji T K
2014-05-16 21:41   ` Tony Lindgren
2014-05-19 11:53     ` Balaji T K
2014-05-19 16:54       ` Tony Lindgren
2014-05-20 13:28         ` Balaji T K
2014-05-20 14:50           ` Tony Lindgren
2014-05-21 10:09 ` [PATCH v2 0/6] mmc: omap_hsmmc: convert to use devm_* and fixes Ulf Hansson

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).