mirror of https://lore.kernel.org/lkml/
 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 1/3] drm/loongson: Add a helper for creating child devices
Date: Mon, 27 May 2024 11:07:42 +0200	[thread overview]
Message-ID: <6ee0b36c-5ea0-4a0a-9d30-865f5b823e78@web.de> (raw)
In-Reply-To: <20240526195826.109008-2-sui.jingfeng@linux.dev>

> In some display subsystems, the functionality of a PCIe device may too

                                                                 might be?


…
> into child devices can helpful to …

                         be?


> Another benefit is that we could migrate the dependency on exterinal

                                                             external?


…
> and rising cyclic dependency problems if not process correctly.

                                               processed?


…
> driver to create sub-devices for it. The manually created decice acts as

                                                            device?


> agents for the principal part, migrate the potential issue to submodule.

  an agent?


Please improve your change descriptions considerably.


…
> +++ b/drivers/gpu/drm/loongson/loongson_device.c
> @@ -100,3 +101,44 @@ lsdc_device_probe(struct pci_dev *pdev, enum loongson_chip_id chip_id)
>  {
>  	return __chip_id_desc_table[chip_id];
>  }
> +
> +int loongson_create_platform_device(struct device *parent,
> +				    const char *name, int id,
> +				    struct resource *pres,
> +				    void *data,
> +				    struct platform_device **ppdev)
> +{
> +		ret = platform_device_add_resources(pdev, pres, 1);
> +		if (ret) {
> +			platform_device_put(pdev);
> +			return ret;
> +		}
> +	ret = platform_device_add(pdev);
> +	if (ret) {
> +		platform_device_put(pdev);
> +		return ret;
> +	}
…

Please use a 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

Regards,
Markus

  parent reply	other threads:[~2024-05-27  9:08 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 [this message]
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
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=6ee0b36c-5ea0-4a0a-9d30-865f5b823e78@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

all inboxes | Powered by JetHome®