Linux PWM subsystem development
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: "Uwe Kleine-König (The Capable Hub)" <u.kleine-koenig@baylibre.com>
Cc: linux-pwm@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1] pwm: Use named initializers for platform_device_id arrays
Date: Wed, 17 Jun 2026 12:58:11 +0300	[thread overview]
Message-ID: <20260617095811.GG3054789@killaraus.ideasonboard.com> (raw)
In-Reply-To: <b515eb1644e793d019163fd2a717d3fccef857f5.1781689255.git.u.kleine-koenig@baylibre.com>

On Wed, Jun 17, 2026 at 11:41:50AM +0200, Uwe Kleine-König (The Capable Hub) wrote:
> Named initializers are better readable and more robust to changes of the
> struct definition. This robustness is relevant for a planned change to
> struct platform_device_id replacing .driver_data by an anonymous union.
> 
> While touching these arrays drop a comma after a list terminator.
> 
> Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
> ---
>  drivers/pwm/pwm-adp5585.c |  4 ++--

For this driver,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

>  drivers/pwm/pwm-pxa.c     | 12 ++++++------
>  2 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/pwm/pwm-adp5585.c b/drivers/pwm/pwm-adp5585.c
> index 806f8d79b0d7..f4aa74b44ed2 100644
> --- a/drivers/pwm/pwm-adp5585.c
> +++ b/drivers/pwm/pwm-adp5585.c
> @@ -203,8 +203,8 @@ static const struct adp5585_pwm_chip adp5589_pwm_chip_info = {
>  };
>  
>  static const struct platform_device_id adp5585_pwm_id_table[] = {
> -	{ "adp5585-pwm", (kernel_ulong_t)&adp5585_pwm_chip_info },
> -	{ "adp5589-pwm", (kernel_ulong_t)&adp5589_pwm_chip_info },
> +	{ .name = "adp5585-pwm", .driver_data = (kernel_ulong_t)&adp5585_pwm_chip_info },
> +	{ .name = "adp5589-pwm", .driver_data = (kernel_ulong_t)&adp5589_pwm_chip_info },
>  	{ /* Sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(platform, adp5585_pwm_id_table);
> diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c
> index 80d2fa10919f..b844bb2dd92e 100644
> --- a/drivers/pwm/pwm-pxa.c
> +++ b/drivers/pwm/pwm-pxa.c
> @@ -32,12 +32,12 @@
>  #define HAS_SECONDARY_PWM	0x10
>  
>  static const struct platform_device_id pwm_id_table[] = {
> -	/*   PWM    has_secondary_pwm? */
> -	{ "pxa25x-pwm", 0 },
> -	{ "pxa27x-pwm", HAS_SECONDARY_PWM },
> -	{ "pxa168-pwm", 0 },
> -	{ "pxa910-pwm", 0 },
> -	{ },
> +	/*             PWM            has_secondary_pwm? */
> +	{ .name = "pxa25x-pwm", .driver_data = 0 },
> +	{ .name = "pxa27x-pwm", .driver_data = HAS_SECONDARY_PWM },
> +	{ .name = "pxa168-pwm", .driver_data = 0 },
> +	{ .name = "pxa910-pwm", .driver_data = 0 },
> +	{ }
>  };
>  MODULE_DEVICE_TABLE(platform, pwm_id_table);
>  
> 
> base-commit: 4fa3f5fabb30bf00d7475d5a33459ea83d639bf9

-- 
Regards,

Laurent Pinchart

      reply	other threads:[~2026-06-17  9:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-17  9:41 [PATCH v1] pwm: Use named initializers for platform_device_id arrays Uwe Kleine-König (The Capable Hub)
2026-06-17  9:58 ` Laurent Pinchart [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=20260617095811.GG3054789@killaraus.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=u.kleine-koenig@baylibre.com \
    /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