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

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

 



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


[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