diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2023-11-06 20:40:51 +0200 |
---|---|---|
committer | Lee Jones <lee@kernel.org> | 2023-12-07 13:50:25 +0000 |
commit | 6978c7d2dd81e0a3f9d30d1fbdb013a5ae5fabaf (patch) | |
tree | b7ba20076fb5bf0a5a9593eb957f85129d7f302b /drivers/mfd | |
parent | 895243c8763e9c81cace2d526d9770fa1ad035a2 (diff) | |
download | lwn-6978c7d2dd81e0a3f9d30d1fbdb013a5ae5fabaf.tar.gz lwn-6978c7d2dd81e0a3f9d30d1fbdb013a5ae5fabaf.zip |
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: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20231106184052.1166579-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r-- | drivers/mfd/intel-lpss-pci.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c index ae5759200622..cf56cd3a40ee 100644 --- a/drivers/mfd/intel-lpss-pci.c +++ b/drivers/mfd/intel-lpss-pci.c @@ -37,13 +37,17 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev, if (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), GFP_KERNEL); if (!info) return -ENOMEM; - info->mem = &pdev->resource[0]; - info->irq = pdev->irq; + info->mem = pci_resource_n(pdev, 0); + info->irq = pci_irq_vector(pdev, 0); if (pci_match_id(ignore_resource_conflicts_ids, pdev)) info->ignore_resource_conflicts = true; |