linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Cc: linux-can@vger.kernel.org,
	Dario Binacchi <dario.binacchi@amarulasolutions.com>,
	Max Staudt <max@enpas.org>
Subject: Re: [PATCH 7/9] can: softing: add DRV_NAME to replace hardcoded names
Date: Mon, 25 Jul 2022 22:50:39 +0200	[thread overview]
Message-ID: <20220725205039.pyza7hd5cw6hnltt@pengutronix.de> (raw)
In-Reply-To: <20220725153124.467061-8-mailhol.vincent@wanadoo.fr>

[-- 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 --]

  reply	other threads:[~2022-07-25 20:50 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=20220725205039.pyza7hd5cw6hnltt@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=dario.binacchi@amarulasolutions.com \
    --cc=linux-can@vger.kernel.org \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=max@enpas.org \
    /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;
as well as URLs for NNTP newsgroup(s).