linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] pch_phub: fix sparse warning
@ 2012-07-29 11:23 Devendra Naga
  2012-07-29 11:23 ` [PATCH 2/2] pch_phub: use module_pci_driver Devendra Naga
  0 siblings, 1 reply; 2+ messages in thread
From: Devendra Naga @ 2012-07-29 11:23 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman, linux-kernel; +Cc: Devendra Naga

sparse warns about using 0 as NULL pointer,

drivers/misc/pch_phub.c:702:44: warning: Using plain integer as NULL pointer

Signed-off-by: Devendra Naga <develkernel412222@gmail.com>
---
 drivers/misc/pch_phub.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/pch_phub.c b/drivers/misc/pch_phub.c
index 9fbcacd..e2c066e 100644
--- a/drivers/misc/pch_phub.c
+++ b/drivers/misc/pch_phub.c
@@ -699,7 +699,7 @@ static int __devinit pch_phub_probe(struct pci_dev *pdev,
 	chip->pch_phub_base_address = pci_iomap(pdev, 1, 0);
 
 
-	if (chip->pch_phub_base_address == 0) {
+	if (chip->pch_phub_base_address == NULL) {
 		dev_err(&pdev->dev, "%s : pci_iomap FAILED", __func__);
 		ret = -ENOMEM;
 		goto err_pci_iomap;
-- 
1.7.9.5


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

* [PATCH 2/2] pch_phub: use module_pci_driver
  2012-07-29 11:23 [PATCH 1/2] pch_phub: fix sparse warning Devendra Naga
@ 2012-07-29 11:23 ` Devendra Naga
  0 siblings, 0 replies; 2+ messages in thread
From: Devendra Naga @ 2012-07-29 11:23 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman, linux-kernel; +Cc: Devendra Naga

this driver's pch_phub_pci_init, and pch_phub_pci_exit functions with
the module_init and module_exit calls can be replaced with
module_pci_driver

Signed-off-by: Devendra Naga <develkernel412222@gmail.com>
---
 drivers/misc/pch_phub.c |   13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/misc/pch_phub.c b/drivers/misc/pch_phub.c
index e2c066e..c9f20da 100644
--- a/drivers/misc/pch_phub.c
+++ b/drivers/misc/pch_phub.c
@@ -893,18 +893,7 @@ static struct pci_driver pch_phub_driver = {
 	.resume = pch_phub_resume
 };
 
-static int __init pch_phub_pci_init(void)
-{
-	return pci_register_driver(&pch_phub_driver);
-}
-
-static void __exit pch_phub_pci_exit(void)
-{
-	pci_unregister_driver(&pch_phub_driver);
-}
-
-module_init(pch_phub_pci_init);
-module_exit(pch_phub_pci_exit);
+module_pci_driver(pch_phub_driver);
 
 MODULE_DESCRIPTION("Intel EG20T PCH/LAPIS Semiconductor IOH(ML7213/ML7223) PHUB");
 MODULE_LICENSE("GPL");
-- 
1.7.9.5


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

end of thread, other threads:[~2012-07-29 11:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-29 11:23 [PATCH 1/2] pch_phub: fix sparse warning Devendra Naga
2012-07-29 11:23 ` [PATCH 2/2] pch_phub: use module_pci_driver Devendra Naga

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).