[PATCH 5/5] scsi: sni: use module_platform_driver() and platform_{set,get}_drvdata

From: Kefeng Wang
Date: Thu May 30 2013 - 08:11:51 EST


Use helper macro and wrapper functions to simpily code.

Signed-off-by: Kefeng Wang <wangkefeng.wang@xxxxxxxxxx>
---
drivers/scsi/sni_53c710.c | 17 +++--------------
1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/sni_53c710.c b/drivers/scsi/sni_53c710.c
index 52d54e7..eff84c4 100644
--- a/drivers/scsi/sni_53c710.c
+++ b/drivers/scsi/sni_53c710.c
@@ -104,7 +104,7 @@ static int snirm710_probe(struct platform_device *dev)
goto out_put_host;
}

- dev_set_drvdata(&dev->dev, host);
+ platform_set_drvdata(dev, host);
scsi_scan_host(host);

return 0;
@@ -119,7 +119,7 @@ static int snirm710_probe(struct platform_device *dev)

static int __exit snirm710_driver_remove(struct platform_device *dev)
{
- struct Scsi_Host *host = dev_get_drvdata(&dev->dev);
+ struct Scsi_Host *host = platform_get_drvdata(dev);
struct NCR_700_Host_Parameters *hostdata =
(struct NCR_700_Host_Parameters *)host->hostdata[0];

@@ -141,15 +141,4 @@ static struct platform_driver snirm710_driver = {
},
};

-static int __init snirm710_init(void)
-{
- return platform_driver_register(&snirm710_driver);
-}
-
-static void __exit snirm710_exit(void)
-{
- platform_driver_unregister(&snirm710_driver);
-}
-
-module_init(snirm710_init);
-module_exit(snirm710_exit);
+module_platform_driver(snirm710_driver);
--
1.8.2.1


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/