diff mbox series

[v2,5/6] mmc: sdhci-acpi: Tidy up ACPI ID table

Message ID 20241101101441.3518612-6-andriy.shevchenko@linux.intel.com
State New
Headers show
Series mmc: sdhci-acpi: A few cleanups | expand

Commit Message

Andy Shevchenko Nov. 1, 2024, 10:11 a.m. UTC
Tidy up ACPI ID table:
- sort entries alphabetically for better maintenance
- drop comma in the terminator entry

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/mmc/host/sdhci-acpi.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

Comments

Adrian Hunter Dec. 9, 2024, 11:29 a.m. UTC | #1
On 1/11/24 12:11, Andy Shevchenko wrote:
> Tidy up ACPI ID table:
> - sort entries alphabetically for better maintenance

Not a fan of alphabetical order just for the sake of it.
In this case, it seems to me more useful to keep different
vendors IDs together.

> - drop comma in the terminator entry
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/mmc/host/sdhci-acpi.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
> index 8e265b53d7ce..c931f506c1b0 100644
> --- a/drivers/mmc/host/sdhci-acpi.c
> +++ b/drivers/mmc/host/sdhci-acpi.c
> @@ -682,33 +682,35 @@ struct sdhci_acpi_uid_slot {
>  };
>  
>  static const struct sdhci_acpi_uid_slot sdhci_acpi_uids[] = {
> -	{ "80865ACA", NULL, &sdhci_acpi_slot_int_sd },
> -	{ "80865ACC", NULL, &sdhci_acpi_slot_int_emmc },
> -	{ "80865AD0", NULL, &sdhci_acpi_slot_int_sdio },
>  	{ "80860F14" , "1" , &sdhci_acpi_slot_int_emmc },
>  	{ "80860F14" , "2" , &sdhci_acpi_slot_int_sdio },
>  	{ "80860F14" , "3" , &sdhci_acpi_slot_int_sd   },
>  	{ "80860F16" , NULL, &sdhci_acpi_slot_int_sd   },
> +	{ "80865ACA", NULL, &sdhci_acpi_slot_int_sd },
> +	{ "80865ACC", NULL, &sdhci_acpi_slot_int_emmc },
> +	{ "80865AD0", NULL, &sdhci_acpi_slot_int_sdio },
> +	{ "AMDI0040", NULL, &sdhci_acpi_slot_amd_emmc },
> +	{ "AMDI0041", NULL, &sdhci_acpi_slot_amd_emmc },
>  	{ "INT33BB"  , "2" , &sdhci_acpi_slot_int_sdio },
>  	{ "INT33BB"  , "3" , &sdhci_acpi_slot_int_sd },
>  	{ "INT33C6"  , NULL, &sdhci_acpi_slot_int_sdio },
>  	{ "INT3436"  , NULL, &sdhci_acpi_slot_int_sdio },
>  	{ "INT344D"  , NULL, &sdhci_acpi_slot_int_sdio },
> -	{ "PNP0FFF"  , "3" , &sdhci_acpi_slot_int_sd   },
>  	{ "PNP0D40"  },
> +	{ "PNP0FFF"  , "3" , &sdhci_acpi_slot_int_sd   },
>  	{ "QCOM8051", NULL, &sdhci_acpi_slot_qcom_sd_3v },
>  	{ "QCOM8052", NULL, &sdhci_acpi_slot_qcom_sd },
> -	{ "AMDI0040", NULL, &sdhci_acpi_slot_amd_emmc },
> -	{ "AMDI0041", NULL, &sdhci_acpi_slot_amd_emmc },
> -	{ },
> +	{ }
>  };
>  
>  static const struct acpi_device_id sdhci_acpi_ids[] = {
> +	{ "80860F14" },
> +	{ "80860F16" },
>  	{ "80865ACA" },
>  	{ "80865ACC" },
>  	{ "80865AD0" },
> -	{ "80860F14" },
> -	{ "80860F16" },
> +	{ "AMDI0040" },
> +	{ "AMDI0041" },
>  	{ "INT33BB"  },
>  	{ "INT33C6"  },
>  	{ "INT3436"  },
> @@ -716,9 +718,7 @@ static const struct acpi_device_id sdhci_acpi_ids[] = {
>  	{ "PNP0D40"  },
>  	{ "QCOM8051" },
>  	{ "QCOM8052" },
> -	{ "AMDI0040" },
> -	{ "AMDI0041" },
> -	{ },
> +	{ }
>  };
>  MODULE_DEVICE_TABLE(acpi, sdhci_acpi_ids);
>
Andy Shevchenko Dec. 9, 2024, 4:40 p.m. UTC | #2
On Mon, Dec 09, 2024 at 01:29:19PM +0200, Adrian Hunter wrote:
> On 1/11/24 12:11, Andy Shevchenko wrote:
> > Tidy up ACPI ID table:
> > - sort entries alphabetically for better maintenance
> 
> Not a fan of alphabetical order just for the sake of it.

It's not for the sake of it, that makes easier to see what's going on with the
IDs. It's not the first time I stumbled over (unsorted) ID list and questioning
what the ID belongs to (vendor wise) and how many of them from the same vendor
and how many of them are invalid.

> In this case, it seems to me more useful to keep different
> vendors IDs together.

Agree, but also note, alphabetical order roughly gives the different vendor IDs
together with also grouping PNP/ACPI/invalid ACPI IDs.
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index 8e265b53d7ce..c931f506c1b0 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -682,33 +682,35 @@  struct sdhci_acpi_uid_slot {
 };
 
 static const struct sdhci_acpi_uid_slot sdhci_acpi_uids[] = {
-	{ "80865ACA", NULL, &sdhci_acpi_slot_int_sd },
-	{ "80865ACC", NULL, &sdhci_acpi_slot_int_emmc },
-	{ "80865AD0", NULL, &sdhci_acpi_slot_int_sdio },
 	{ "80860F14" , "1" , &sdhci_acpi_slot_int_emmc },
 	{ "80860F14" , "2" , &sdhci_acpi_slot_int_sdio },
 	{ "80860F14" , "3" , &sdhci_acpi_slot_int_sd   },
 	{ "80860F16" , NULL, &sdhci_acpi_slot_int_sd   },
+	{ "80865ACA", NULL, &sdhci_acpi_slot_int_sd },
+	{ "80865ACC", NULL, &sdhci_acpi_slot_int_emmc },
+	{ "80865AD0", NULL, &sdhci_acpi_slot_int_sdio },
+	{ "AMDI0040", NULL, &sdhci_acpi_slot_amd_emmc },
+	{ "AMDI0041", NULL, &sdhci_acpi_slot_amd_emmc },
 	{ "INT33BB"  , "2" , &sdhci_acpi_slot_int_sdio },
 	{ "INT33BB"  , "3" , &sdhci_acpi_slot_int_sd },
 	{ "INT33C6"  , NULL, &sdhci_acpi_slot_int_sdio },
 	{ "INT3436"  , NULL, &sdhci_acpi_slot_int_sdio },
 	{ "INT344D"  , NULL, &sdhci_acpi_slot_int_sdio },
-	{ "PNP0FFF"  , "3" , &sdhci_acpi_slot_int_sd   },
 	{ "PNP0D40"  },
+	{ "PNP0FFF"  , "3" , &sdhci_acpi_slot_int_sd   },
 	{ "QCOM8051", NULL, &sdhci_acpi_slot_qcom_sd_3v },
 	{ "QCOM8052", NULL, &sdhci_acpi_slot_qcom_sd },
-	{ "AMDI0040", NULL, &sdhci_acpi_slot_amd_emmc },
-	{ "AMDI0041", NULL, &sdhci_acpi_slot_amd_emmc },
-	{ },
+	{ }
 };
 
 static const struct acpi_device_id sdhci_acpi_ids[] = {
+	{ "80860F14" },
+	{ "80860F16" },
 	{ "80865ACA" },
 	{ "80865ACC" },
 	{ "80865AD0" },
-	{ "80860F14" },
-	{ "80860F16" },
+	{ "AMDI0040" },
+	{ "AMDI0041" },
 	{ "INT33BB"  },
 	{ "INT33C6"  },
 	{ "INT3436"  },
@@ -716,9 +718,7 @@  static const struct acpi_device_id sdhci_acpi_ids[] = {
 	{ "PNP0D40"  },
 	{ "QCOM8051" },
 	{ "QCOM8052" },
-	{ "AMDI0040" },
-	{ "AMDI0041" },
-	{ },
+	{ }
 };
 MODULE_DEVICE_TABLE(acpi, sdhci_acpi_ids);