Skip to contentSkip to conversation

misc: phantom: Added missing warning messages in phantom_probe

PATCH In review Rahul Ruikar 3 participants 6 messages Sep 25, 2010 – Sep 26, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 misc: phantom: Added missing warning messages in phantom_probe

phantom_probe can fail at many places. missing warning messages have been added for 2 cases.
pci_enable_device()
pci_request_regions()

---
 drivers/misc/phantom.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
drivers/misc/phantom.c +6 -2
index 75ee0d3..b4c105f 100644
@@ -341,8 +341,10 @@ static int __devinit phantom_probe(struct pci_dev *pdev,
 	int retval;
 
 	retval = pci_enable_device(pdev);
-	if (retval)
+	if (retval) {
+		dev_err(&pdev->dev, "pci_enable_device failed!\n");
 		goto err;
+	}
 
 	minor = phantom_get_free();
 	if (minor == PHANTOM_MAX_MINORS) {
@@ -354,8 +356,10 @@ static int __devinit phantom_probe(struct pci_dev *pdev,
 	phantom_devices[minor] = 1;
 
 	retval = pci_request_regions(pdev, "phantom");
-	if (retval)
+	if (retval) {
+		dev_err(&pdev->dev, "pci_request_regions failed!\n");
 		goto err_null;
+	}
 
 	retval = -ENOMEM;
 	pht = kzalloc(sizeof(*pht), GFP_KERNEL);
Signature · 1 line
1.7.2.3
#1 lore raw

missed greg in earlier mail.

- Rahul Ruikar

Quoted 42 lines · Rahul Ruikar

phantom_probe can fail at many places. missing warning messages have been added for 2 cases.
pci_enable_device()
pci_request_regions()

---
 drivers/misc/phantom.c |    8 ++++++--

 1 files changed, 6 insertions(+), 2 deletions(-)
drivers/misc/phantom.c +6 -3
index 75ee0d3..b4c105f 100644
@@ -341,8 +341,10 @@ static int __devinit phantom_probe(struct pci_dev *pdev,
        int retval;
 
        retval = pci_enable_device(pdev);
-       if (retval)
+       if (retval) {
+               dev_err(&pdev->dev, "pci_enable_device failed!\n");
                goto err;
+       }
 
        minor = phantom_get_free();
        if (minor == PHANTOM_MAX_MINORS) {
@@ -354,8 +356,10 @@ static int __devinit phantom_probe(struct pci_dev *pdev,
        phantom_devices[minor] = 1;
 
        retval = pci_request_regions(pdev, "phantom");
-       if (retval)
+       if (retval) {
+               dev_err(&pdev->dev, "pci_request_regions failed!\n");
                goto err_null;
+       }
 
        retval = -ENOMEM;
        pht = kzalloc(sizeof(*pht), GFP_KERNEL);
--

1.7.2.3

#2 lore raw
Quoted 1 line · Rahul Ruikar

missed greg in earlier mail.

Ok, but why? Is drivers/misc/phantom.c my code?

confused,

greg k-h

#3 lore raw

Greg,

Actually before sending patch I run get_maintainer.pl script against this patch and it gave me all following names..
that was reason i added you in maill.

[rahul@Ganesha linux-2.6]$ ./scripts/get_maintainer.pl 0001-misc-phantom-Added-missing-warning-messages-in-phant.patch Jiri Slaby <[email protected]>
Andi Kleen <[email protected]>
Alexey Dobriyan <[email protected]>
Greg Kroah-Hartman <[email protected]>
Andrew Morton <[email protected]>
Rahul Ruikar <[email protected]> [email protected]

- Rahul Ruikar

Quoted 9 lines · Greg KH
Quoted 1 line · Rahul Ruikar

missed greg in earlier mail.

Ok, but why?  Is drivers/misc/phantom.c my code?

confused,

greg k-h

#4 lore raw
Quoted 6 lines · Rahul Ruikar

Greg,

Actually before sending patch I run get_maintainer.pl script against this patch and it gave me all following names..
that was reason i added you in maill.

Quoted 9 lines

[rahul@Ganesha linux-2.6]$ ./scripts/get_maintainer.pl 0001-misc-phantom-Added-missing-warning-messages-in-phant.patch Jiri Slaby <[email protected]>
Andi Kleen <[email protected]>
Alexey Dobriyan <[email protected]>
Greg Kroah-Hartman <[email protected]>
Andrew Morton <[email protected]>
Rahul Ruikar <[email protected]> [email protected]

Ah, ok, that makes more sense, thanks.

greg k-h

Acked-by on v1 1/1
#5 lore raw
In reply to Rahul Ruikar
Quoted 6 lines · Rahul Ruikar

phantom_probe can fail at many places. missing warning messages have been added for 2 cases.
pci_enable_device()
pci_request_regions()

Andrew, could you take it?

Quoted 22 lines
---
 drivers/misc/phantom.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
drivers/misc/phantom.c +3 -1
index 75ee0d3..b4c105f 100644
@@ -341,8 +341,10 @@ static int __devinit phantom_probe(struct pci_dev *pdev,
 	int retval;
 
 	retval = pci_enable_device(pdev);
-	if (retval)
+	if (retval) {
+		dev_err(&pdev->dev, "pci_enable_device failed!\n");
 		goto err;
+	}
 
 	minor = phantom_get_free();
 	if (minor == PHANTOM_MAX_MINORS) {
@@ -354,8 +356,10 @@ static int __devinit phantom_probe(struct pci_dev *pdev,
 	phantom_devices[minor] = 1;

drivers/misc/phantom.c static int __devinit phantom_probe(struct pci_dev *pdev, · line 365

Quoted 10 lines
drivers/misc/phantom.c +3 -1
 
 	retval = pci_request_regions(pdev, "phantom");
-	if (retval)
+	if (retval) {
+		dev_err(&pdev->dev, "pci_request_regions failed!\n");
 		goto err_null;
+	}
 
 	retval = -ENOMEM;
 	pht = kzalloc(sizeof(*pht), GFP_KERNEL);

thanks,

Signature · 1 line
js