[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241024-fluffy-fearless-wapiti-d48c1a-mkl@pengutronix.de>
Date: Thu, 24 Oct 2024 12:03:34 +0200
From: Marc Kleine-Budde <mkl@...gutronix.de>
To: Ming Yu <a0282524688@...il.com>
Cc: tmyu0@...oton.com, lee@...nel.org, mailhol.vincent@...adoo.fr,
linux-can@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH v1 4/9] can: Add Nuvoton NCT6694 CAN support
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?
> + }
> +
> + return err;
> +}
> +subsys_initcall(nct6694_init);
> +
> +static void __exit nct6694_exit(void)
> +{
> + platform_driver_unregister(&nct6694_canfd_driver);
> +}
> +module_exit(nct6694_exit);
Can you use
| module_platform_driver(nct6694_canfd_driver);
?
> +
> +MODULE_DESCRIPTION("USB-CAN FD driver for NCT6694");
> +MODULE_AUTHOR("Ming Yu <tmyu0@...oton.com>");
> +MODULE_LICENSE("GPL");
> --
> 2.34.1
regards,
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 |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists