From: Philipp Stanner <phasta@kernel.org>
To: Yong Zhi <yong.zhi@intel.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Bingbu Cao <bingbu.cao@intel.com>,
Dan Scally <djrscally@gmail.com>,
Tianshu Qiu <tian.shu.qiu@intel.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Akihiro Tsukada <tskd08@gmail.com>,
Bluecherry Maintainers <maintainers@bluecherrydvr.com>,
Andrey Utkin <andrey_utkin@fastmail.com>,
Ismael Luceno <ismael@iodev.co.uk>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Philipp Stanner <phasta@kernel.org>
Subject: [PATCH 5/5] media: tw5864: Replace deprecated PCI functions
Date: Fri, 4 Apr 2025 15:53:45 +0200 [thread overview]
Message-ID: <20250404135344.93241-7-phasta@kernel.org> (raw)
In-Reply-To: <20250404135344.93241-2-phasta@kernel.org>
pcim_iomap_table() and pcim_iomap_regions() have been deprecated.
pcim_iomap_regions(), furthermore, has so far wrongly been passed the
device's name instead of the driver's name, which makes that function's
debug prints useless.
Replace the deprecated function with pcim_iomap_region().
Define the driver name globally and use it where appropriate.
Signed-off-by: Philipp Stanner <phasta@kernel.org>
---
drivers/media/pci/tw5864/tw5864-core.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/media/pci/tw5864/tw5864-core.c b/drivers/media/pci/tw5864/tw5864-core.c
index 4d33caf83307..832788603f88 100644
--- a/drivers/media/pci/tw5864/tw5864-core.c
+++ b/drivers/media/pci/tw5864/tw5864-core.c
@@ -24,6 +24,8 @@
#include "tw5864.h"
#include "tw5864-reg.h"
+#define DRIVER_NAME "tw5864"
+
MODULE_DESCRIPTION("V4L2 driver module for tw5864-based multimedia capture & encoding devices");
MODULE_AUTHOR("Bluecherry Maintainers <maintainers@bluecherrydvr.com>");
MODULE_AUTHOR("Andrey Utkin <andrey.utkin@corp.bluecherry.net>");
@@ -246,7 +248,8 @@ static int tw5864_initdev(struct pci_dev *pci_dev,
if (!dev)
return -ENOMEM;
- snprintf(dev->name, sizeof(dev->name), "tw5864:%s", pci_name(pci_dev));
+ snprintf(dev->name, sizeof(dev->name), "%s:%s", DRIVER_NAME,
+ pci_name(pci_dev));
err = v4l2_device_register(&pci_dev->dev, &dev->v4l2_dev);
if (err)
@@ -269,12 +272,12 @@ static int tw5864_initdev(struct pci_dev *pci_dev,
}
/* get mmio */
- err = pcim_iomap_regions(pci_dev, BIT(0), dev->name);
+ dev->mmio = pcim_iomap_region(pci_dev, 0, DRIVER_NAME);
+ err = PTR_ERR_OR_ZERO(dev->mmio);
if (err) {
dev_err(&dev->pci->dev, "Cannot request regions for MMIO\n");
goto unreg_v4l2;
}
- dev->mmio = pcim_iomap_table(pci_dev)[0];
spin_lock_init(&dev->slock);
@@ -290,7 +293,7 @@ static int tw5864_initdev(struct pci_dev *pci_dev,
/* get irq */
err = devm_request_irq(&pci_dev->dev, pci_dev->irq, tw5864_isr,
- IRQF_SHARED, "tw5864", dev);
+ IRQF_SHARED, DRIVER_NAME, dev);
if (err < 0) {
dev_err(&dev->pci->dev, "can't get IRQ %d\n", pci_dev->irq);
goto fini_video;
@@ -324,7 +327,7 @@ static void tw5864_finidev(struct pci_dev *pci_dev)
}
static struct pci_driver tw5864_pci_driver = {
- .name = "tw5864",
+ .name = DRIVER_NAME,
.id_table = tw5864_pci_tbl,
.probe = tw5864_initdev,
.remove = tw5864_finidev,
--
2.48.1
next prev parent reply other threads:[~2025-04-04 13:54 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-04 13:53 [PATCH 0/5] media: " Philipp Stanner
2025-04-04 13:53 ` [PATCH 1/5] media: ipu3-cio2: " Philipp Stanner
2025-04-04 13:53 ` [PATCH 2/5] media: pt3: " Philipp Stanner
2025-04-15 14:16 ` Akihiro TSUKADA
2025-04-04 13:53 ` [PATCH 3/5] media: intel/ipu6: " Philipp Stanner
2025-04-04 13:53 ` [PATCH 4/5] media: solo6x10: " Philipp Stanner
2025-07-29 4:08 ` Ismael Luceno
2025-04-04 13:53 ` Philipp Stanner [this message]
2025-04-14 9:06 ` [PATCH 0/5] media: " Philipp Stanner
2025-04-14 9:15 ` Sakari Ailus
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=20250404135344.93241-7-phasta@kernel.org \
--to=phasta@kernel.org \
--cc=andrey_utkin@fastmail.com \
--cc=bingbu.cao@intel.com \
--cc=djrscally@gmail.com \
--cc=ismael@iodev.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=maintainers@bluecherrydvr.com \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=tian.shu.qiu@intel.com \
--cc=tskd08@gmail.com \
--cc=yong.zhi@intel.com \
/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®