[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1369915786-2660-2-git-send-email-wangkefeng.wang@huawei.com>
Date: Thu, 30 May 2013 20:09:42 +0800
From: Kefeng Wang <wangkefeng.wang@...wei.com>
To: "David S. Miller" <davem@...emloft.net>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
"James E.J. Bottomley" <James.Bottomley@...senPartnership.com>
CC: <linux-scsi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<guohanjun@...wei.com>, Kefeng Wang <wangkefeng.wang@...wei.com>
Subject: [PATCH 1/5] scsi: jazz: use module_platform_driver() and platform_{set,get}_drvdata
Use helper macro and wrapper functions to simpily code.
Signed-off-by: Kefeng Wang <wangkefeng.wang@...wei.com>
---
drivers/scsi/jazz_esp.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)
diff --git a/drivers/scsi/jazz_esp.c b/drivers/scsi/jazz_esp.c
index 69efbf1..08fa257 100644
--- a/drivers/scsi/jazz_esp.c
+++ b/drivers/scsi/jazz_esp.c
@@ -180,7 +180,7 @@ static int esp_jazz_probe(struct platform_device *dev)
esp->scsi_id_mask = (1 << esp->scsi_id);
esp->cfreq = 40000000;
- dev_set_drvdata(&dev->dev, esp);
+ platform_set_drvdata(dev, esp);
err = scsi_esp_register(esp, &dev->dev);
if (err)
@@ -203,7 +203,7 @@ fail:
static int esp_jazz_remove(struct platform_device *dev)
{
- struct esp *esp = dev_get_drvdata(&dev->dev);
+ struct esp *esp = platform_get_drvdata(dev);
unsigned int irq = esp->host->irq;
scsi_esp_unregister(esp);
@@ -230,20 +230,9 @@ static struct platform_driver esp_jazz_driver = {
},
};
-static int __init jazz_esp_init(void)
-{
- return platform_driver_register(&esp_jazz_driver);
-}
-
-static void __exit jazz_esp_exit(void)
-{
- platform_driver_unregister(&esp_jazz_driver);
-}
+module_platform_driver(esp_jazz_driver);
MODULE_DESCRIPTION("JAZZ ESP SCSI driver");
MODULE_AUTHOR("Thomas Bogendoerfer (tsbogend@...ha.franken.de)");
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION);
-
-module_init(jazz_esp_init);
-module_exit(jazz_esp_exit);
--
1.8.2.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists