Skip to contentSkip to conversation

pch_phub: fix sparse warning

PATCH New Devendra Naga 1 participant 2 messages Jul 29, 2012 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 pch_phub: fix sparse warning

sparse warns about using 0 as NULL pointer,

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

---
 drivers/misc/pch_phub.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/pch_phub.c +1 -1
index 9fbcacd..e2c066e 100644
@@ -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;
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 2/2 pch_phub: use module_pci_driver

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

---
 drivers/misc/pch_phub.c |   13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
drivers/misc/pch_phub.c +1 -12
index e2c066e..c9f20da 100644
@@ -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");
Signature · 1 line
1.7.9.5