Devicetree
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: dumitru.ceclan@analog.com
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Jonathan Cameron <jic23@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Dumitru Ceclan <mitrutzceclan@gmail.com>
Subject: Re: [PATCH v5 7/9] iio: adc: ad7173: refactor device info structs
Date: Wed, 5 Jun 2024 13:40:20 -0500	[thread overview]
Message-ID: <8450bd9a-c39d-4d24-8a42-f86041d16081@baylibre.com> (raw)
In-Reply-To: <20240603-ad4111-v5-7-9a9c54d9ac78@analog.com>

On 6/3/24 11:23 AM, Dumitru Ceclan via B4 Relay wrote:
> From: Dumitru Ceclan <dumitru.ceclan@analog.com>
> 
> Drop array of device info structs and use individual structs for all;
> drop models enum as no longer needed. This improves readability as the
> structs are pointed directly.
> 
> Signed-off-by: Dumitru Ceclan <dumitru.ceclan@analog.com>
> ---

...

>  static const char *const ad7173_ref_sel_str[] = {
> @@ -1191,32 +1185,25 @@ static int ad7173_probe(struct spi_device *spi)
>  }
>  
>  static const struct of_device_id ad7173_of_match[] = {
> -	{ .compatible = "adi,ad7172-2",
> -	  .data = &ad7173_device_info[ID_AD7172_2]},
> -	{ .compatible = "adi,ad7172-4",
> -	  .data = &ad7173_device_info[ID_AD7172_4]},
> -	{ .compatible = "adi,ad7173-8",
> -	  .data = &ad7173_device_info[ID_AD7173_8]},
> -	{ .compatible = "adi,ad7175-2",
> -	  .data = &ad7173_device_info[ID_AD7175_2]},
> -	{ .compatible = "adi,ad7175-8",
> -	  .data = &ad7173_device_info[ID_AD7175_8]},
> -	{ .compatible = "adi,ad7176-2",
> -	  .data = &ad7173_device_info[ID_AD7176_2]},
> -	{ .compatible = "adi,ad7177-2",
> -	  .data = &ad7173_device_info[ID_AD7177_2]},
> +	{ .compatible = "adi,ad7172-2", .data = &ad7172_2_device_info},
> +	{ .compatible = "adi,ad7172-4", .data = &ad7172_4_device_info},
> +	{ .compatible = "adi,ad7173-8", .data = &ad7173_8_device_info},
> +	{ .compatible = "adi,ad7175-2", .data = &ad7175_2_device_info},
> +	{ .compatible = "adi,ad7175-8", .data = &ad7175_8_device_info},
> +	{ .compatible = "adi,ad7176-2", .data = &ad7176_2_device_info},
> +	{ .compatible = "adi,ad7177-2", .data = &ad7177_2_device_info},
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(of, ad7173_of_match);
>  
>  static const struct spi_device_id ad7173_id_table[] = {
> -	{ "ad7172-2", (kernel_ulong_t)&ad7173_device_info[ID_AD7172_2]},
> -	{ "ad7172-4", (kernel_ulong_t)&ad7173_device_info[ID_AD7172_4]},
> -	{ "ad7173-8", (kernel_ulong_t)&ad7173_device_info[ID_AD7173_8]},
> -	{ "ad7175-2", (kernel_ulong_t)&ad7173_device_info[ID_AD7175_2]},
> -	{ "ad7175-8", (kernel_ulong_t)&ad7173_device_info[ID_AD7175_8]},
> -	{ "ad7176-2", (kernel_ulong_t)&ad7173_device_info[ID_AD7176_2]},
> -	{ "ad7177-2", (kernel_ulong_t)&ad7173_device_info[ID_AD7177_2]},
> +	{ "ad7172-2", (kernel_ulong_t)&ad7172_2_device_info},
> +	{ "ad7172-4", (kernel_ulong_t)&ad7172_4_device_info},
> +	{ "ad7173-8", (kernel_ulong_t)&ad7173_8_device_info},
> +	{ "ad7175-2", (kernel_ulong_t)&ad7175_2_device_info},
> +	{ "ad7175-8", (kernel_ulong_t)&ad7175_8_device_info},
> +	{ "ad7176-2", (kernel_ulong_t)&ad7176_2_device_info},
> +	{ "ad7177-2", (kernel_ulong_t)&ad7177_2_device_info},

nit: I would leave a space before the trailing } to match the space
after the leading { here and in the _of_ table.

>  	{ }
>  };
>  MODULE_DEVICE_TABLE(spi, ad7173_id_table);
> 


  reply	other threads:[~2024-06-05 18:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-03 16:22 [PATCH v5 0/9] Add support for AD411x Dumitru Ceclan via B4 Relay
2024-06-03 16:22 ` [PATCH v5 1/9] dt-bindings: iio: adc: Add common-mode-channel property Dumitru Ceclan via B4 Relay
2024-06-04 17:35   ` Conor Dooley
2024-06-03 16:23 ` [PATCH v5 2/9] dt-bindings: adc: ad7173: add support for ad411x Dumitru Ceclan via B4 Relay
2024-06-04 17:34   ` Conor Dooley
2024-06-04 17:35     ` Conor Dooley
2024-06-03 16:23 ` [PATCH v5 3/9] iio: adc: ad_sigma_delta: add disable_one callback Dumitru Ceclan via B4 Relay
2024-06-03 16:23 ` [PATCH v5 4/9] iio: adc: ad7173: refactor channel configuration parsing Dumitru Ceclan via B4 Relay
2024-06-03 16:23 ` [PATCH v5 5/9] iio: adc: ad7173: refactor ain and vref selection Dumitru Ceclan via B4 Relay
2024-06-03 16:23 ` [PATCH v5 6/9] iio: adc: ad7173: add support for special inputs Dumitru Ceclan via B4 Relay
2024-06-03 16:23 ` [PATCH v5 7/9] iio: adc: ad7173: refactor device info structs Dumitru Ceclan via B4 Relay
2024-06-05 18:40   ` David Lechner [this message]
2024-06-03 16:23 ` [PATCH v5 8/9] iio: adc: ad7173: document sampling frequency behaviour Dumitru Ceclan via B4 Relay
2024-06-03 16:23 ` [PATCH v5 9/9] iio: adc: ad7173: Add support for AD411x devices Dumitru Ceclan via B4 Relay
2024-06-05 19:20   ` David Lechner

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=8450bd9a-c39d-4d24-8a42-f86041d16081@baylibre.com \
    --to=dlechner@baylibre.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dumitru.ceclan@analog.com \
    --cc=jic23@kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mitrutzceclan@gmail.com \
    --cc=robh@kernel.org \
    /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