public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] NAND: Use struct platform driver
@ 2005-12-01 10:48 Komal Shah
  2005-12-02  0:42 ` Tony Lindgren
  0 siblings, 1 reply; 2+ messages in thread
From: Komal Shah @ 2005-12-01 10:48 UTC (permalink / raw)
  To: linux-omap-open-source

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

Tony,

Attached patch uses struct platform_driver.

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


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

[-- Attachment #2: pat137000140 --]
[-- Type: text/plain, Size: 2839 bytes --]

Subject: [PATCH 9/10] NAND: Use struct platform_driver
Signed-off-by: Komal Shah <komal_shah802003@yahoo.com>

---

 drivers/mtd/nand/omap-nand-flash.c |   29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)

applies-to: a636ae3c991eb1e05edf1f56444a2bc6d79281bc
2d772374547f8a1ee4b8c49f68e910233f0c939d
diff --git a/drivers/mtd/nand/omap-nand-flash.c b/drivers/mtd/nand/omap-nand-flash.c
index 3799be0..35a3408 100644
--- a/drivers/mtd/nand/omap-nand-flash.c
+++ b/drivers/mtd/nand/omap-nand-flash.c
@@ -68,10 +68,9 @@ static int omap_nand_dev_ready(struct mt
 	return info->pdata->dev_ready(info->pdata);
 }
 
-static int __devinit omap_nand_probe(struct device *dev)
+static int __devinit omap_nand_probe(struct platform_device *pdev)
 {
 	struct omap_nand_info		*info;
-	struct platform_device		*pdev = to_platform_device(dev);
 	struct nand_platform_data	*pdata = pdev->dev.platform_data;
 	struct resource			*res = pdev->resource;
 	unsigned long			size = res->end - res->start + 1;
@@ -83,7 +82,7 @@ static int __devinit omap_nand_probe(str
 
 	memset(info, 0, sizeof(struct omap_nand_info));
 
-	if (!request_mem_region(res->start, size, dev->driver->name)) {
+	if (!request_mem_region(res->start, size, pdev->dev.driver->name)) {
 		err = -EBUSY;
 		goto out_free_info;
 	}
@@ -129,7 +128,7 @@ static int __devinit omap_nand_probe(str
 #endif
 		add_mtd_device(&info->mtd);
 
-	dev_set_drvdata(&pdev->dev, info);
+	platform_set_drvdata(pdev, info);
 
 	return 0;
 
@@ -143,12 +142,11 @@ out_free_info:
 	return err;
 }
 
-static int __devexit omap_nand_remove(struct device *dev)
+static int omap_nand_remove(struct platform_device *pdev)
 {
-	struct platform_device *pdev = to_platform_device(dev);
-	struct omap_nand_info *info = dev_get_drvdata(&pdev->dev);
+	struct omap_nand_info *info = platform_get_drvdata(pdev);
 
-	dev_set_drvdata(&pdev->dev, NULL);
+	platform_set_drvdata(pdev, NULL);
 	/* Release NAND device, its internal structures and partitions */
 	nand_release(&info->mtd);
 	iounmap(info->nand.IO_ADDR_R);
@@ -156,22 +154,23 @@ static int __devexit omap_nand_remove(st
 	return 0;
 }
 
-static struct device_driver omap_nand_driver = {
-	.name	= DRIVER_NAME,
-	.bus	= &platform_bus_type,
-	.probe	= omap_nand_probe,
-	.remove	= __devexit_p(omap_nand_remove),
+static struct platform_driver omap_nand_driver = {
+	.probe		= omap_nand_probe,
+	.remove		= omap_nand_remove,
+	.driver		= {
+		.name	= DRIVER_NAME,
+	},
 };
 MODULE_ALIAS(DRIVER_NAME);
 
 static int __init omap_nand_init(void)
 {
-	return driver_register(&omap_nand_driver);
+	return platform_driver_register(&omap_nand_driver);
 }
 
 static void __exit omap_nand_exit(void)
 {
-	driver_unregister(&omap_nand_driver);
+	platform_driver_unregister(&omap_nand_driver);
 }
 
 module_init(omap_nand_init);
---
0.99.9.GIT

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



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

* Re: [PATCH] NAND: Use struct platform driver
  2005-12-01 10:48 [PATCH] NAND: Use struct platform driver Komal Shah
@ 2005-12-02  0:42 ` Tony Lindgren
  0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2005-12-02  0:42 UTC (permalink / raw)
  To: Komal Shah; +Cc: linux-omap-open-source

* Komal Shah <komal_shah802003@yahoo.com> [051201 02:49]:
> Tony,
> 
> Attached patch uses struct platform_driver.

Pushing today.

Tony

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

end of thread, other threads:[~2005-12-02  0:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-01 10:48 [PATCH] NAND: Use struct platform driver Komal Shah
2005-12-02  0:42 ` Tony Lindgren

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