public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5/5] dsp_core.c: Use struct platform_driver
@ 2005-11-28 16:56 Komal Shah
  2005-11-29  3:20 ` Tony Lindgren
  0 siblings, 1 reply; 3+ messages in thread
From: Komal Shah @ 2005-11-28 16:56 UTC (permalink / raw)
  To: linux-omap-open-source

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

Tony/Toshihiro-san,

Attached patch updates driver model and adjustment of #ifdef CONFIG_PM.

---Komal Shah
http://komalshah.blogspot.com/


	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

[-- Attachment #2: pat1686335160 --]
[-- Type: text/plain, Size: 3869 bytes --]

Subject: [PATCH 5/5] dsp_core.c: Use struct platform_driver
Signed-off-by: Komal Shah <komal_shah802003@yahoo.com>

---

 arch/arm/plat-omap/dsp/dsp_core.c |   40 +++++++++++++++++++------------------
 1 files changed, 21 insertions(+), 19 deletions(-)

applies-to: 76a87a72f8766eb762aefcd68303dd8d6b91d6fc
a0aede602b9c14ba4eb3d63d879bd0eb72442176
diff --git a/arch/arm/plat-omap/dsp/dsp_core.c b/arch/arm/plat-omap/dsp/dsp_core.c
index d5d8c22..f7aa2b8 100644
--- a/arch/arm/plat-omap/dsp/dsp_core.c
+++ b/arch/arm/plat-omap/dsp/dsp_core.c
@@ -588,7 +588,7 @@ static void dsp_dev_release(struct devic
 #	define INT_D2A_MB2 INT_DSP_MAILBOX1
 #endif
 
-static int __init dsp_drv_probe(struct device *dev)
+static int __init dsp_drv_probe(struct platform_device *pdev)
 {
 	int ret;
 
@@ -611,7 +611,7 @@ static int __init dsp_drv_probe(struct d
 	 * mailbox interrupt handlers registration
 	 */
 	ret = request_irq(INT_D2A_MB1, mbx1_interrupt, SA_INTERRUPT, "dsp",
-			  dev);
+			  &pdev->dev);
 	if (ret) {
 		printk(KERN_ERR
 		       "failed to register mailbox1 interrupt: %d\n", ret);
@@ -619,7 +619,7 @@ static int __init dsp_drv_probe(struct d
 	}
 
 	ret = request_irq(INT_D2A_MB2, mbx2_interrupt, SA_INTERRUPT, "dsp",
-			  dev);
+			  &pdev->dev);
 	if (ret) {
 		printk(KERN_ERR
 		       "failed to register mailbox2 interrupt: %d\n", ret);
@@ -627,7 +627,7 @@ static int __init dsp_drv_probe(struct d
 	}
 
 	ret = request_irq(INT_DSP_MMU, dsp_mmu_interrupt, SA_INTERRUPT, "dsp",
-			  dev);
+			  &pdev->dev);
 	if (ret) {
 		printk(KERN_ERR
 		       "failed to register DSP MMU interrupt: %d\n", ret);
@@ -649,9 +649,9 @@ static int __init dsp_drv_probe(struct d
 	return 0;
 
 fail6:
-	free_irq(INT_D2A_MB2, dev);
+	free_irq(INT_D2A_MB2, &pdev->dev);
 fail5:
-	free_irq(INT_D2A_MB1, dev);
+	free_irq(INT_D2A_MB1, &pdev->dev);
 fail4:
 	dsp_taskmod_exit();
 fail3:
@@ -667,16 +667,16 @@ fail1:
 	return ret;
 }
 
-static int dsp_drv_remove(struct device *dev)
+static int dsp_drv_remove(struct platform_device *pdev)
 {
 	dsp_cpustat_request(CPUSTAT_RESET);
 
 #if 0
 	free_irq(INT_MPUIO, dev);
 #endif
-	free_irq(INT_DSP_MMU, dev);
-	free_irq(INT_D2A_MB2, dev);
-	free_irq(INT_D2A_MB1, dev);
+	free_irq(INT_DSP_MMU, &pdev->dev);
+	free_irq(INT_D2A_MB2, &pdev->dev);
+	free_irq(INT_D2A_MB1, &pdev->dev);
 
 	/* recover disable_depth */
 	enable_irq(INT_DSP_MMU);
@@ -696,19 +696,22 @@ static int dsp_drv_remove(struct device 
 }
 
 #ifdef CONFIG_PM
-static int dsp_drv_suspend(struct device *dev, pm_message_t state)
+static int dsp_drv_suspend(struct platform_device *pdev, pm_message_t state)
 {
 	dsp_suspend();
 
 	return 0;
 }
 
-static int dsp_drv_resume(struct device *dev)
+static int dsp_drv_resume(struct platform_device *pdev)
 {
 	dsp_resume();
 
 	return 0;
 }
+#else
+#define dsp_drv_suspend		NULL
+#define dsp_drv_resume		NULL
 #endif /* CONFIG_PM */
 
 static struct resource dsp_resources[] = {
@@ -736,15 +739,14 @@ struct platform_device dsp_device = {
 	.resource	= dsp_resources,
 };
 
-static struct device_driver dsp_driver = {
-	.name		= "dsp",
-	.bus		= &platform_bus_type,
+static struct platform_driver dsp_driver = {
 	.probe		= dsp_drv_probe,
 	.remove		= dsp_drv_remove,
-#ifdef CONFIG_PM
 	.suspend	= dsp_drv_suspend,
 	.resume		= dsp_drv_resume,
-#endif
+	.driver		= {
+		.name	= "dsp",
+	},
 };
 
 static int __init omap_dsp_mod_init(void)
@@ -757,7 +759,7 @@ static int __init omap_dsp_mod_init(void
 		goto fail1;
 	}
 
-	ret = driver_register(&dsp_driver);
+	ret = platform_driver_register(&dsp_driver);
 	if (ret) {
 		printk(KERN_ERR "failed to register the DSP driver: %d\n", ret);
 		goto fail2;
@@ -773,7 +775,7 @@ fail1:
 
 static void __exit omap_dsp_mod_exit(void)
 {
-	driver_unregister(&dsp_driver);
+	platform_driver_unregister(&dsp_driver);
 	platform_device_unregister(&dsp_device);
 }
 
---
0.99.9.GIT

[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



^ permalink raw reply related	[flat|nested] 3+ messages in thread
* RE: [PATCH 5/5] dsp_core.c: Use struct platform_driver
@ 2005-11-29  3:28 Toshihiro.Kobayashi
  0 siblings, 0 replies; 3+ messages in thread
From: Toshihiro.Kobayashi @ 2005-11-29  3:28 UTC (permalink / raw)
  To: komal_shah802003, linux-omap-open-source

Hi,

Basically it looks OK but the following change is not neccesary.
I think fields in a global structure are initialized with 0 if not
specified.

+#else
+#define dsp_drv_suspend		NULL
+#define dsp_drv_resume		NULL
 #endif /* CONFIG_PM */
 
-#ifdef CONFIG_PM
 	.suspend	= dsp_drv_suspend,
 	.resume		= dsp_drv_resume,
-#endif

BR,
Toshihiro Kobayashi

>-----Original Message-----
>From: ext Komal Shah [mailto:komal_shah802003@yahoo.com] 
>Sent: Tuesday, November 29, 2005 1:56 AM
>To: linux-omap-open-source@linux.omap.com
>Cc: Kobayashi Toshihiro (Nokia-NRC/Tokyo)
>Subject: [PATCH 5/5] dsp_core.c: Use struct platform_driver
>
>Tony/Toshihiro-san,
>
>Attached patch updates driver model and adjustment of #ifdef CONFIG_PM.
>
>---Komal Shah
>http://komalshah.blogspot.com/
>

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

end of thread, other threads:[~2005-11-29  3:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-28 16:56 [PATCH 5/5] dsp_core.c: Use struct platform_driver Komal Shah
2005-11-29  3:20 ` Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2005-11-29  3:28 Toshihiro.Kobayashi

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