* [PATCH] i2c: i801: Use driver name constant instead of function dev_driver_string
@ 2021-05-25 20:04 Heiner Kallweit
2021-06-14 16:27 ` Jean Delvare
2021-06-20 20:55 ` Wolfram Sang
0 siblings, 2 replies; 3+ messages in thread
From: Heiner Kallweit @ 2021-05-25 20:04 UTC (permalink / raw)
To: Jean Delvare; +Cc: linux-i2c
We are the driver, so we can use the driver name directly instead of
retrieving it by calling dev_driver_string().
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/i2c/busses/i2c-i801.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
index 047f73f1a..5a7ce2658 100644
--- a/drivers/i2c/busses/i2c-i801.c
+++ b/drivers/i2c/busses/i2c-i801.c
@@ -88,6 +88,8 @@
* See the file Documentation/i2c/busses/i2c-i801.rst for details.
*/
+#define DRV_NAME "i801_smbus"
+
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/pci.h>
@@ -1813,8 +1815,7 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
if (i801_acpi_probe(priv))
return -ENODEV;
- err = pcim_iomap_regions(dev, 1 << SMBBAR,
- dev_driver_string(&dev->dev));
+ err = pcim_iomap_regions(dev, 1 << SMBBAR, DRV_NAME);
if (err) {
dev_err(&dev->dev,
"Failed to request SMBus region 0x%lx-0x%Lx\n",
@@ -1872,8 +1873,7 @@ static int i801_probe(struct pci_dev *dev, const struct pci_device_id *id)
init_completion(&priv->done);
err = devm_request_irq(&dev->dev, dev->irq, i801_isr,
- IRQF_SHARED,
- dev_driver_string(&dev->dev), priv);
+ IRQF_SHARED, DRV_NAME, priv);
if (err) {
dev_err(&dev->dev, "Failed to allocate irq %d: %d\n",
dev->irq, err);
@@ -1963,7 +1963,7 @@ static int i801_resume(struct device *dev)
static SIMPLE_DEV_PM_OPS(i801_pm_ops, i801_suspend, i801_resume);
static struct pci_driver i801_driver = {
- .name = "i801_smbus",
+ .name = DRV_NAME,
.id_table = i801_ids,
.probe = i801_probe,
.remove = i801_remove,
--
2.31.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: i801: Use driver name constant instead of function dev_driver_string
2021-05-25 20:04 [PATCH] i2c: i801: Use driver name constant instead of function dev_driver_string Heiner Kallweit
@ 2021-06-14 16:27 ` Jean Delvare
2021-06-20 20:55 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Jean Delvare @ 2021-06-14 16:27 UTC (permalink / raw)
To: Heiner Kallweit; +Cc: linux-i2c
On Tue, 25 May 2021 22:04:23 +0200, Heiner Kallweit wrote:
> We are the driver, so we can use the driver name directly instead of
> retrieving it by calling dev_driver_string().
Makes sense. Should make the code slightly faster.
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
> drivers/i2c/busses/i2c-i801.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
> (...)
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Tested-by: Jean Delvare <jdelvare@suse.de>
--
Jean Delvare
SUSE L3 Support
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] i2c: i801: Use driver name constant instead of function dev_driver_string
2021-05-25 20:04 [PATCH] i2c: i801: Use driver name constant instead of function dev_driver_string Heiner Kallweit
2021-06-14 16:27 ` Jean Delvare
@ 2021-06-20 20:55 ` Wolfram Sang
1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2021-06-20 20:55 UTC (permalink / raw)
To: Heiner Kallweit; +Cc: Jean Delvare, linux-i2c
[-- Attachment #1: Type: text/plain, Size: 282 bytes --]
On Tue, May 25, 2021 at 10:04:23PM +0200, Heiner Kallweit wrote:
> We are the driver, so we can use the driver name directly instead of
> retrieving it by calling dev_driver_string().
>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Applied to for-next, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-20 20:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25 20:04 [PATCH] i2c: i801: Use driver name constant instead of function dev_driver_string Heiner Kallweit
2021-06-14 16:27 ` Jean Delvare
2021-06-20 20:55 ` Wolfram Sang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.