diff mbox series

[v2,2/2] iio: dac: ti-dac5571: Sort match tables

Message ID 20230818173907.323640-3-biju.das.jz@bp.renesas.com (mailing list archive)
State Accepted
Headers show
Series Match data improvements for ti-dac5571 driver | expand

Commit Message

Biju Das Aug. 18, 2023, 5:39 p.m. UTC
Sort ID table alphabetically by name and OF table by compatible
for single_*bit enums.

Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
v2:
 * New patch.
---
 drivers/iio/dac/ti-dac5571.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Laurent Pinchart Aug. 28, 2023, 1:50 p.m. UTC | #1
Hi Biju,

Thank you for the patch.

On Fri, Aug 18, 2023 at 06:39:07PM +0100, Biju Das wrote:
> Sort ID table alphabetically by name and OF table by compatible
> for single_*bit enums.
> 
> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

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

> ---
> v2:
>  * New patch.
> ---
>  drivers/iio/dac/ti-dac5571.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/dac/ti-dac5571.c b/drivers/iio/dac/ti-dac5571.c
> index 2bb3f76569ee..efb1269a77c1 100644
> --- a/drivers/iio/dac/ti-dac5571.c
> +++ b/drivers/iio/dac/ti-dac5571.c
> @@ -386,6 +386,7 @@ static void dac5571_remove(struct i2c_client *i2c)
>  }
>  
>  static const struct of_device_id dac5571_of_id[] = {
> +	{.compatible = "ti,dac121c081", .data = &dac5571_spec[single_12bit] },
>  	{.compatible = "ti,dac5571", .data = &dac5571_spec[single_8bit] },
>  	{.compatible = "ti,dac6571", .data = &dac5571_spec[single_10bit] },
>  	{.compatible = "ti,dac7571", .data = &dac5571_spec[single_12bit] },
> @@ -395,12 +396,12 @@ static const struct of_device_id dac5571_of_id[] = {
>  	{.compatible = "ti,dac5573", .data = &dac5571_spec[quad_8bit] },
>  	{.compatible = "ti,dac6573", .data = &dac5571_spec[quad_10bit] },
>  	{.compatible = "ti,dac7573", .data = &dac5571_spec[quad_12bit] },
> -	{.compatible = "ti,dac121c081", .data = &dac5571_spec[single_12bit] },
>  	{}
>  };
>  MODULE_DEVICE_TABLE(of, dac5571_of_id);
>  
>  static const struct i2c_device_id dac5571_id[] = {
> +	{"dac121c081", (kernel_ulong_t)&dac5571_spec[single_12bit] },
>  	{"dac5571", (kernel_ulong_t)&dac5571_spec[single_8bit] },
>  	{"dac6571", (kernel_ulong_t)&dac5571_spec[single_10bit] },
>  	{"dac7571", (kernel_ulong_t)&dac5571_spec[single_12bit] },
> @@ -410,7 +411,6 @@ static const struct i2c_device_id dac5571_id[] = {
>  	{"dac5573", (kernel_ulong_t)&dac5571_spec[quad_8bit] },
>  	{"dac6573", (kernel_ulong_t)&dac5571_spec[quad_10bit] },
>  	{"dac7573", (kernel_ulong_t)&dac5571_spec[quad_12bit] },
> -	{"dac121c081", (kernel_ulong_t)&dac5571_spec[single_12bit] },
>  	{}
>  };
>  MODULE_DEVICE_TABLE(i2c, dac5571_id);
diff mbox series

Patch

diff --git a/drivers/iio/dac/ti-dac5571.c b/drivers/iio/dac/ti-dac5571.c
index 2bb3f76569ee..efb1269a77c1 100644
--- a/drivers/iio/dac/ti-dac5571.c
+++ b/drivers/iio/dac/ti-dac5571.c
@@ -386,6 +386,7 @@  static void dac5571_remove(struct i2c_client *i2c)
 }
 
 static const struct of_device_id dac5571_of_id[] = {
+	{.compatible = "ti,dac121c081", .data = &dac5571_spec[single_12bit] },
 	{.compatible = "ti,dac5571", .data = &dac5571_spec[single_8bit] },
 	{.compatible = "ti,dac6571", .data = &dac5571_spec[single_10bit] },
 	{.compatible = "ti,dac7571", .data = &dac5571_spec[single_12bit] },
@@ -395,12 +396,12 @@  static const struct of_device_id dac5571_of_id[] = {
 	{.compatible = "ti,dac5573", .data = &dac5571_spec[quad_8bit] },
 	{.compatible = "ti,dac6573", .data = &dac5571_spec[quad_10bit] },
 	{.compatible = "ti,dac7573", .data = &dac5571_spec[quad_12bit] },
-	{.compatible = "ti,dac121c081", .data = &dac5571_spec[single_12bit] },
 	{}
 };
 MODULE_DEVICE_TABLE(of, dac5571_of_id);
 
 static const struct i2c_device_id dac5571_id[] = {
+	{"dac121c081", (kernel_ulong_t)&dac5571_spec[single_12bit] },
 	{"dac5571", (kernel_ulong_t)&dac5571_spec[single_8bit] },
 	{"dac6571", (kernel_ulong_t)&dac5571_spec[single_10bit] },
 	{"dac7571", (kernel_ulong_t)&dac5571_spec[single_12bit] },
@@ -410,7 +411,6 @@  static const struct i2c_device_id dac5571_id[] = {
 	{"dac5573", (kernel_ulong_t)&dac5571_spec[quad_8bit] },
 	{"dac6573", (kernel_ulong_t)&dac5571_spec[quad_10bit] },
 	{"dac7573", (kernel_ulong_t)&dac5571_spec[quad_12bit] },
-	{"dac121c081", (kernel_ulong_t)&dac5571_spec[single_12bit] },
 	{}
 };
 MODULE_DEVICE_TABLE(i2c, dac5571_id);