Commit 6978c7d2 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Lee Jones

mfd: intel-lpss: Use PCI APIs instead of dereferencing

We have a few PCI APIs that may be used instead of direct dereferencing,
Using them will also provide better error codes.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231106184052.1166579-2-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarLee Jones <lee@kernel.org>
parent 895243c8
...@@ -37,13 +37,17 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev, ...@@ -37,13 +37,17 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev,
if (ret) if (ret)
return ret; return ret;
ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_LEGACY);
if (ret)
return ret;
info = devm_kmemdup(&pdev->dev, (void *)id->driver_data, sizeof(*info), info = devm_kmemdup(&pdev->dev, (void *)id->driver_data, sizeof(*info),
GFP_KERNEL); GFP_KERNEL);
if (!info) if (!info)
return -ENOMEM; return -ENOMEM;
info->mem = &pdev->resource[0]; info->mem = pci_resource_n(pdev, 0);
info->irq = pdev->irq; info->irq = pci_irq_vector(pdev, 0);
if (pci_match_id(ignore_resource_conflicts_ids, pdev)) if (pci_match_id(ignore_resource_conflicts_ids, pdev))
info->ignore_resource_conflicts = true; info->ignore_resource_conflicts = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment