From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Binbin Zhou <zhoubinbin@loongson.cn>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-kernel@vger.kernel.org
Cc: Chong Qiao <qiaochong@loongson.cn>, Lee Jones <lee@kernel.org>
Subject: [PATCH v1 2/2] mfd: ls2kbmc: Use PCI API instead of direct accesses
Date: Thu, 30 Oct 2025 12:36:34 +0100 [thread overview]
Message-ID: <20251030113735.3741913-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20251030113735.3741913-1-andriy.shevchenko@linux.intel.com>
There is PCI API to access device resources. Use it instead of
direct accesses.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/mfd/ls2k-bmc-core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/ls2k-bmc-core.c b/drivers/mfd/ls2k-bmc-core.c
index 616ff0a28b00..7b0a5fed1d1d 100644
--- a/drivers/mfd/ls2k-bmc-core.c
+++ b/drivers/mfd/ls2k-bmc-core.c
@@ -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[] = {
--
2.50.1
next prev parent reply other threads:[~2025-10-30 11:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-30 11:36 [PATCH v1 0/2] mfd: ls2kbmc: A fix and a refactoring Andy Shevchenko
2025-10-30 11:36 ` [PATCH v1 1/2] mfd: ls2kbmc: Fully convert to use managed resources Andy Shevchenko
2025-11-13 14:03 ` Lee Jones
2025-10-30 11:36 ` Andy Shevchenko [this message]
2025-11-13 14:03 ` [PATCH v1 2/2] mfd: ls2kbmc: Use PCI API instead of direct accesses Lee Jones
2025-10-31 2:31 ` [PATCH v1 0/2] mfd: ls2kbmc: A fix and a refactoring Binbin Zhou
2025-12-14 14:57 ` Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251030113735.3741913-3-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=qiaochong@loongson.cn \
--cc=zhoubinbin@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®