[RFC PATCH 04/17] hwrng: Drop uses of pci_read_config_*() return value

Saheed O. Bolarinwa
2020-08-01T12:24:39Z

drivers/char/hw_random/amd-rng.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/char/hw_random/amd-rng.c b/drivers/char/hw_random/amd-rng.c
index 9959c762da2f..e7bf17eedaa0 100644
--- a/drivers/char/hw_random/amd-rng.c
+++ b/drivers/char/hw_random/amd-rng.c
@@ -141,9 +141,9 @@ static int __init mod_init(void)
return -ENODEV;

found:
- err = pci_read_config_dword(pdev, 0x58, &pmbase);
- if (err)
- return err;
+ pci_read_config_dword(pdev, 0x58, &pmbase);
+ if (pmbase == (u32)~0)
+ return -ENODEV;

pmbase &= 0x0000FF00;
if (pmbase == 0)
--
2.18.4