[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <568162b8-563e-4ec7-8f31-bd16f329b245@web.de>
Date: Mon, 27 May 2024 11:45:34 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Sui Jingfeng <sui.jingfeng@...ux.dev>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
dri-devel@...ts.freedesktop.org
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH v2 3/3] drm/loongson: Add dummy gpu driver as a
subcomponent
…
> loose coupling, but still be able to works togather to provide a unified
use loose? should? work together? an?
…
> Add a dummy driver for the GPU, it functional as a subcomponent as well.
is?
Please improve your change descriptions considerably.
…
> +++ b/drivers/gpu/drm/loongson/loongson_module.c
> @@ -29,8 +29,15 @@ static int __init loongson_module_init(void)
> if (ret)
> return ret;
>
> + ret = pci_register_driver(&loong_gpu_pci_driver);
> + if (ret) {
> + platform_driver_unregister(&lsdc_output_port_platform_driver);
> + return ret;
> + }
> +
> ret = pci_register_driver(&lsdc_pci_driver);
> if (ret) {
> + pci_unregister_driver(&loong_gpu_pci_driver);
> platform_driver_unregister(&lsdc_output_port_platform_driver);
> return ret;
> }
How do you think about to use another goto chain for common exception handling?
https://wiki.sei.cmu.edu/confluence/display/c/MEM12-C.+Consider+using+a+goto+chain+when+leaving+a+function+on+error+when+using+and+releasing+resources
Would you become interested in the application of scope-based resource management here?
> @@ -43,6 +50,8 @@ static void __exit loongson_module_exit(void)
> {
> pci_unregister_driver(&lsdc_pci_driver);
>
> + pci_unregister_driver(&loong_gpu_pci_driver);
> +
> platform_driver_unregister(&lsdc_output_port_platform_driver);
> }
I suggest to avoid blank lines for this function implementation.
Regards,
Markus
Powered by blists - more mailing lists