]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mfd: ls2kbmc: Use PCI API instead of direct accesses
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 30 Oct 2025 11:36:34 +0000 (12:36 +0100)
committerLee Jones <lee@kernel.org>
Thu, 22 Jan 2026 14:23:53 +0000 (14:23 +0000)
There is a PCI API to access device resources. Use it instead of
direct accesses.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://patch.msgid.link/20251030113735.3741913-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/ls2k-bmc-core.c

index 7d7c07a367c6590db7c8ea8d7a24b22cc81d2dd8..408056bfb2fe757a5bde43775a483a48352e706d 100644 (file)
@@ -484,7 +484,7 @@ static int ls2k_bmc_probe(struct pci_dev *dev, const struct pci_device_id *id)
 
        ls2k_bmc_cells[LS2K_BMC_DISPLAY].platform_data = &pd;
        ls2k_bmc_cells[LS2K_BMC_DISPLAY].pdata_size = sizeof(pd);
-       base = dev->resource[0].start + LS2K_DISPLAY_RES_START;
+       base = pci_resource_start(dev, 0) + LS2K_DISPLAY_RES_START;
 
        /* Remove conflicting efifb device */
        ret = aperture_remove_conflicting_devices(base, SZ_4M, "simple-framebuffer");
@@ -493,7 +493,7 @@ static int ls2k_bmc_probe(struct pci_dev *dev, const struct pci_device_id *id)
 
        return devm_mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO,
                                    ls2k_bmc_cells, ARRAY_SIZE(ls2k_bmc_cells),
-                                   &dev->resource[0], 0, NULL);
+                                   pci_resource_n(dev, 0), 0, NULL);
 }
 
 static struct pci_device_id ls2k_bmc_devices[] = {