[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOoeyxURx_bPkeetymUJ6v1Ne0CjEnX0wMm76q670SD-HbMwYw@mail.gmail.com>
Date: Fri, 1 Nov 2024 09:27:03 +0800
From: Ming Yu <a0282524688@...il.com>
To: Marc Kleine-Budde <mkl@...gutronix.de>
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
Dear Marc,
Thank you for your comments,
> > +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);
>
I will modify platform driver registration to use module_platform_driver()
in the next patch.
Best regards
Ming
Powered by blists - more mailing lists