Skip to contentSkip to conversation

crypto: cavium/nitrox: add an error message to explain the failure of pci_request_mem_regions

PATCH In review George Acosta 2 participants 4 messages Aug 21, 2020 – Aug 29, 2020 Crypto API

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 crypto: cavium/nitrox: add an error message to explain the failure of pci_request_mem_regions

Provide an error message for users when pci_request_mem_regions failed.

---
 drivers/crypto/cavium/nitrox/nitrox_main.c | 1 +
 1 file changed, 1 insertion(+)
drivers/crypto/cavium/nitrox/nitrox_main.c +1 -0
index cee2a2713038..9d14be97e381 100644
@@ -451,6 +451,7 @@ static int nitrox_probe(struct pci_dev *pdev,
 	err = pci_request_mem_regions(pdev, nitrox_driver_name);
 	if (err) {
 		pci_disable_device(pdev);
+		dev_err(&pdev->dev, "Failed to request mem regions!\n");
 		return err;
 	}
 	pci_set_master(pdev);
Signature · 1 line
2.17.1
maintainer
#1 lore raw
Quoted 6 lines · George Acosta

Provide an error message for users when pci_request_mem_regions failed.

---
 drivers/crypto/cavium/nitrox/nitrox_main.c | 1 +
 1 file changed, 1 insertion(+)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
#2 lore raw

Hi Herbert,
I just noticed a small potential issue about the calling sequence of pci_disable_device and dev_err.
Do you think it will be better to call dev_err before we call pci_disable_device(pdev) , or the order here does not matter?

Quoted 9 lines · Herbert Xu
Quoted 6 lines · George Acosta

Provide an error message for users when pci_request_mem_regions failed.

---
 drivers/crypto/cavium/nitrox/nitrox_main.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 5 lines

Patch applied. Thanks.
--
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Thanks,
George

maintainer
#3 lore raw
Quoted 5 lines · George Acosta

Hi Herbert,
I just noticed a small potential issue about the calling sequence of pci_disable_device and dev_err.
Do you think it will be better to call dev_err before we call pci_disable_device(pdev) , or the order here does not matter?

I don't think it matters.

Thanks,

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt