lkml.org 
[lkml]   [2019]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/6] edac: i82443bxgx_edac: use pci_get_device_by_id()
Date
Use the new pci_get_device_by_id() helper in order to reduce
a bit of boilerplate.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
drivers/edac/i82443bxgx_edac.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/edac/i82443bxgx_edac.c b/drivers/edac/i82443bxgx_edac.c
index a2ca929e2168..c01f51a4848c 100644
--- a/drivers/edac/i82443bxgx_edac.c
+++ b/drivers/edac/i82443bxgx_edac.c
@@ -407,15 +407,13 @@ static int __init i82443bxgx_edacmc_init(void)
goto fail0;

if (mci_pdev == NULL) {
- const struct pci_device_id *id = &i82443bxgx_pci_tbl[0];
int i = 0;
i82443bxgx_registered = 0;

- while (mci_pdev == NULL && id->vendor != 0) {
- mci_pdev = pci_get_device(id->vendor,
- id->device, NULL);
+ while (mci_pdev == NULL && i82443bxgx_pci_tbl[i].vendor) {
+ mci_pdev = pci_get_device_by_id(
+ &i82443bxgx_pci_tbl[i]);
i++;
- id = &i82443bxgx_pci_tbl[i];
}
if (!mci_pdev) {
edac_dbg(0, "i82443bxgx pci_get_device fail\n");
--
2.11.0
\
 
 \ /
  Last update: 2019-11-28 13:57    [W:0.057 / U:1.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site