linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/9] can: remove litteral strings used for driver name and remove DRV_VERSION
@ 2022-07-25 15:31 Vincent Mailhol
  2022-07-25 15:31 ` [PATCH 1/9] can: can327: use KBUILD_MODNAME instead of hard coded name Vincent Mailhol
                   ` (9 more replies)
  0 siblings, 10 replies; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-25 15:31 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde; +Cc: Dario Binacchi, Max Staudt, Vincent Mailhol

This is a cleanup series.

The patches 1 to 8 get rid of any hardcoded strings and instead relies
on either KBUILD_MODNAME or DRV_NAME macros to get the device
name. Patch 9 removes the DRV_VERSION macro from etas_es58x driver so
that the module uses the default behavior and advertise the kernel
version instead of a custom version.

* Changelog *

This series are the first 9 patches of:
https://lore.kernel.org/linux-can/20220725133208.432176-1-mailhol.vincent@wanadoo.fr/T/

The initial intent of those 9 patches was to do so cleanup in order to
implement ethtool_ops::get_drvinfo but this appeared to be useless:
https://lore.kernel.org/linux-can/20220725140911.2djwxfrx3kdmjeuc@pengutronix.de/

Instead, those patch are send as a standalone series

Vincent Mailhol (9):
  can: can327: use KBUILD_MODNAME instead of hard coded name
  can: ems_ubs: use KBUILD_MODNAME instead of hard coded name
  can: slcan: add DRV_NAME and define pr_fmt to replace hardcoded names
  can: softing: add DRV_NAME to replace hardcoded names
  can: esd_usb: use KBUILD_MODNAME instead of hard coded name
  can: gs_ubs: use KBUILD_MODNAME instead of hard coded name
  can: softing: add DRV_NAME to replace hardcoded names
  can: ubs_8dev: use KBUILD_MODNAME instead of hard coded name
  can: etas_es58x: remove DRV_VERSION

 drivers/net/can/can327.c                         |  4 ++--
 drivers/net/can/slcan/slcan-core.c               | 15 +++++++++------
 drivers/net/can/softing/softing_main.c           |  5 +++--
 drivers/net/can/usb/ems_usb.c                    |  4 ++--
 drivers/net/can/usb/esd_usb.c                    |  2 +-
 drivers/net/can/usb/etas_es58x/es58x_core.c      |  7 ++-----
 drivers/net/can/usb/gs_usb.c                     |  6 +++---
 drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c |  4 +++-
 drivers/net/can/usb/usb_8dev.c                   |  4 ++--
 9 files changed, 27 insertions(+), 24 deletions(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH 1/9]  can: can327: use KBUILD_MODNAME instead of hard coded name
  2022-07-25 15:31 [PATCH 0/9] can: remove litteral strings used for driver name and remove DRV_VERSION Vincent Mailhol
@ 2022-07-25 15:31 ` Vincent Mailhol
  2022-07-25 15:31 ` [PATCH 2/9] can: ems_ubs: " Vincent Mailhol
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-25 15:31 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde; +Cc: Dario Binacchi, Max Staudt, Vincent Mailhol

The driver uses the string "can327" to populate
tty_ldisc_ops::name. KBUILD_MODNAME also evaluates to "can327". Use
KBUILD_MODNAME and get rid on the hardcoded string names.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/can327.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/can327.c b/drivers/net/can/can327.c
index 5da7778d92dc..bf0cce2dbb40 100644
--- a/drivers/net/can/can327.c
+++ b/drivers/net/can/can327.c
@@ -10,7 +10,7 @@
  *                   Fred N. van Kempen <waltje@uwalt.nl.mugnet.org>
  */
 
-#define pr_fmt(fmt) "can327: " fmt
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/init.h>
 #include <linux/module.h>
