public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] McBSP: Fix the free variable update at remove.
@ 2010-11-02 10:24 shubhrajyoti
  2010-11-02 10:32 ` Jarkko Nikula
  2010-11-02 10:34 ` Varadarajan, Charulatha
  0 siblings, 2 replies; 7+ messages in thread
From: shubhrajyoti @ 2010-11-02 10:24 UTC (permalink / raw)
  To: linux-omap; +Cc: Shubhrajyoti D

From: Shubhrajyoti D <shubhrajyoti@ti.com>

At remove the free variable is wrongly updated.Attempting to solve the same.

Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
---
-[v2] Instead of using 0/1 use a macro

 arch/arm/plat-omap/include/plat/mcbsp.h |    3 +++
 arch/arm/plat-omap/mcbsp.c              |   10 +++++-----
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/arch/arm/plat-omap/include/plat/mcbsp.h b/arch/arm/plat-omap/include/plat/mcbsp.h
index b87d83c..8988733 100644
--- a/arch/arm/plat-omap/include/plat/mcbsp.h
+++ b/arch/arm/plat-omap/include/plat/mcbsp.h
@@ -37,6 +37,9 @@ static struct platform_device omap_mcbsp##port_nr = {	\
 	.id	= OMAP_MCBSP##port_nr,			\
 }
 
+#define TRUE			1
+#define FALSE			0
+
 #define OMAP7XX_MCBSP1_BASE	0xfffb1000
 #define OMAP7XX_MCBSP2_BASE	0xfffb1800
 
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index eac4b97..438b3c7 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -755,7 +755,7 @@ int omap_mcbsp_request(unsigned int id)
 		goto err_kfree;
 	}
 
-	mcbsp->free = 0;
+	mcbsp->free = FALSE;
 	mcbsp->reg_cache = reg_cache;
 	spin_unlock(&mcbsp->lock);
 
@@ -815,7 +815,7 @@ err_clk_disable:
 	clk_disable(mcbsp->iclk);
 
 	spin_lock(&mcbsp->lock);
-	mcbsp->free = 1;
+	mcbsp->free = TRUE;
 	mcbsp->reg_cache = NULL;
 err_kfree:
 	spin_unlock(&mcbsp->lock);
@@ -858,7 +858,7 @@ void omap_mcbsp_free(unsigned int id)
 	if (mcbsp->free)
 		dev_err(mcbsp->dev, "McBSP%d was not reserved\n", mcbsp->id);
 	else
-		mcbsp->free = 1;
+		mcbsp->free = TRUE;
 	mcbsp->reg_cache = NULL;
 	spin_unlock(&mcbsp->lock);
 
@@ -1771,7 +1771,7 @@ static int __devinit omap_mcbsp_probe(struct platform_device *pdev)
 
 	spin_lock_init(&mcbsp->lock);
 	mcbsp->id = id + 1;
-	mcbsp->free = 1;
+	mcbsp->free = TRUE;
 	mcbsp->dma_tx_lch = -1;
 	mcbsp->dma_rx_lch = -1;
 
@@ -1845,7 +1845,7 @@ static int __devexit omap_mcbsp_remove(struct platform_device *pdev)
 
 		mcbsp->fclk = NULL;
 		mcbsp->iclk = NULL;
-		mcbsp->free = 0;
+		mcbsp->free = TRUE;
 		mcbsp->dev = NULL;
 	}
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH v2 ] McBSP: Fix the free variable update at remove
@ 2010-11-02 11:03 shubhrajyoti
  2010-11-03  9:28 ` Jarkko Nikula
  0 siblings, 1 reply; 7+ messages in thread
From: shubhrajyoti @ 2010-11-02 11:03 UTC (permalink / raw)
  To: linux-omap; +Cc: Shubhrajyoti D

From: Shubhrajyoti D <shubhrajyoti@ti.com>

At remove the free variable is wrongly updated.Attempting to solve the same.

Signed-off-by: Shubhrajyoti D <shubhrajyoti@ti.com>
Reported-by: Vikram Pandita <vikram.pandita@ti.com>
---
-[v2] Instead of using 0/1 use true/false
 arch/arm/plat-omap/mcbsp.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c
index eac4b97..07c0525 100644
--- a/arch/arm/plat-omap/mcbsp.c
+++ b/arch/arm/plat-omap/mcbsp.c
@@ -755,7 +755,7 @@ int omap_mcbsp_request(unsigned int id)
 		goto err_kfree;
 	}
 
-	mcbsp->free = 0;
+	mcbsp->free = false;
 	mcbsp->reg_cache = reg_cache;
 	spin_unlock(&mcbsp->lock);
 
@@ -815,7 +815,7 @@ err_clk_disable:
 	clk_disable(mcbsp->iclk);
 
 	spin_lock(&mcbsp->lock);
-	mcbsp->free = 1;
+	mcbsp->free = true;
 	mcbsp->reg_cache = NULL;
 err_kfree:
 	spin_unlock(&mcbsp->lock);
@@ -858,7 +858,7 @@ void omap_mcbsp_free(unsigned int id)
 	if (mcbsp->free)
 		dev_err(mcbsp->dev, "McBSP%d was not reserved\n", mcbsp->id);
 	else
-		mcbsp->free = 1;
+		mcbsp->free = true;
 	mcbsp->reg_cache = NULL;
 	spin_unlock(&mcbsp->lock);
 
@@ -1771,7 +1771,7 @@ static int __devinit omap_mcbsp_probe(struct platform_device *pdev)
 
 	spin_lock_init(&mcbsp->lock);
 	mcbsp->id = id + 1;
-	mcbsp->free = 1;
+	mcbsp->free = true;
 	mcbsp->dma_tx_lch = -1;
 	mcbsp->dma_rx_lch = -1;
 
@@ -1845,7 +1845,7 @@ static int __devexit omap_mcbsp_remove(struct platform_device *pdev)
 
 		mcbsp->fclk = NULL;
 		mcbsp->iclk = NULL;
-		mcbsp->free = 0;
+		mcbsp->free = true;
 		mcbsp->dev = NULL;
 	}
 
-- 
1.7.0.4


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

end of thread, other threads:[~2010-11-03  9:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-02 10:24 [PATCH v2] McBSP: Fix the free variable update at remove shubhrajyoti
2010-11-02 10:32 ` Jarkko Nikula
2010-11-02 11:05   ` Datta, Shubhrajyoti
2010-11-02 10:34 ` Varadarajan, Charulatha
  -- strict thread matches above, loose matches on Subject: below --
2010-11-02 11:03 [PATCH v2 ] " shubhrajyoti
2010-11-03  9:28 ` Jarkko Nikula
2010-11-03  9:40   ` Datta, Shubhrajyoti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox