Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: CK Hu <ck.hu@mediatek.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Matthias Brugger <matthias.bgg@gmail.com>,
	linux-mediatek@lists.infradead.org,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/mediatek: use platform_register_drivers
Date: Tue, 23 May 2017 14:48:26 +0800	[thread overview]
Message-ID: <1495522106.20811.15.camel@mtksdaap41> (raw)
In-Reply-To: <20170317170023.17658-1-p.zabel@pengutronix.de>

Hi, Philipp:

Sorry for the late reply. I've applied this patch to my branch
mediatek-drm-next-4.13, thanks.

Regards,
CK

On Fri, 2017-03-17 at 18:00 +0100, Philipp Zabel wrote:
> Use platform_register_drivers instead of open coding the iteration over
> component platform drivers in the mtk_drm_drv and mtk_hdmi modules.
> 
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
>  drivers/gpu/drm/mediatek/mtk_drm_drv.c | 27 ++++-----------------------
>  drivers/gpu/drm/mediatek/mtk_hdmi.c    | 27 ++++-----------------------
>  2 files changed, 8 insertions(+), 46 deletions(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> index f5a1fd9b3ecc7..20e540aa9e87a 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> @@ -536,33 +536,14 @@ static struct platform_driver * const mtk_drm_drivers[] = {
>  
>  static int __init mtk_drm_init(void)
>  {
> -	int ret;
> -	int i;
> -
> -	for (i = 0; i < ARRAY_SIZE(mtk_drm_drivers); i++) {
> -		ret = platform_driver_register(mtk_drm_drivers[i]);
> -		if (ret < 0) {
> -			pr_err("Failed to register %s driver: %d\n",
> -			       mtk_drm_drivers[i]->driver.name, ret);
> -			goto err;
> -		}
> -	}
> -
> -	return 0;
> -
> -err:
> -	while (--i >= 0)
> -		platform_driver_unregister(mtk_drm_drivers[i]);
> -
> -	return ret;
> +	return platform_register_drivers(mtk_drm_drivers,
> +					 ARRAY_SIZE(mtk_drm_drivers));
>  }
>  
>  static void __exit mtk_drm_exit(void)
>  {
> -	int i;
> -
> -	for (i = ARRAY_SIZE(mtk_drm_drivers) - 1; i >= 0; i--)
> -		platform_driver_unregister(mtk_drm_drivers[i]);
> +	platform_unregister_drivers(mtk_drm_drivers,
> +				    ARRAY_SIZE(mtk_drm_drivers));
>  }
>  
>  module_init(mtk_drm_init);
> diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi.c b/drivers/gpu/drm/mediatek/mtk_hdmi.c
> index 4e2f9c43395c2..65ac296a02fac 100644
> --- a/drivers/gpu/drm/mediatek/mtk_hdmi.c
> +++ b/drivers/gpu/drm/mediatek/mtk_hdmi.c
> @@ -1798,33 +1798,14 @@ static struct platform_driver * const mtk_hdmi_drivers[] = {
>  
>  static int __init mtk_hdmitx_init(void)
>  {
> -	int ret;
> -	int i;
> -
> -	for (i = 0; i < ARRAY_SIZE(mtk_hdmi_drivers); i++) {
> -		ret = platform_driver_register(mtk_hdmi_drivers[i]);
> -		if (ret < 0) {
> -			pr_err("Failed to register %s driver: %d\n",
> -			       mtk_hdmi_drivers[i]->driver.name, ret);
> -			goto err;
> -		}
> -	}
> -
> -	return 0;
> -
> -err:
> -	while (--i >= 0)
> -		platform_driver_unregister(mtk_hdmi_drivers[i]);
> -
> -	return ret;
> +	return platform_register_drivers(mtk_hdmi_drivers,
> +					 ARRAY_SIZE(mtk_hdmi_drivers));
>  }
>  
>  static void __exit mtk_hdmitx_exit(void)
>  {
> -	int i;
> -
> -	for (i = ARRAY_SIZE(mtk_hdmi_drivers) - 1; i >= 0; i--)
> -		platform_driver_unregister(mtk_hdmi_drivers[i]);
> +	platform_unregister_drivers(mtk_hdmi_drivers,
> +				    ARRAY_SIZE(mtk_hdmi_drivers));
>  }
>  
>  module_init(mtk_hdmitx_init);


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2017-05-23  6:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-17 17:00 [PATCH] drm/mediatek: use platform_register_drivers Philipp Zabel
2017-05-23  6:48 ` CK Hu [this message]

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=1495522106.20811.15.camel@mtksdaap41 \
    --to=ck.hu@mediatek.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=p.zabel@pengutronix.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