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@xxxxxxxxxx> > --- > 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:
signature.asc
Description: PGP signature