Re: [PATCH v1 4/9] can: Add Nuvoton NCT6694 CAN support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux