mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] block: sx8: use module_pci_driver()
@ 2013-09-16  4:55 Jingoo Han
  2013-09-16  4:56 ` [PATCH 2/2] block: sx8: remove unnecessary pci_set_drvdata() Jingoo Han
  0 siblings, 1 reply; 2+ messages in thread
From: Jingoo Han @ 2013-09-16  4:55 UTC (permalink / raw)
  To: 'Andrew Morton'
  Cc: linux-kernel, 'Jens Axboe', 'Jingoo Han'

Use module_pci_driver() macro which makes the code smaller and
simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/block/sx8.c |   15 +--------------
 1 file changed, 1 insertion(+), 14 deletions(-)

diff --git a/drivers/block/sx8.c b/drivers/block/sx8.c
index 3fb6ab4..7b2ac95 100644
--- a/drivers/block/sx8.c
+++ b/drivers/block/sx8.c
@@ -1747,17 +1747,4 @@ static void carm_remove_one (struct pci_dev *pdev)
 	pci_set_drvdata(pdev, NULL);
 }
 
-static int __init carm_init(void)
-{
-	return pci_register_driver(&carm_driver);
-}
-
-static void __exit carm_exit(void)
-{
-	pci_unregister_driver(&carm_driver);
-}
-
-module_init(carm_init);
-module_exit(carm_exit);
-
-
+module_pci_driver(carm_driver);
-- 
1.7.10.4



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

* [PATCH 2/2] block: sx8: remove unnecessary pci_set_drvdata()
  2013-09-16  4:55 [PATCH 1/2] block: sx8: use module_pci_driver() Jingoo Han
@ 2013-09-16  4:56 ` Jingoo Han
  0 siblings, 0 replies; 2+ messages in thread
From: Jingoo Han @ 2013-09-16  4:56 UTC (permalink / raw)
  To: 'Andrew Morton'
  Cc: linux-kernel, 'Jens Axboe', 'Jingoo Han'

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
 drivers/block/sx8.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/block/sx8.c b/drivers/block/sx8.c
index 7b2ac95..d5e2d12 100644
--- a/drivers/block/sx8.c
+++ b/drivers/block/sx8.c
@@ -1744,7 +1744,6 @@ static void carm_remove_one (struct pci_dev *pdev)
 	kfree(host);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
-	pci_set_drvdata(pdev, NULL);
 }
 
 module_pci_driver(carm_driver);
-- 
1.7.10.4



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

end of thread, other threads:[~2013-09-16  4:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-16  4:55 [PATCH 1/2] block: sx8: use module_pci_driver() Jingoo Han
2013-09-16  4:56 ` [PATCH 2/2] block: sx8: remove unnecessary pci_set_drvdata() Jingoo Han

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

Powered by JetHome