On 24.10.2024 12:03:34, Marc Kleine-Budde wrote: > Trimming Cc a bit > > On 24.10.2024 16:59:17, Ming Yu wrote: > > +static struct platform_driver nct6694_canfd_driver = { > > + .driver = { > > + .name = DRVNAME, > > + }, > > + .probe = nct6694_canfd_probe, > > + .remove = nct6694_canfd_remove, > > +}; > > + > > +static int __init nct6694_init(void) > > +{ > > + int err; > > + > > + err = platform_driver_register(&nct6694_canfd_driver); > > + if (!err) { > ^^^^ > > + if (err) > ^^^ > > This look wrong. > > > + platform_driver_unregister(&nct6694_canfd_driver); > > Why do you want to unregister if registering fails? This is a pattern that repeats over all platform driver :/ Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung Nürnberg | Phone: +49-5121-206917-129 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Attachment:
signature.asc
Description: PGP signature