@@ -1100,7 +1100,7 @@ static int can327_ldisc_ioctl(struct tty_struct *tty, unsigned int cmd,
 
 static struct tty_ldisc_ops can327_ldisc = {
 	.owner = THIS_MODULE,
-	.name = "can327",
+	.name = KBUILD_MODNAME,
 	.num = N_CAN327,
 	.receive_buf = can327_ldisc_rx,
 	.write_wakeup = can327_ldisc_tx_wakeup,
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 2/9] can: ems_ubs: use KBUILD_MODNAME instead of hard coded name
  2022-07-25 15:31 [PATCH 0/9] can: remove litteral strings used for driver name and remove DRV_VERSION Vincent Mailhol
  2022-07-25 15:31 ` [PATCH 1/9] can: can327: use KBUILD_MODNAME instead of hard coded name Vincent Mailhol
@ 2022-07-25 15:31 ` Vincent Mailhol
  2022-07-25 17:34   ` Marc Kleine-Budde
  2022-07-25 15:31 ` [PATCH 3/9] can: slcan: add DRV_NAME and define pr_fmt to replace hardcoded names Vincent Mailhol
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-25 15:31 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde; +Cc: Dario Binacchi, Max Staudt, Vincent Mailhol

The driver uses the string "ems_usb" to populate usb_driver::name and
can_bittiming_const::name. KBUILD_MODNAME also evaluates to
"ems_ubs". Use KBUILD_MODNAME and get rid on the hardcoded string
names.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/usb/ems_usb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
index bbec3311d893..89a64e05cbd7 100644
--- a/drivers/net/can/usb/ems_usb.c
+++ b/drivers/net/can/usb/ems_usb.c
@@ -880,7 +880,7 @@ static const struct net_device_ops ems_usb_netdev_ops = {
 };
 
 static const struct can_bittiming_const ems_usb_bittiming_const = {
-	.name = "ems_usb",
+	.name = KBUILD_NAME,
 	.tseg1_min = 1,
 	.tseg1_max = 16,
 	.tseg2_min = 1,
@@ -1074,7 +1074,7 @@ static void ems_usb_disconnect(struct usb_interface *intf)
 
 /* usb specific object needed to register this driver with the usb subsystem */
 static struct usb_driver ems_usb_driver = {
-	.name = "ems_usb",
+	.name = KBUILD_NAME,
 	.probe = ems_usb_probe,
 	.disconnect = ems_usb_disconnect,
 	.id_table = ems_usb_table,
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 3/9] can: slcan: add DRV_NAME and define pr_fmt to replace hardcoded names
  2022-07-25 15:31 [PATCH 0/9] can: remove litteral strings used for driver name and remove DRV_VERSION Vincent Mailhol
  2022-07-25 15:31 ` [PATCH 1/9] can: can327: use KBUILD_MODNAME instead of hard coded name Vincent Mailhol
  2022-07-25 15:31 ` [PATCH 2/9] can: ems_ubs: " Vincent Mailhol
@ 2022-07-25 15:31 ` Vincent Mailhol
  2022-07-25 15:31 ` [PATCH 4/9] can: softing: add DRV_NAME " Vincent Mailhol
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-25 15:31 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde; +Cc: Dario Binacchi, Max Staudt, Vincent Mailhol

The driver uses the string "slcan" to populate
tty_ldisc_ops::name. Add a new macro DRV_NAME which evaluates to
"slcan" and then use DRV_NAME and to get rid on the hardcoded string
names.

Similarly, the pr_info() and pr_err() hardcoded the "slcan"
prefix. Define pr_fmt so that the "slcan" prefix gets automatically
added.

CC: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---

@Dario, because you are also doing a lot of changes on slcan, our
patches might conflict. Do not hesitate to take this one and add it to
your series to simplify the merge.
---
 drivers/net/can/slcan/slcan-core.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/net/can/slcan/slcan-core.c b/drivers/net/can/slcan/slcan-core.c
index dc28e715bbe1..d1562f9474c9 100644
--- a/drivers/net/can/slcan/slcan-core.c
+++ b/drivers/net/can/slcan/slcan-core.c
@@ -35,6 +35,9 @@
  *
  */
 
+#define DRV_NAME "slcan"
+#define pr_fmt(fmt) DRV_NAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 
@@ -864,7 +867,7 @@ static struct slcan *slc_alloc(void)
 	if (!dev)
 		return NULL;
 
-	snprintf(dev->name, sizeof(dev->name), "slcan%d", i);
+	snprintf(dev->name, sizeof(dev->name), DRV_NAME "%d", i);
 	dev->netdev_ops = &slc_netdev_ops;
 	dev->base_addr  = i;
 	slcan_set_ethtool_ops(dev);
@@ -937,7 +940,7 @@ static int slcan_open(struct tty_struct *tty)
 		rtnl_unlock();
 		err = register_candev(sl->dev);
 		if (err) {
-			pr_err("slcan: can't register candev\n");
+			pr_err("can't register candev\n");
 			goto err_free_chan;
 		}
 	} else {
@@ -1028,7 +1031,7 @@ static int slcan_ioctl(struct tty_struct *tty, unsigned int cmd,
 static struct tty_ldisc_ops slc_ldisc = {
 	.owner		= THIS_MODULE,
 	.num		= N_SLCAN,
-	.name		= "slcan",
+	.name		= DRV_NAME,
 	.open		= slcan_open,
 	.close		= slcan_close,
 	.hangup		= slcan_hangup,
@@ -1044,8 +1047,8 @@ static int __init slcan_init(void)
 	if (maxdev < 4)
 		maxdev = 4; /* Sanity */
 
-	pr_info("slcan: serial line CAN interface driver\n");
-	pr_info("slcan: %d dynamic interface channels.\n", maxdev);
+	pr_info("serial line CAN interface driver\n");
+	pr_info("%d dynamic interface channels.\n", maxdev);
 
 	slcan_devs = kcalloc(maxdev, sizeof(struct net_device *), GFP_KERNEL);
 	if (!slcan_devs)
@@ -1054,7 +1057,7 @@ static int __init slcan_init(void)
 	/* Fill in our line protocol discipline, and register it */
 	status = tty_register_ldisc(&slc_ldisc);
 	if (status)  {
-		pr_err("slcan: can't register line discipline\n");
+		pr_err("can't register line discipline\n");
 		kfree(slcan_devs);
 	}
 	return status;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 4/9] can: softing: add DRV_NAME to replace hardcoded names
  2022-07-25 15:31 [PATCH 0/9] can: remove litteral strings used for driver name and remove DRV_VERSION Vincent Mailhol
                   ` (2 preceding siblings ...)
  2022-07-25 15:31 ` [PATCH 3/9] can: slcan: add DRV_NAME and define pr_fmt to replace hardcoded names Vincent Mailhol
@ 2022-07-25 15:31 ` Vincent Mailhol
  2022-07-25 20:53   ` Marc Kleine-Budde
  2022-07-25 15:31 ` [PATCH 5/9] can: esd_usb: use KBUILD_MODNAME instead of hard coded name Vincent Mailhol
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-25 15:31 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde; +Cc: Dario Binacchi, Max Staudt, Vincent Mailhol

The driver uses the string "softing" to populate platform_driver::name
and can_bittiming_const::name. Add a new macro DRV_NAME which
evaluates to "ems_ubs" and then use DRV_NAME and to get rid on the
hardcoded string names.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/softing/softing_main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c
index 8d27ac66ca7f..d810fe6915a4 100644
--- a/drivers/net/can/softing/softing_main.c
+++ b/drivers/net/can/softing/softing_main.c
@@ -11,6 +11,7 @@
 
 #include "softing.h"
 
+#define DRV_NAME "softing"
 #define TX_ECHO_SKB_MAX (((TXMAX+1)/2)-1)
 
 /*
@@ -612,7 +613,7 @@ static const struct net_device_ops softing_netdev_ops = {
 };
 
 static const struct can_bittiming_const softing_btr_const = {
-	.name = "softing",
+	.name = DRV_NAME,
 	.tseg1_min = 1,
 	.tseg1_max = 16,
 	.tseg2_min = 1,
@@ -846,7 +847,7 @@ static int softing_pdev_probe(struct platform_device *pdev)
 
 static struct platform_driver softing_driver = {
 	.driver = {
-		.name = "softing",
+		.name = DRV_NAME,
 	},
 	.probe = softing_pdev_probe,
 	.remove = softing_pdev_remove,
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 5/9] can: esd_usb: use KBUILD_MODNAME instead of hard coded name
  2022-07-25 15:31 [PATCH 0/9] can: remove litteral strings used for driver name and remove DRV_VERSION Vincent Mailhol
                   ` (3 preceding siblings ...)
  2022-07-25 15:31 ` [PATCH 4/9] can: softing: add DRV_NAME " Vincent Mailhol
@ 2022-07-25 15:31 ` Vincent Mailhol
  2022-07-25 20:46   ` Marc Kleine-Budde
  2022-07-25 15:31 ` [PATCH 6/9] can: gs_ubs: " Vincent Mailhol
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-25 15:31 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde
  Cc: Dario Binacchi, Max Staudt, Vincent Mailhol, Frank Jungclaus

The driver uses the string "ems_usb" to populate
usb_driver::name. KBUILD_MODNAME also evaluates to "esd_ubs". Use
KBUILD_MODNAME and get rid on the hardcoded string names.

CC: Frank Jungclaus <frank.jungclaus@esd.eu>
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/usb/ems_usb.c | 4 ++--
 drivers/net/can/usb/esd_usb.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
index 89a64e05cbd7..e86a2033db60 100644
--- a/drivers/net/can/usb/ems_usb.c
+++ b/drivers/net/can/usb/ems_usb.c
@@ -880,7 +880,7 @@ static const struct net_device_ops ems_usb_netdev_ops = {
 };
 
 static const struct can_bittiming_const ems_usb_bittiming_const = {
-	.name = KBUILD_NAME,
+	.name = KBUILD_MODNAME,
 	.tseg1_min = 1,
 	.tseg1_max = 16,
 	.tseg2_min = 1,
@@ -1074,7 +1074,7 @@ static void ems_usb_disconnect(struct usb_interface *intf)
 
 /* usb specific object needed to register this driver with the usb subsystem */
 static struct usb_driver ems_usb_driver = {
-	.name = KBUILD_NAME,
+	.name = KBUILD_MODNAME,
 	.probe = ems_usb_probe,
 	.disconnect = ems_usb_disconnect,
 	.id_table = ems_usb_table,
diff --git a/drivers/net/can/usb/esd_usb.c b/drivers/net/can/usb/esd_usb.c
index 177ed33e08d9..7b849bd3cc9c 100644
--- a/drivers/net/can/usb/esd_usb.c
+++ b/drivers/net/can/usb/esd_usb.c
@@ -1138,7 +1138,7 @@ static void esd_usb_disconnect(struct usb_interface *intf)
 
 /* usb specific object needed to register this driver with the usb subsystem */
 static struct usb_driver esd_usb_driver = {
-	.name = "esd_usb",
+	.name = KBUILD_MODNAME,
 	.probe = esd_usb_probe,
 	.disconnect = esd_usb_disconnect,
 	.id_table = esd_usb_table,
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 6/9] can: gs_ubs: use KBUILD_MODNAME instead of hard coded name
  2022-07-25 15:31 [PATCH 0/9] can: remove litteral strings used for driver name and remove DRV_VERSION Vincent Mailhol
                   ` (4 preceding siblings ...)
  2022-07-25 15:31 ` [PATCH 5/9] can: esd_usb: use KBUILD_MODNAME instead of hard coded name Vincent Mailhol
@ 2022-07-25 15:31 ` Vincent Mailhol
  2022-07-25 15:31 ` [PATCH 7/9] can: softing: add DRV_NAME to replace hardcoded names Vincent Mailhol
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-25 15:31 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde; +Cc: Dario Binacchi, Max Staudt, Vincent Mailhol

The driver uses the string "gs_usb" to populate usb_driver::name,
can_bittiming_const::name and
can_data_bittiming_const::name. KBUILD_MODNAME evaluates to
"gs_ubs". Use KBUILD_MODNAME and get rid on the hardcoded string
names.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/usb/gs_usb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c
index d3a658b444b5..fd239b523c42 100644
--- a/drivers/net/can/usb/gs_usb.c
+++ b/drivers/net/can/usb/gs_usb.c
@@ -993,7 +993,7 @@ static struct gs_can *gs_make_candev(unsigned int channel,
 	netdev->flags |= IFF_ECHO; /* we support full roundtrip echo */
 
 	/* dev setup */
-	strcpy(dev->bt_const.name, "gs_usb");
+	strcpy(dev->bt_const.name, KBUILD_MODNAME);
 	dev->bt_const.tseg1_min = le32_to_cpu(bt_const->tseg1_min);
 	dev->bt_const.tseg1_max = le32_to_cpu(bt_const->tseg1_max);
 	dev->bt_const.tseg2_min = le32_to_cpu(bt_const->tseg2_min);
@@ -1100,7 +1100,7 @@ static struct gs_can *gs_make_candev(unsigned int channel,
 			return ERR_PTR(rc);
 		}
 
-		strcpy(dev->data_bt_const.name, "gs_usb");
+		strcpy(dev->data_bt_const.name, KBUILD_MODNAME);
 		dev->data_bt_const.tseg1_min = le32_to_cpu(bt_const_extended->dtseg1_min);
 		dev->data_bt_const.tseg1_max = le32_to_cpu(bt_const_extended->dtseg1_max);
 		dev->data_bt_const.tseg2_min = le32_to_cpu(bt_const_extended->dtseg2_min);
@@ -1270,7 +1270,7 @@ static const struct usb_device_id gs_usb_table[] = {
 MODULE_DEVICE_TABLE(usb, gs_usb_table);
 
 static struct usb_driver gs_usb_driver = {
-	.name = "gs_usb",
+	.name = KBUILD_MODNAME,
 	.probe = gs_usb_probe,
 	.disconnect = gs_usb_disconnect,
 	.id_table = gs_usb_table,
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 7/9] can: softing: add DRV_NAME to replace hardcoded names
  2022-07-25 15:31 [PATCH 0/9] can: remove litteral strings used for driver name and remove DRV_VERSION Vincent Mailhol
                   ` (5 preceding siblings ...)
  2022-07-25 15:31 ` [PATCH 6/9] can: gs_ubs: " Vincent Mailhol
@ 2022-07-25 15:31 ` Vincent Mailhol
  2022-07-25 20:50   ` Marc Kleine-Budde
  2022-07-25 15:31 ` [PATCH 8/9] can: ubs_8dev: use KBUILD_MODNAME instead of hard coded name Vincent Mailhol
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-25 15:31 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde; +Cc: Dario Binacchi, Max Staudt, Vincent Mailhol

The driver uses the string "kvaser_usb" to populate
usb_driver::name. Add a new macro DRV_NAME which evaluates to
"ems_ubs" and then use DRV_NAME and to get rid on the hardcoded string
names.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c
index f211bfcb1d97..a6cff8da5a41 100644
--- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c
+++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c
@@ -29,6 +29,8 @@
 
 #include "kvaser_usb.h"
 
+#define DRV_NAME "kvaser_usb"
+
 /* Kvaser USB vendor id. */
 #define KVASER_VENDOR_ID			0x0bfd
 
@@ -869,7 +871,7 @@ static void kvaser_usb_disconnect(struct usb_interface *intf)
 }
 
 static struct usb_driver kvaser_usb_driver = {
-	.name = "kvaser_usb",
+	.name = DRV_NAME,
 	.probe = kvaser_usb_probe,
 	.disconnect = kvaser_usb_disconnect,
 	.id_table = kvaser_usb_table,
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 8/9] can: ubs_8dev: use KBUILD_MODNAME instead of hard coded name
  2022-07-25 15:31 [PATCH 0/9] can: remove litteral strings used for driver name and remove DRV_VERSION Vincent Mailhol
                   ` (6 preceding siblings ...)
  2022-07-25 15:31 ` [PATCH 7/9] can: softing: add DRV_NAME to replace hardcoded names Vincent Mailhol
@ 2022-07-25 15:31 ` Vincent Mailhol
  2022-07-25 15:31 ` [PATCH 9/9] can: etas_es58x: remove DRV_VERSION Vincent Mailhol
  2022-07-26  8:26 ` [PATCH v2 00/10] can: remove litteral strings used for driver names and " Vincent Mailhol
  9 siblings, 0 replies; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-25 15:31 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde; +Cc: Dario Binacchi, Max Staudt, Vincent Mailhol

The driver uses the string "usb_8dev" to populate usb_driver::name and
can_bittiming_const::name. KBUILD_MODNAME also evaluates to
"ubs_8dev". Use KBUILD_MODNAME and get rid on the hardcoded string
names.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/usb/usb_8dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/usb/usb_8dev.c b/drivers/net/can/usb/usb_8dev.c
index 8b7cd69e20b0..6665a66745a7 100644
--- a/drivers/net/can/usb/usb_8dev.c
+++ b/drivers/net/can/usb/usb_8dev.c
@@ -871,7 +871,7 @@ static const struct net_device_ops usb_8dev_netdev_ops = {
 };
 
 static const struct can_bittiming_const usb_8dev_bittiming_const = {
-	.name = "usb_8dev",
+	.name = KBUILD_MODNAME,
 	.tseg1_min = 1,
 	.tseg1_max = 16,
 	.tseg2_min = 1,
@@ -997,7 +997,7 @@ static void usb_8dev_disconnect(struct usb_interface *intf)
 }
 
 static struct usb_driver usb_8dev_driver = {
-	.name =		"usb_8dev",
+	.name =		KBUILD_MODNAME,
 	.probe =	usb_8dev_probe,
 	.disconnect =	usb_8dev_disconnect,
 	.id_table =	usb_8dev_table,
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH 9/9] can: etas_es58x: remove DRV_VERSION
  2022-07-25 15:31 [PATCH 0/9] can: remove litteral strings used for driver name and remove DRV_VERSION Vincent Mailhol
                   ` (7 preceding siblings ...)
  2022-07-25 15:31 ` [PATCH 8/9] can: ubs_8dev: use KBUILD_MODNAME instead of hard coded name Vincent Mailhol
@ 2022-07-25 15:31 ` Vincent Mailhol
  2022-07-26  8:26 ` [PATCH v2 00/10] can: remove litteral strings used for driver names and " Vincent Mailhol
  9 siblings, 0 replies; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-25 15:31 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde; +Cc: Dario Binacchi, Max Staudt, Vincent Mailhol

DRV_VERSION is a leftover from when the driver was an out of tree
module. The driver version was never incremented despite of the
numerous changes made since it was mainstreamed. Keeping an
unmaintained driver version number makes no sense. Remove it and rely
on the kernel version instead.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/usb/etas_es58x/es58x_core.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/can/usb/etas_es58x/es58x_core.c b/drivers/net/can/usb/etas_es58x/es58x_core.c
index 7353745f92d7..3f51488bd649 100644
--- a/drivers/net/can/usb/etas_es58x/es58x_core.c
+++ b/drivers/net/can/usb/etas_es58x/es58x_core.c
@@ -18,11 +18,9 @@
 
 #include "es58x_core.h"
 
-#define DRV_VERSION "1.00"
 MODULE_AUTHOR("Vincent Mailhol <mailhol.vincent@wanadoo.fr>");
 MODULE_AUTHOR("Arunachalam Santhanam <arunachalam.santhanam@in.bosch.com>");
 MODULE_DESCRIPTION("Socket CAN driver for ETAS ES58X USB adapters");
-MODULE_VERSION(DRV_VERSION);
 MODULE_LICENSE("GPL v2");
 
 #define ES58X_MODULE_NAME "etas_es58x"
@@ -2181,9 +2179,8 @@ static struct es58x_device *es58x_init_es58x_dev(struct usb_interface *intf,
 	struct usb_endpoint_descriptor *ep_in, *ep_out;
 	int ret;
 
-	dev_info(dev,
-		 "Starting %s %s (Serial Number %s) driver version %s\n",
-		 udev->manufacturer, udev->product, udev->serial, DRV_VERSION);
+	dev_info(dev, "Starting %s %s (Serial Number %s)\n",
+		 udev->manufacturer, udev->product, udev->serial);
 
 	ret = usb_find_common_endpoints(intf->cur_altsetting, &ep_in, &ep_out,
 					NULL, NULL);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* Re: [PATCH 2/9] can: ems_ubs: use KBUILD_MODNAME instead of hard coded name
  2022-07-25 15:31 ` [PATCH 2/9] can: ems_ubs: " Vincent Mailhol
@ 2022-07-25 17:34   ` Marc Kleine-Budde
  0 siblings, 0 replies; 32+ messages in thread
From: Marc Kleine-Budde @ 2022-07-25 17:34 UTC (permalink / raw)
  To: Vincent Mailhol; +Cc: linux-can, Dario Binacchi, Max Staudt

[-- Attachment #1: Type: text/plain, Size: 1628 bytes --]

On 26.07.2022 00:31:17, Vincent Mailhol wrote:
> The driver uses the string "ems_usb" to populate usb_driver::name and
> can_bittiming_const::name. KBUILD_MODNAME also evaluates to
> "ems_ubs". Use KBUILD_MODNAME and get rid on the hardcoded string
> names.
> 
> Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
> ---
>  drivers/net/can/usb/ems_usb.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
> index bbec3311d893..89a64e05cbd7 100644
> --- a/drivers/net/can/usb/ems_usb.c
> +++ b/drivers/net/can/usb/ems_usb.c
> @@ -880,7 +880,7 @@ static const struct net_device_ops ems_usb_netdev_ops = {
>  };
>  
>  static const struct can_bittiming_const ems_usb_bittiming_const = {
> -	.name = "ems_usb",
> +	.name = KBUILD_NAME,
                      MOD
>  	.tseg1_min = 1,
>  	.tseg1_max = 16,
>  	.tseg2_min = 1,
> @@ -1074,7 +1074,7 @@ static void ems_usb_disconnect(struct usb_interface *intf)
>  
>  /* usb specific object needed to register this driver with the usb subsystem */
>  static struct usb_driver ems_usb_driver = {
> -	.name = "ems_usb",
> +	.name = KBUILD_NAME,
                      MOD
>  	.probe = ems_usb_probe,
>  	.disconnect = ems_usb_disconnect,
>  	.id_table = ems_usb_table,

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 5/9] can: esd_usb: use KBUILD_MODNAME instead of hard coded name
  2022-07-25 15:31 ` [PATCH 5/9] can: esd_usb: use KBUILD_MODNAME instead of hard coded name Vincent Mailhol
@ 2022-07-25 20:46   ` Marc Kleine-Budde
  0 siblings, 0 replies; 32+ messages in thread
From: Marc Kleine-Budde @ 2022-07-25 20:46 UTC (permalink / raw)
  To: Vincent Mailhol; +Cc: linux-can, Dario Binacchi, Max Staudt, Frank Jungclaus

[-- Attachment #1: Type: text/plain, Size: 2272 bytes --]

On 26.07.2022 00:31:20, Vincent Mailhol wrote:
> The driver uses the string "ems_usb" to populate
> usb_driver::name. KBUILD_MODNAME also evaluates to "esd_ubs". Use
> KBUILD_MODNAME and get rid on the hardcoded string names.
> 
> CC: Frank Jungclaus <frank.jungclaus@esd.eu>
> Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
> ---
>  drivers/net/can/usb/ems_usb.c | 4 ++--
>  drivers/net/can/usb/esd_usb.c | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
> index 89a64e05cbd7..e86a2033db60 100644
> --- a/drivers/net/can/usb/ems_usb.c
> +++ b/drivers/net/can/usb/ems_usb.c
> @@ -880,7 +880,7 @@ static const struct net_device_ops ems_usb_netdev_ops = {
>  };
>  
>  static const struct can_bittiming_const ems_usb_bittiming_const = {
> -	.name = KBUILD_NAME,
> +	.name = KBUILD_MODNAME,
>  	.tseg1_min = 1,
>  	.tseg1_max = 16,
>  	.tseg2_min = 1,
> @@ -1074,7 +1074,7 @@ static void ems_usb_disconnect(struct usb_interface *intf)
>  
>  /* usb specific object needed to register this driver with the usb subsystem */
>  static struct usb_driver ems_usb_driver = {
> -	.name = KBUILD_NAME,
> +	.name = KBUILD_MODNAME,

These 2 hunks should go into patch 2.

Marc

>  	.probe = ems_usb_probe,
>  	.disconnect = ems_usb_disconnect,
>  	.id_table = ems_usb_table,
> diff --git a/drivers/net/can/usb/esd_usb.c b/drivers/net/can/usb/esd_usb.c
> index 177ed33e08d9..7b849bd3cc9c 100644
> --- a/drivers/net/can/usb/esd_usb.c
> +++ b/drivers/net/can/usb/esd_usb.c
> @@ -1138,7 +1138,7 @@ static void esd_usb_disconnect(struct usb_interface *intf)
>  
>  /* usb specific object needed to register this driver with the usb subsystem */
>  static struct usb_driver esd_usb_driver = {
> -	.name = "esd_usb",
> +	.name = KBUILD_MODNAME,
>  	.probe = esd_usb_probe,
>  	.disconnect = esd_usb_disconnect,
>  	.id_table = esd_usb_table,
> -- 
> 2.35.1
> 
> 

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 7/9] can: softing: add DRV_NAME to replace hardcoded names
  2022-07-25 15:31 ` [PATCH 7/9] can: softing: add DRV_NAME to replace hardcoded names Vincent Mailhol
@ 2022-07-25 20:50   ` Marc Kleine-Budde
  0 siblings, 0 replies; 32+ messages in thread
From: Marc Kleine-Budde @ 2022-07-25 20:50 UTC (permalink / raw)
  To: Vincent Mailhol; +Cc: linux-can, Dario Binacchi, Max Staudt

[-- Attachment #1: Type: text/plain, Size: 1878 bytes --]

On 26.07.2022 00:31:22, Vincent Mailhol wrote:
> The driver uses the string "kvaser_usb" to populate
> usb_driver::name. Add a new macro DRV_NAME which evaluates to
> "ems_ubs" and then use DRV_NAME and to get rid on the hardcoded string
> names.
> 
> Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
> ---
>  drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c
> index f211bfcb1d97..a6cff8da5a41 100644
> --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c
> +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c
> @@ -29,6 +29,8 @@
>  
>  #include "kvaser_usb.h"
>  
> +#define DRV_NAME "kvaser_usb"
> +
>  /* Kvaser USB vendor id. */
>  #define KVASER_VENDOR_ID			0x0bfd
>  
> @@ -869,7 +871,7 @@ static void kvaser_usb_disconnect(struct usb_interface *intf)
>  }
>  
>  static struct usb_driver kvaser_usb_driver = {
> -	.name = "kvaser_usb",
> +	.name = DRV_NAME,
>  	.probe = kvaser_usb_probe,
>  	.disconnect = kvaser_usb_disconnect,
>  	.id_table = kvaser_usb_table,

KBUILD_MODNAME works here, too. I just checked with:

| make drivers/net/can/usb/kvaser_usb/kvaser_usb_core.i
| grep -A5 "struct usb_driver kvaser_usb_driver" drivers/net/can/usb/kvaser_usb/kvaser_usb_core.i
| static struct usb_driver kvaser_usb_driver = {
|  .name = "kvaser_usb",
|  .probe = kvaser_usb_probe,
|  .disconnect = kvaser_usb_disconnect,
|  .id_table = kvaser_usb_table,
| };

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH 4/9] can: softing: add DRV_NAME to replace hardcoded names
  2022-07-25 15:31 ` [PATCH 4/9] can: softing: add DRV_NAME " Vincent Mailhol
@ 2022-07-25 20:53   ` Marc Kleine-Budde
  0 siblings, 0 replies; 32+ messages in thread
From: Marc Kleine-Budde @ 2022-07-25 20:53 UTC (permalink / raw)
  To: Vincent Mailhol; +Cc: linux-can, Dario Binacchi, Max Staudt

[-- Attachment #1: Type: text/plain, Size: 1757 bytes --]

On 26.07.2022 00:31:19, Vincent Mailhol wrote:
> The driver uses the string "softing" to populate platform_driver::name
> and can_bittiming_const::name. Add a new macro DRV_NAME which
> evaluates to "ems_ubs" and then use DRV_NAME and to get rid on the
> hardcoded string names.
> 
> Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
> ---
>  drivers/net/can/softing/softing_main.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c
> index 8d27ac66ca7f..d810fe6915a4 100644
> --- a/drivers/net/can/softing/softing_main.c
> +++ b/drivers/net/can/softing/softing_main.c
> @@ -11,6 +11,7 @@
>  
>  #include "softing.h"
>  
> +#define DRV_NAME "softing"
>  #define TX_ECHO_SKB_MAX (((TXMAX+1)/2)-1)
>  
>  /*
> @@ -612,7 +613,7 @@ static const struct net_device_ops softing_netdev_ops = {
>  };
>  
>  static const struct can_bittiming_const softing_btr_const = {
> -	.name = "softing",
> +	.name = DRV_NAME,

KBUILD_MODNAME works here, too.

>  	.tseg1_min = 1,
>  	.tseg1_max = 16,
>  	.tseg2_min = 1,
> @@ -846,7 +847,7 @@ static int softing_pdev_probe(struct platform_device *pdev)
>  
>  static struct platform_driver softing_driver = {
>  	.driver = {
> -		.name = "softing",
> +		.name = DRV_NAME,

same here

>  	},
>  	.probe = softing_pdev_probe,
>  	.remove = softing_pdev_remove,
> -- 
> 2.35.1
> 
>

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH v2 00/10] can: remove litteral strings used for driver names and remove DRV_VERSION
  2022-07-25 15:31 [PATCH 0/9] can: remove litteral strings used for driver name and remove DRV_VERSION Vincent Mailhol
                   ` (8 preceding siblings ...)
  2022-07-25 15:31 ` [PATCH 9/9] can: etas_es58x: remove DRV_VERSION Vincent Mailhol
@ 2022-07-26  8:26 ` Vincent Mailhol
  2022-07-26  8:26   ` [PATCH v2 01/10] can: can327: use KBUILD_MODNAME instead of hard coded names Vincent Mailhol
                     ` (11 more replies)
  9 siblings, 12 replies; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-26  8:26 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde; +Cc: Dario Binacchi, Max Staudt, Vincent Mailhol

This is a cleanup series.

The patches 1 to 8 get rid of any hardcoded strings and instead relies
on the KBUILD_MODNAME macros to get the device name. Patch 9 replaces
the ES58X_MODULE_NAME macro with KBUILD_MODNAME in
etas_es58x. Finally, also in etas_es58x, patch 10 removes the
DRV_VERSION so that the module uses the default behavior and advertise
the kernel version instead of a custom version.


* Changelog *

v1 -> v2:

  * The patch for esd_usb contained some changes for ems_usb.

  * v1 assumed that KBUILD_MODNAME could only be used when the file
    basename and the module had the same name (e.g. vcan.c for the
    vcan.ko). The fact is that KBUILD_NAME extends to the module name
    and can thus be used even if the basename is different
    (e.g. slcan-core.c and slcan.ko)

  * Add patch #9: can: etas_es58x: replace ES58X_MODULE_NAME with
    KBUILD_MODNAME

v1:

This series are the first 9 patches of:
https://lore.kernel.org/linux-can/20220725133208.432176-1-mailhol.vincent@wanadoo.fr/T/

The initial intent of those 9 patches was to do so cleanup in order to
implement ethtool_ops::get_drvinfo but this appeared to be useless:
https://lore.kernel.org/linux-can/20220725140911.2djwxfrx3kdmjeuc@pengutronix.de/

Instead, those patch are send as a standalone series


Vincent Mailhol (10):
  can: can327: use KBUILD_MODNAME instead of hard coded names
  can: ems_usb: use KBUILD_MODNAME instead of hard coded names
  can: slcan: use KBUILD_MODNAME and define pr_fmt to replace hardcoded
    names
  can: softing: use KBUILD_MODNAME instead of hard coded names
  can: esd_usb: use KBUILD_MODNAME instead of hard coded names
  can: gs_ubs: use KBUILD_MODNAME instead of hard coded names
  can: kvaser_usb: use KBUILD_MODNAME instead of hard coded names
  can: ubs_8dev: use KBUILD_MODNAME instead of hard coded names
  can: etas_es58x: replace ES58X_MODULE_NAME with KBUILD_MODNAME
  can: etas_es58x: remove DRV_VERSION

 drivers/net/can/can327.c                         |  4 ++--
 drivers/net/can/slcan/slcan-core.c               | 14 ++++++++------
 drivers/net/can/softing/softing_main.c           |  4 ++--
 drivers/net/can/usb/ems_usb.c                    |  4 ++--
 drivers/net/can/usb/esd_usb.c                    |  2 +-
 drivers/net/can/usb/etas_es58x/es58x_core.c      | 14 +++++---------
 drivers/net/can/usb/gs_usb.c                     |  6 +++---
 drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c |  2 +-
 drivers/net/can/usb/usb_8dev.c                   |  4 ++--
 9 files changed, 26 insertions(+), 28 deletions(-)

-- 
2.35.1


^ permalink raw reply	[flat|nested] 32+ messages in thread

* [PATCH v2 01/10]  can: can327: use KBUILD_MODNAME instead of hard coded names
  2022-07-26  8:26 ` [PATCH v2 00/10] can: remove litteral strings used for driver names and " Vincent Mailhol
@ 2022-07-26  8:26   ` Vincent Mailhol
  2022-07-26  8:26   ` [PATCH v2 02/10] can: ems_usb: " Vincent Mailhol
                     ` (10 subsequent siblings)
  11 siblings, 0 replies; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-26  8:26 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde; +Cc: Dario Binacchi, Max Staudt, Vincent Mailhol

The driver uses the string "can327" to populate
tty_ldisc_ops::name. KBUILD_MODNAME also evaluates to "can327". Use
KBUILD_MODNAME and get rid on the hardcoded string names.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/can327.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/can327.c b/drivers/net/can/can327.c
index 5da7778d92dc..bf0cce2dbb40 100644
--- a/drivers/net/can/can327.c
+++ b/drivers/net/can/can327.c
@@ -10,7 +10,7 @@
  *                   Fred N. van Kempen <waltje@uwalt.nl.mugnet.org>
  */
 
-#define pr_fmt(fmt) "can327: " fmt
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/init.h>
 #include <linux/module.h>
@@ -1100,7 +1100,7 @@ static int can327_ldisc_ioctl(struct tty_struct *tty, unsigned int cmd,
 
 static struct tty_ldisc_ops can327_ldisc = {
 	.owner = THIS_MODULE,
-	.name = "can327",
+	.name = KBUILD_MODNAME,
 	.num = N_CAN327,
 	.receive_buf = can327_ldisc_rx,
 	.write_wakeup = can327_ldisc_tx_wakeup,
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 02/10] can: ems_usb: use KBUILD_MODNAME instead of hard coded names
  2022-07-26  8:26 ` [PATCH v2 00/10] can: remove litteral strings used for driver names and " Vincent Mailhol
  2022-07-26  8:26   ` [PATCH v2 01/10] can: can327: use KBUILD_MODNAME instead of hard coded names Vincent Mailhol
@ 2022-07-26  8:26   ` Vincent Mailhol
  2022-07-26  8:27   ` [PATCH v2 03/10] can: slcan: use KBUILD_MODNAME and define pr_fmt to replace hardcoded names Vincent Mailhol
                     ` (9 subsequent siblings)
  11 siblings, 0 replies; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-26  8:26 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde; +Cc: Dario Binacchi, Max Staudt, Vincent Mailhol

The driver uses the string "ems_usb" to populate usb_driver::name and
can_bittiming_const::name. KBUILD_MODNAME also evaluates to
"ems_ubs". Use KBUILD_MODNAME and get rid on the hardcoded string
names.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/usb/ems_usb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
index bbec3311d893..e86a2033db60 100644
--- a/drivers/net/can/usb/ems_usb.c
+++ b/drivers/net/can/usb/ems_usb.c
@@ -880,7 +880,7 @@ static const struct net_device_ops ems_usb_netdev_ops = {
 };
 
 static const struct can_bittiming_const ems_usb_bittiming_const = {
-	.name = "ems_usb",
+	.name = KBUILD_MODNAME,
 	.tseg1_min = 1,
 	.tseg1_max = 16,
 	.tseg2_min = 1,
@@ -1074,7 +1074,7 @@ static void ems_usb_disconnect(struct usb_interface *intf)
 
 /* usb specific object needed to register this driver with the usb subsystem */
 static struct usb_driver ems_usb_driver = {
-	.name = "ems_usb",
+	.name = KBUILD_MODNAME,
 	.probe = ems_usb_probe,
 	.disconnect = ems_usb_disconnect,
 	.id_table = ems_usb_table,
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 03/10] can: slcan: use KBUILD_MODNAME and define pr_fmt to replace hardcoded names
  2022-07-26  8:26 ` [PATCH v2 00/10] can: remove litteral strings used for driver names and " Vincent Mailhol
  2022-07-26  8:26   ` [PATCH v2 01/10] can: can327: use KBUILD_MODNAME instead of hard coded names Vincent Mailhol
  2022-07-26  8:26   ` [PATCH v2 02/10] can: ems_usb: " Vincent Mailhol
@ 2022-07-26  8:27   ` Vincent Mailhol
  2022-07-26  8:27   ` [PATCH v2 04/10] can: softing: use KBUILD_MODNAME instead of hard coded names Vincent Mailhol
                     ` (8 subsequent siblings)
  11 siblings, 0 replies; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-26  8:27 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde; +Cc: Dario Binacchi, Max Staudt, Vincent Mailhol

The driver uses the string "slcan" to populate
tty_ldisc_ops::name. KBUILD_MODNAME also evaluates to "slcan". Use
KBUILD_MODNAME to get rid on the hardcoded string names.

Similarly, the pr_info() and pr_err() hardcoded the "slcan"
prefix. Define pr_fmt so that the "slcan" prefix gets automatically
added.

can: ems_ubs: use KBUILD_MODNAME instead of hard coded name

    The driver uses the string "ems_usb" to populate usb_driver::name and
    can_bittiming_const::name. KBUILD_MODNAME also evaluates to
    "ems_ubs". Use KBUILD_MODNAME and get rid on the hardcoded string
    names.

CC: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---

@Dario, because you are also doing a lot of changes on slcan, our
patches might conflict. Do not hesitate to take this one and add it to
your series to simplify the merge.
---
 drivers/net/can/slcan/slcan-core.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/can/slcan/slcan-core.c b/drivers/net/can/slcan/slcan-core.c
index dc28e715bbe1..3039ce37c8f1 100644
--- a/drivers/net/can/slcan/slcan-core.c
+++ b/drivers/net/can/slcan/slcan-core.c
@@ -35,6 +35,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 
@@ -864,7 +866,7 @@ static struct slcan *slc_alloc(void)
 	if (!dev)
 		return NULL;
 
-	snprintf(dev->name, sizeof(dev->name), "slcan%d", i);
+	snprintf(dev->name, sizeof(dev->name), KBUILD_MODNAME "%d", i);
 	dev->netdev_ops = &slc_netdev_ops;
 	dev->base_addr  = i;
 	slcan_set_ethtool_ops(dev);
@@ -937,7 +939,7 @@ static int slcan_open(struct tty_struct *tty)
 		rtnl_unlock();
 		err = register_candev(sl->dev);
 		if (err) {
-			pr_err("slcan: can't register candev\n");
+			pr_err("can't register candev\n");
 			goto err_free_chan;
 		}
 	} else {
@@ -1028,7 +1030,7 @@ static int slcan_ioctl(struct tty_struct *tty, unsigned int cmd,
 static struct tty_ldisc_ops slc_ldisc = {
 	.owner		= THIS_MODULE,
 	.num		= N_SLCAN,
-	.name		= "slcan",
+	.name		= KBUILD_MODNAME,
 	.open		= slcan_open,
 	.close		= slcan_close,
 	.hangup		= slcan_hangup,
@@ -1044,8 +1046,8 @@ static int __init slcan_init(void)
 	if (maxdev < 4)
 		maxdev = 4; /* Sanity */
 
-	pr_info("slcan: serial line CAN interface driver\n");
-	pr_info("slcan: %d dynamic interface channels.\n", maxdev);
+	pr_info("serial line CAN interface driver\n");
+	pr_info("%d dynamic interface channels.\n", maxdev);
 
 	slcan_devs = kcalloc(maxdev, sizeof(struct net_device *), GFP_KERNEL);
 	if (!slcan_devs)
@@ -1054,7 +1056,7 @@ static int __init slcan_init(void)
 	/* Fill in our line protocol discipline, and register it */
 	status = tty_register_ldisc(&slc_ldisc);
 	if (status)  {
-		pr_err("slcan: can't register line discipline\n");
+		pr_err("can't register line discipline\n");
 		kfree(slcan_devs);
 	}
 	return status;
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 04/10] can: softing: use KBUILD_MODNAME instead of hard coded names
  2022-07-26  8:26 ` [PATCH v2 00/10] can: remove litteral strings used for driver names and " Vincent Mailhol
                     ` (2 preceding siblings ...)
  2022-07-26  8:27   ` [PATCH v2 03/10] can: slcan: use KBUILD_MODNAME and define pr_fmt to replace hardcoded names Vincent Mailhol
@ 2022-07-26  8:27   ` Vincent Mailhol
  2022-07-26  8:27   ` [PATCH v2 05/10] can: esd_usb: " Vincent Mailhol
                     ` (7 subsequent siblings)
  11 siblings, 0 replies; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-26  8:27 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde; +Cc: Dario Binacchi, Max Staudt, Vincent Mailhol

The driver uses the string "softing" to populate platform_driver::name
and can_bittiming_const::name. KBUILD_MODNAME also evaluates to
"softing". Use KBUILD_MODNAME and get rid on the hardcoded string
names.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/softing/softing_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c
index 8d27ac66ca7f..8cca6f07e7c3 100644
--- a/drivers/net/can/softing/softing_main.c
+++ b/drivers/net/can/softing/softing_main.c
@@ -612,7 +612,7 @@ static const struct net_device_ops softing_netdev_ops = {
 };
 
 static const struct can_bittiming_const softing_btr_const = {
-	.name = "softing",
+	.name = KBUILD_MODNAME,
 	.tseg1_min = 1,
 	.tseg1_max = 16,
 	.tseg2_min = 1,
@@ -846,7 +846,7 @@ static int softing_pdev_probe(struct platform_device *pdev)
 
 static struct platform_driver softing_driver = {
 	.driver = {
-		.name = "softing",
+		.name = KBUILD_MODNAME,
 	},
 	.probe = softing_pdev_probe,
 	.remove = softing_pdev_remove,
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 05/10] can: esd_usb: use KBUILD_MODNAME instead of hard coded names
  2022-07-26  8:26 ` [PATCH v2 00/10] can: remove litteral strings used for driver names and " Vincent Mailhol
                     ` (3 preceding siblings ...)
  2022-07-26  8:27   ` [PATCH v2 04/10] can: softing: use KBUILD_MODNAME instead of hard coded names Vincent Mailhol
@ 2022-07-26  8:27   ` Vincent Mailhol
  2022-07-26  8:27   ` [PATCH v2 06/10] can: gs_ubs: " Vincent Mailhol
                     ` (6 subsequent siblings)
  11 siblings, 0 replies; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-26  8:27 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde
  Cc: Dario Binacchi, Max Staudt, Vincent Mailhol, Frank Jungclaus

The driver uses the string "ems_usb" to populate
usb_driver::name. KBUILD_MODNAME also evaluates to "esd_ubs". Use
KBUILD_MODNAME and get rid on the hardcoded string names.

CC: Frank Jungclaus <frank.jungclaus@esd.eu>
Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/usb/esd_usb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/usb/esd_usb.c b/drivers/net/can/usb/esd_usb.c
index 177ed33e08d9..7b849bd3cc9c 100644
--- a/drivers/net/can/usb/esd_usb.c
+++ b/drivers/net/can/usb/esd_usb.c
@@ -1138,7 +1138,7 @@ static void esd_usb_disconnect(struct usb_interface *intf)
 
 /* usb specific object needed to register this driver with the usb subsystem */
 static struct usb_driver esd_usb_driver = {
-	.name = "esd_usb",
+	.name = KBUILD_MODNAME,
 	.probe = esd_usb_probe,
 	.disconnect = esd_usb_disconnect,
 	.id_table = esd_usb_table,
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 06/10] can: gs_ubs: use KBUILD_MODNAME instead of hard coded names
  2022-07-26  8:26 ` [PATCH v2 00/10] can: remove litteral strings used for driver names and " Vincent Mailhol
                     ` (4 preceding siblings ...)
  2022-07-26  8:27   ` [PATCH v2 05/10] can: esd_usb: " Vincent Mailhol
@ 2022-07-26  8:27   ` Vincent Mailhol
  2022-07-26  8:27   ` [PATCH v2 07/10] can: kvaser_usb: " Vincent Mailhol
                     ` (5 subsequent siblings)
  11 siblings, 0 replies; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-26  8:27 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde; +Cc: Dario Binacchi, Max Staudt, Vincent Mailhol

The driver uses the string "gs_usb" to populate usb_driver::name,
can_bittiming_const::name and
can_data_bittiming_const::name. KBUILD_MODNAME evaluates to
"gs_ubs". Use KBUILD_MODNAME and get rid on the hardcoded string
names.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/usb/gs_usb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c
index d3a658b444b5..fd239b523c42 100644
--- a/drivers/net/can/usb/gs_usb.c
+++ b/drivers/net/can/usb/gs_usb.c
@@ -993,7 +993,7 @@ static struct gs_can *gs_make_candev(unsigned int channel,
 	netdev->flags |= IFF_ECHO; /* we support full roundtrip echo */
 
 	/* dev setup */
-	strcpy(dev->bt_const.name, "gs_usb");
+	strcpy(dev->bt_const.name, KBUILD_MODNAME);
 	dev->bt_const.tseg1_min = le32_to_cpu(bt_const->tseg1_min);
 	dev->bt_const.tseg1_max = le32_to_cpu(bt_const->tseg1_max);
 	dev->bt_const.tseg2_min = le32_to_cpu(bt_const->tseg2_min);
@@ -1100,7 +1100,7 @@ static struct gs_can *gs_make_candev(unsigned int channel,
 			return ERR_PTR(rc);
 		}
 
-		strcpy(dev->data_bt_const.name, "gs_usb");
+		strcpy(dev->data_bt_const.name, KBUILD_MODNAME);
 		dev->data_bt_const.tseg1_min = le32_to_cpu(bt_const_extended->dtseg1_min);
 		dev->data_bt_const.tseg1_max = le32_to_cpu(bt_const_extended->dtseg1_max);
 		dev->data_bt_const.tseg2_min = le32_to_cpu(bt_const_extended->dtseg2_min);
@@ -1270,7 +1270,7 @@ static const struct usb_device_id gs_usb_table[] = {
 MODULE_DEVICE_TABLE(usb, gs_usb_table);
 
 static struct usb_driver gs_usb_driver = {
-	.name = "gs_usb",
+	.name = KBUILD_MODNAME,
 	.probe = gs_usb_probe,
 	.disconnect = gs_usb_disconnect,
 	.id_table = gs_usb_table,
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 07/10] can: kvaser_usb: use KBUILD_MODNAME instead of hard coded names
  2022-07-26  8:26 ` [PATCH v2 00/10] can: remove litteral strings used for driver names and " Vincent Mailhol
                     ` (5 preceding siblings ...)
  2022-07-26  8:27   ` [PATCH v2 06/10] can: gs_ubs: " Vincent Mailhol
@ 2022-07-26  8:27   ` Vincent Mailhol
  2022-07-26  8:27   ` [PATCH v2 08/10] can: ubs_8dev: " Vincent Mailhol
                     ` (4 subsequent siblings)
  11 siblings, 0 replies; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-26  8:27 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde; +Cc: Dario Binacchi, Max Staudt, Vincent Mailhol

The driver uses the string "kvaser_usb" to populate
usb_driver::name. KBUILD_MODNAME also evaluates to "kvaser_ubs". Use
KBUILD_MODNAME and get rid on the hardcoded string names.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c
index f211bfcb1d97..ce60b16ac8ee 100644
--- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c
+++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c
@@ -869,7 +869,7 @@ static void kvaser_usb_disconnect(struct usb_interface *intf)
 }
 
 static struct usb_driver kvaser_usb_driver = {
-	.name = "kvaser_usb",
+	.name = KBUILD_MODNAME,
 	.probe = kvaser_usb_probe,
 	.disconnect = kvaser_usb_disconnect,
 	.id_table = kvaser_usb_table,
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 08/10] can: ubs_8dev: use KBUILD_MODNAME instead of hard coded names
  2022-07-26  8:26 ` [PATCH v2 00/10] can: remove litteral strings used for driver names and " Vincent Mailhol
                     ` (6 preceding siblings ...)
  2022-07-26  8:27   ` [PATCH v2 07/10] can: kvaser_usb: " Vincent Mailhol
@ 2022-07-26  8:27   ` Vincent Mailhol
  2022-07-26  8:27   ` [PATCH v2 09/10] can: etas_es58x: replace ES58X_MODULE_NAME with KBUILD_MODNAME Vincent Mailhol
                     ` (3 subsequent siblings)
  11 siblings, 0 replies; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-26  8:27 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde; +Cc: Dario Binacchi, Max Staudt, Vincent Mailhol

The driver uses the string "usb_8dev" to populate usb_driver::name and
can_bittiming_const::name. KBUILD_MODNAME also evaluates to
"ubs_8dev". Use KBUILD_MODNAME and get rid on the hardcoded string
names.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/usb/usb_8dev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/usb/usb_8dev.c b/drivers/net/can/usb/usb_8dev.c
index 8b7cd69e20b0..6665a66745a7 100644
--- a/drivers/net/can/usb/usb_8dev.c
+++ b/drivers/net/can/usb/usb_8dev.c
@@ -871,7 +871,7 @@ static const struct net_device_ops usb_8dev_netdev_ops = {
 };
 
 static const struct can_bittiming_const usb_8dev_bittiming_const = {
-	.name = "usb_8dev",
+	.name = KBUILD_MODNAME,
 	.tseg1_min = 1,
 	.tseg1_max = 16,
 	.tseg2_min = 1,
@@ -997,7 +997,7 @@ static void usb_8dev_disconnect(struct usb_interface *intf)
 }
 
 static struct usb_driver usb_8dev_driver = {
-	.name =		"usb_8dev",
+	.name =		KBUILD_MODNAME,
 	.probe =	usb_8dev_probe,
 	.disconnect =	usb_8dev_disconnect,
 	.id_table =	usb_8dev_table,
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 09/10] can: etas_es58x: replace ES58X_MODULE_NAME with KBUILD_MODNAME
  2022-07-26  8:26 ` [PATCH v2 00/10] can: remove litteral strings used for driver names and " Vincent Mailhol
                     ` (7 preceding siblings ...)
  2022-07-26  8:27   ` [PATCH v2 08/10] can: ubs_8dev: " Vincent Mailhol
@ 2022-07-26  8:27   ` Vincent Mailhol
  2022-07-26  8:27   ` [PATCH v2 10/10] can: etas_es58x: remove DRV_VERSION Vincent Mailhol
                     ` (2 subsequent siblings)
  11 siblings, 0 replies; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-26  8:27 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde; +Cc: Dario Binacchi, Max Staudt, Vincent Mailhol

ES58X_MODULE_NAME is set to "etas_es58x". KBUILD_MODNAME also
evaluates to "etas_es58x". Get rid of ES58X_MODULE_NAME and rely on
KBUILD_MODNAME instead.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/usb/etas_es58x/es58x_core.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/usb/etas_es58x/es58x_core.c b/drivers/net/can/usb/etas_es58x/es58x_core.c
index 7353745f92d7..ade0a650e0ed 100644
--- a/drivers/net/can/usb/etas_es58x/es58x_core.c
+++ b/drivers/net/can/usb/etas_es58x/es58x_core.c
@@ -25,7 +25,6 @@ MODULE_DESCRIPTION("Socket CAN driver for ETAS ES58X USB adapters");
 MODULE_VERSION(DRV_VERSION);
 MODULE_LICENSE("GPL v2");
 
-#define ES58X_MODULE_NAME "etas_es58x"
 #define ES58X_VENDOR_ID 0x108C
 #define ES581_4_PRODUCT_ID 0x0159
 #define ES582_1_PRODUCT_ID 0x0168
@@ -59,11 +58,11 @@ MODULE_DEVICE_TABLE(usb, es58x_id_table);
 
 #define es58x_print_hex_dump(buf, len)					\
 	print_hex_dump(KERN_DEBUG,					\
-		       ES58X_MODULE_NAME " " __stringify(buf) ": ",	\
+		       KBUILD_MODNAME " " __stringify(buf) ": ",	\
 		       DUMP_PREFIX_NONE, 16, 1, buf, len, false)
 
 #define es58x_print_hex_dump_debug(buf, len)				 \
-	print_hex_dump_debug(ES58X_MODULE_NAME " " __stringify(buf) ": ",\
+	print_hex_dump_debug(KBUILD_MODNAME " " __stringify(buf) ": ",\
 			     DUMP_PREFIX_NONE, 16, 1, buf, len, false)
 
 /* The last two bytes of an ES58X command is a CRC16. The first two
@@ -2280,7 +2279,7 @@ static void es58x_disconnect(struct usb_interface *intf)
 }
 
 static struct usb_driver es58x_driver = {
-	.name = ES58X_MODULE_NAME,
+	.name = KBUILD_MODNAME,
 	.probe = es58x_probe,
 	.disconnect = es58x_disconnect,
 	.id_table = es58x_id_table
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* [PATCH v2 10/10] can: etas_es58x: remove DRV_VERSION
  2022-07-26  8:26 ` [PATCH v2 00/10] can: remove litteral strings used for driver names and " Vincent Mailhol
                     ` (8 preceding siblings ...)
  2022-07-26  8:27   ` [PATCH v2 09/10] can: etas_es58x: replace ES58X_MODULE_NAME with KBUILD_MODNAME Vincent Mailhol
@ 2022-07-26  8:27   ` Vincent Mailhol
  2022-07-26  8:54   ` [PATCH v2 00/10] can: remove litteral strings used for driver names and " Marc Kleine-Budde
  2022-09-15 12:18   ` andy.shevchenko
  11 siblings, 0 replies; 32+ messages in thread
From: Vincent Mailhol @ 2022-07-26  8:27 UTC (permalink / raw)
  To: linux-can, Marc Kleine-Budde; +Cc: Dario Binacchi, Max Staudt, Vincent Mailhol

DRV_VERSION is a leftover from when the driver was an out of tree
module. The driver version was never incremented despite of the
numerous changes made since it was mainstreamed. Keeping an
unmaintained driver version number makes no sense. Remove it and rely
on the kernel version instead.

Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
---
 drivers/net/can/usb/etas_es58x/es58x_core.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/can/usb/etas_es58x/es58x_core.c b/drivers/net/can/usb/etas_es58x/es58x_core.c
index ade0a650e0ed..c22e989d42ff 100644
--- a/drivers/net/can/usb/etas_es58x/es58x_core.c
+++ b/drivers/net/can/usb/etas_es58x/es58x_core.c
@@ -18,11 +18,9 @@
 
 #include "es58x_core.h"
 
-#define DRV_VERSION "1.00"
 MODULE_AUTHOR("Vincent Mailhol <mailhol.vincent@wanadoo.fr>");
 MODULE_AUTHOR("Arunachalam Santhanam <arunachalam.santhanam@in.bosch.com>");
 MODULE_DESCRIPTION("Socket CAN driver for ETAS ES58X USB adapters");
-MODULE_VERSION(DRV_VERSION);
 MODULE_LICENSE("GPL v2");
 
 #define ES58X_VENDOR_ID 0x108C
@@ -2180,9 +2178,8 @@ static struct es58x_device *es58x_init_es58x_dev(struct usb_interface *intf,
 	struct usb_endpoint_descriptor *ep_in, *ep_out;
 	int ret;
 
-	dev_info(dev,
-		 "Starting %s %s (Serial Number %s) driver version %s\n",
-		 udev->manufacturer, udev->product, udev->serial, DRV_VERSION);
+	dev_info(dev, "Starting %s %s (Serial Number %s)\n",
+		 udev->manufacturer, udev->product, udev->serial);
 
 	ret = usb_find_common_endpoints(intf->cur_altsetting, &ep_in, &ep_out,
 					NULL, NULL);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 00/10] can: remove litteral strings used for driver names and remove DRV_VERSION
  2022-07-26  8:26 ` [PATCH v2 00/10] can: remove litteral strings used for driver names and " Vincent Mailhol
                     ` (9 preceding siblings ...)
  2022-07-26  8:27   ` [PATCH v2 10/10] can: etas_es58x: remove DRV_VERSION Vincent Mailhol
@ 2022-07-26  8:54   ` Marc Kleine-Budde
  2022-07-26  9:58     ` Dario Binacchi
  2022-09-15 12:18   ` andy.shevchenko
  11 siblings, 1 reply; 32+ messages in thread
From: Marc Kleine-Budde @ 2022-07-26  8:54 UTC (permalink / raw)
  To: Vincent Mailhol; +Cc: linux-can, Dario Binacchi, Max Staudt

[-- Attachment #1: Type: text/plain, Size: 906 bytes --]

On 26.07.2022 17:26:57, Vincent Mailhol wrote:
> This is a cleanup series.
> 
> The patches 1 to 8 get rid of any hardcoded strings and instead relies
> on the KBUILD_MODNAME macros to get the device name. Patch 9 replaces
> the ES58X_MODULE_NAME macro with KBUILD_MODNAME in
> etas_es58x. Finally, also in etas_es58x, patch 10 removes the
> DRV_VERSION so that the module uses the default behavior and advertise
> the kernel version instead of a custom version.

Added to linux-can-next/master. Dropped patch "[PATCH v2 03/14] can:
slcan: add software tx timestamps", to let Dario Binacchi pick that up.

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 00/10] can: remove litteral strings used for driver names and remove DRV_VERSION
  2022-07-26  8:54   ` [PATCH v2 00/10] can: remove litteral strings used for driver names and " Marc Kleine-Budde
@ 2022-07-26  9:58     ` Dario Binacchi
  2022-07-26 12:43       ` Marc Kleine-Budde
  0 siblings, 1 reply; 32+ messages in thread
From: Dario Binacchi @ 2022-07-26  9:58 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: Vincent Mailhol, linux-can, Max Staudt

On Tue, Jul 26, 2022 at 10:54 AM Marc Kleine-Budde <mkl@pengutronix.de> wrote:
>
> On 26.07.2022 17:26:57, Vincent Mailhol wrote:
> > This is a cleanup series.
> >
> > The patches 1 to 8 get rid of any hardcoded strings and instead relies
> > on the KBUILD_MODNAME macros to get the device name. Patch 9 replaces
> > the ES58X_MODULE_NAME macro with KBUILD_MODNAME in
> > etas_es58x. Finally, also in etas_es58x, patch 10 removes the
> > DRV_VERSION so that the module uses the default behavior and advertise
> > the kernel version instead of a custom version.
>
> Added to linux-can-next/master. Dropped patch "[PATCH v2 03/14] can:
> slcan: add software tx timestamps", to let Dario Binacchi pick that up.

or "can: slcan: use KBUILD_MODNAME and define pr_fmt to replace
hardcoded names" ?

Thanks and regards,
Dario

>
> regards,
> Marc
>
> --
> Pengutronix e.K.                 | Marc Kleine-Budde           |
> Embedded Linux                   | https://www.pengutronix.de  |
> Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
> Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |



-- 

Dario Binacchi

Embedded Linux Developer

dario.binacchi@amarulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@amarulasolutions.com

www.amarulasolutions.com

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 00/10] can: remove litteral strings used for driver names and remove DRV_VERSION
  2022-07-26  9:58     ` Dario Binacchi
@ 2022-07-26 12:43       ` Marc Kleine-Budde
  0 siblings, 0 replies; 32+ messages in thread
From: Marc Kleine-Budde @ 2022-07-26 12:43 UTC (permalink / raw)
  To: Dario Binacchi; +Cc: Vincent Mailhol, linux-can, Max Staudt

[-- Attachment #1: Type: text/plain, Size: 1189 bytes --]

On 26.07.2022 11:58:17, Dario Binacchi wrote:
> On Tue, Jul 26, 2022 at 10:54 AM Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> >
> > On 26.07.2022 17:26:57, Vincent Mailhol wrote:
> > > This is a cleanup series.
> > >
> > > The patches 1 to 8 get rid of any hardcoded strings and instead relies
> > > on the KBUILD_MODNAME macros to get the device name. Patch 9 replaces
> > > the ES58X_MODULE_NAME macro with KBUILD_MODNAME in
> > > etas_es58x. Finally, also in etas_es58x, patch 10 removes the
> > > DRV_VERSION so that the module uses the default behavior and advertise
> > > the kernel version instead of a custom version.
> >
> > Added to linux-can-next/master. Dropped patch "[PATCH v2 03/14] can:
> > slcan: add software tx timestamps", to let Dario Binacchi pick that up.
> 
> or "can: slcan: use KBUILD_MODNAME and define pr_fmt to replace
> hardcoded names" ?

Doh! ACK, fixed.

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 00/10] can: remove litteral strings used for driver names and remove DRV_VERSION
  2022-07-26  8:26 ` [PATCH v2 00/10] can: remove litteral strings used for driver names and " Vincent Mailhol
                     ` (10 preceding siblings ...)
  2022-07-26  8:54   ` [PATCH v2 00/10] can: remove litteral strings used for driver names and " Marc Kleine-Budde
@ 2022-09-15 12:18   ` andy.shevchenko
  2022-09-15 12:24     ` Marc Kleine-Budde
  11 siblings, 1 reply; 32+ messages in thread
From: andy.shevchenko @ 2022-09-15 12:18 UTC (permalink / raw)
  To: Vincent Mailhol; +Cc: linux-can, Marc Kleine-Budde, Dario Binacchi, Max Staudt

Tue, Jul 26, 2022 at 05:26:57PM +0900, Vincent Mailhol kirjoitti:
> This is a cleanup series.
> 
> The patches 1 to 8 get rid of any hardcoded strings and instead relies
> on the KBUILD_MODNAME macros to get the device name. Patch 9 replaces
> the ES58X_MODULE_NAME macro with KBUILD_MODNAME in
> etas_es58x. Finally, also in etas_es58x, patch 10 removes the
> DRV_VERSION so that the module uses the default behavior and advertise
> the kernel version instead of a custom version.

I guess you all understand that this is potential ABI breakage.
The driver can be instantiated by its name (for matching purposes) from board
files or MFD cell. If you change the name of the file, the module will be
changed and hence the breakage.

That said, NAK from me (as I do usually the opposite change).

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 00/10] can: remove litteral strings used for driver names and remove DRV_VERSION
  2022-09-15 12:18   ` andy.shevchenko
@ 2022-09-15 12:24     ` Marc Kleine-Budde
  2022-09-15 12:27       ` Andy Shevchenko
  0 siblings, 1 reply; 32+ messages in thread
From: Marc Kleine-Budde @ 2022-09-15 12:24 UTC (permalink / raw)
  To: andy.shevchenko; +Cc: Vincent Mailhol, linux-can, Dario Binacchi, Max Staudt

[-- Attachment #1: Type: text/plain, Size: 1957 bytes --]

On 15.09.2022 15:18:02, andy.shevchenko@gmail.com wrote:
> Tue, Jul 26, 2022 at 05:26:57PM +0900, Vincent Mailhol kirjoitti:
> > This is a cleanup series.
> >
> > The patches 1 to 8 get rid of any hardcoded strings and instead relies
> > on the KBUILD_MODNAME macros to get the device name. Patch 9 replaces
> > the ES58X_MODULE_NAME macro with KBUILD_MODNAME in
> > etas_es58x. Finally, also in etas_es58x, patch 10 removes the
> > DRV_VERSION so that the module uses the default behavior and advertise
> > the kernel version instead of a custom version.
>
> I guess you all understand that this is potential ABI breakage.

Good point.

> The driver can be instantiated by its name (for matching purposes) from board
> files or MFD cell.

Hope we don't have board files anymore....

> If you change the name of the file, the module will be
> changed and hence the breakage.
>
> That said, NAK from me (as I do usually the opposite change).

Let's look at the diffstat:

These are serial line disciplines, they have their own ID:
 drivers/net/can/can327.c                         |  4 ++--
 drivers/net/can/slcan/slcan-core.c               | 14 ++++++++------

This might be a problem, it's a platform driver:
 drivers/net/can/softing/softing_main.c           |  4 ++--

It should be no problem for USB devices, right?
 drivers/net/can/usb/ems_usb.c                    |  4 ++--
 drivers/net/can/usb/esd_usb.c                    |  2 +-
 drivers/net/can/usb/etas_es58x/es58x_core.c      | 14 +++++---------
 drivers/net/can/usb/gs_usb.c                     |  6 +++---
 drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c |  2 +-
 drivers/net/can/usb/usb_8dev.c                   |  4 ++--

Marc

--
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 00/10] can: remove litteral strings used for driver names and remove DRV_VERSION
  2022-09-15 12:24     ` Marc Kleine-Budde
@ 2022-09-15 12:27       ` Andy Shevchenko
  2022-09-15 12:31         ` Marc Kleine-Budde
  0 siblings, 1 reply; 32+ messages in thread
From: Andy Shevchenko @ 2022-09-15 12:27 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: Vincent Mailhol, linux-can, Dario Binacchi, Max Staudt

On Thu, Sep 15, 2022 at 3:25 PM Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> On 15.09.2022 15:18:02, andy.shevchenko@gmail.com wrote:
> > Tue, Jul 26, 2022 at 05:26:57PM +0900, Vincent Mailhol kirjoitti:
> > > This is a cleanup series.
> > >
> > > The patches 1 to 8 get rid of any hardcoded strings and instead relies
> > > on the KBUILD_MODNAME macros to get the device name. Patch 9 replaces
> > > the ES58X_MODULE_NAME macro with KBUILD_MODNAME in
> > > etas_es58x. Finally, also in etas_es58x, patch 10 removes the
> > > DRV_VERSION so that the module uses the default behavior and advertise
> > > the kernel version instead of a custom version.
> >
> > I guess you all understand that this is potential ABI breakage.
>
> Good point.
>
> > The driver can be instantiated by its name (for matching purposes) from board
> > files or MFD cell.
>
> Hope we don't have board files anymore....
>
> > If you change the name of the file, the module will be
> > changed and hence the breakage.
> >
> > That said, NAK from me (as I do usually the opposite change).
>
> Let's look at the diffstat:
>
> These are serial line disciplines, they have their own ID:
>  drivers/net/can/can327.c                         |  4 ++--
>  drivers/net/can/slcan/slcan-core.c               | 14 ++++++++------
>
> This might be a problem, it's a platform driver:
>  drivers/net/can/softing/softing_main.c           |  4 ++--
>
> It should be no problem for USB devices, right?
>  drivers/net/can/usb/ems_usb.c                    |  4 ++--
>  drivers/net/can/usb/esd_usb.c                    |  2 +-
>  drivers/net/can/usb/etas_es58x/es58x_core.c      | 14 +++++---------
>  drivers/net/can/usb/gs_usb.c                     |  6 +++---
>  drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c |  2 +-
>  drivers/net/can/usb/usb_8dev.c                   |  4 ++--

I agree with your grouping and analysis. This is minor anyway, but
better to have it more robust. So, yes, with USB I don't believe it
would be an issue, but for platform driver it might be.


-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: [PATCH v2 00/10] can: remove litteral strings used for driver names and remove DRV_VERSION
  2022-09-15 12:27       ` Andy Shevchenko
@ 2022-09-15 12:31         ` Marc Kleine-Budde
  0 siblings, 0 replies; 32+ messages in thread
From: Marc Kleine-Budde @ 2022-09-15 12:31 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Vincent Mailhol, linux-can, Dario Binacchi, Max Staudt

[-- Attachment #1: Type: text/plain, Size: 1767 bytes --]

On 15.09.2022 15:27:11, Andy Shevchenko wrote:
> > > If you change the name of the file, the module will be
> > > changed and hence the breakage.
> > >
> > > That said, NAK from me (as I do usually the opposite change).
> >
> > Let's look at the diffstat:
> >
> > These are serial line disciplines, they have their own ID:
> >  drivers/net/can/can327.c                         |  4 ++--
> >  drivers/net/can/slcan/slcan-core.c               | 14 ++++++++------
> >
> > This might be a problem, it's a platform driver:
> >  drivers/net/can/softing/softing_main.c           |  4 ++--
> >
> > It should be no problem for USB devices, right?
> >  drivers/net/can/usb/ems_usb.c                    |  4 ++--
> >  drivers/net/can/usb/esd_usb.c                    |  2 +-
> >  drivers/net/can/usb/etas_es58x/es58x_core.c      | 14 +++++---------
> >  drivers/net/can/usb/gs_usb.c                     |  6 +++---
> >  drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c |  2 +-
> >  drivers/net/can/usb/usb_8dev.c                   |  4 ++--
> 
> I agree with your grouping and analysis. This is minor anyway, but
> better to have it more robust. So, yes, with USB I don't believe it
> would be an issue, but for platform driver it might be.

This series is in >= v6.0 and there are several platform drivers that
use KBUILD_MODNAME for .name before this series.

I'll take care to revert that change on the softing driver and prepare
patches for the others.

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2022-09-15 12:31 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-25 15:31 [PATCH 0/9] can: remove litteral strings used for driver name and remove DRV_VERSION Vincent Mailhol
2022-07-25 15:31 ` [PATCH 1/9] can: can327: use KBUILD_MODNAME instead of hard coded name Vincent Mailhol
2022-07-25 15:31 ` [PATCH 2/9] can: ems_ubs: " Vincent Mailhol
2022-07-25 17:34   ` Marc Kleine-Budde
2022-07-25 15:31 ` [PATCH 3/9] can: slcan: add DRV_NAME and define pr_fmt to replace hardcoded names Vincent Mailhol
2022-07-25 15:31 ` [PATCH 4/9] can: softing: add DRV_NAME " Vincent Mailhol
2022-07-25 20:53   ` Marc Kleine-Budde
2022-07-25 15:31 ` [PATCH 5/9] can: esd_usb: use KBUILD_MODNAME instead of hard coded name Vincent Mailhol
2022-07-25 20:46   ` Marc Kleine-Budde
2022-07-25 15:31 ` [PATCH 6/9] can: gs_ubs: " Vincent Mailhol
2022-07-25 15:31 ` [PATCH 7/9] can: softing: add DRV_NAME to replace hardcoded names Vincent Mailhol
2022-07-25 20:50   ` Marc Kleine-Budde
2022-07-25 15:31 ` [PATCH 8/9] can: ubs_8dev: use KBUILD_MODNAME instead of hard coded name Vincent Mailhol
2022-07-25 15:31 ` [PATCH 9/9] can: etas_es58x: remove DRV_VERSION Vincent Mailhol
2022-07-26  8:26 ` [PATCH v2 00/10] can: remove litteral strings used for driver names and " Vincent Mailhol
2022-07-26  8:26   ` [PATCH v2 01/10] can: can327: use KBUILD_MODNAME instead of hard coded names Vincent Mailhol
2022-07-26  8:26   ` [PATCH v2 02/10] can: ems_usb: " Vincent Mailhol
2022-07-26  8:27   ` [PATCH v2 03/10] can: slcan: use KBUILD_MODNAME and define pr_fmt to replace hardcoded names Vincent Mailhol
2022-07-26  8:27   ` [PATCH v2 04/10] can: softing: use KBUILD_MODNAME instead of hard coded names Vincent Mailhol
2022-07-26  8:27   ` [PATCH v2 05/10] can: esd_usb: " Vincent Mailhol
2022-07-26  8:27   ` [PATCH v2 06/10] can: gs_ubs: " Vincent Mailhol
2022-07-26  8:27   ` [PATCH v2 07/10] can: kvaser_usb: " Vincent Mailhol
2022-07-26  8:27   ` [PATCH v2 08/10] can: ubs_8dev: " Vincent Mailhol
2022-07-26  8:27   ` [PATCH v2 09/10] can: etas_es58x: replace ES58X_MODULE_NAME with KBUILD_MODNAME Vincent Mailhol
2022-07-26  8:27   ` [PATCH v2 10/10] can: etas_es58x: remove DRV_VERSION Vincent Mailhol
2022-07-26  8:54   ` [PATCH v2 00/10] can: remove litteral strings used for driver names and " Marc Kleine-Budde
2022-07-26  9:58     ` Dario Binacchi
2022-07-26 12:43       ` Marc Kleine-Budde
2022-09-15 12:18   ` andy.shevchenko
2022-09-15 12:24     ` Marc Kleine-Budde
2022-09-15 12:27       ` Andy Shevchenko
2022-09-15 12:31         ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).