public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Sui Jingfeng <sui.jingfeng@linux.dev>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	dri-devel@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH v2 3/3] drm/loongson: Add dummy gpu driver as a subcomponent
Date: Mon, 27 May 2024 11:45:34 +0200	[thread overview]
Message-ID: <568162b8-563e-4ec7-8f31-bd16f329b245@web.de> (raw)
In-Reply-To: <20240526195826.109008-4-sui.jingfeng@linux.dev>

…
> 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

  reply	other threads:[~2024-05-27  9:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-26 19:58 [PATCH v2 0/3] drm/loongson: Introduce component framework support Sui Jingfeng
2024-05-26 19:58 ` [PATCH v2 1/3] drm/loongson: Add a helper for creating child devices Sui Jingfeng
2024-05-26 20:47   ` Dmitry Baryshkov
2024-05-27  9:07   ` Markus Elfring
2024-05-26 19:58 ` [PATCH v2 2/3] drm/loongson: Introduce component framework support Sui Jingfeng
2024-05-27  9:22   ` Markus Elfring
2024-05-26 19:58 ` [PATCH v2 3/3] drm/loongson: Add dummy gpu driver as a subcomponent Sui Jingfeng
2024-05-27  9:45   ` Markus Elfring [this message]
2024-05-27  8:05 ` [PATCH v2 0/3] drm/loongson: Introduce component framework support Markus Elfring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=568162b8-563e-4ec7-8f31-bd16f329b245@web.de \
    --to=markus.elfring@web.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=sui.jingfeng@linux.dev \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox