diff mbox series

[v1,5/6] spi: pxa2xx: Move OF and ACPI ID tables closer to their user

Message ID 20221017171243.57078-5-andriy.shevchenko@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [v1,1/6] spi: pxa2xx: Simplify with devm_platform_get_and_ioremap_resource() | expand

Commit Message

Andy Shevchenko Oct. 17, 2022, 5:12 p.m. UTC
There is no code that uses ID tables directly, except the
struct device_driver at the end of the file. Hence, move
tables closer to its user. It's always possible to access
them via pointer to a platform device.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/spi/spi-pxa2xx.c | 38 +++++++++++++++++++-------------------
 1 file changed, 19 insertions(+), 19 deletions(-)

Comments

Jonathan Cameron Oct. 18, 2022, 9:16 a.m. UTC | #1
On Mon, 17 Oct 2022 20:12:42 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> There is no code that uses ID tables directly, except the
> struct device_driver at the end of the file. Hence, move
> tables closer to its user. It's always possible to access
> them via pointer to a platform device.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Seems sensible.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/spi/spi-pxa2xx.c | 38 +++++++++++++++++++-------------------
>  1 file changed, 19 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
> index 31927493eeb0..76046612466d 100644
> --- a/drivers/spi/spi-pxa2xx.c
> +++ b/drivers/spi/spi-pxa2xx.c
> @@ -1321,25 +1321,6 @@ static void cleanup(struct spi_device *spi)
>  	kfree(chip);
>  }
>  
> -#ifdef CONFIG_ACPI
> -static const struct acpi_device_id pxa2xx_spi_acpi_match[] = {
> -	{ "INT33C0" },
> -	{ "INT33C1" },
> -	{ "INT3430" },
> -	{ "INT3431" },
> -	{ "80860F0E" },
> -	{ "8086228E" },
> -	{ },
> -};
> -MODULE_DEVICE_TABLE(acpi, pxa2xx_spi_acpi_match);
> -#endif
> -
> -static const struct of_device_id pxa2xx_spi_of_match[] = {
> -	{ .compatible = "marvell,mmp2-ssp", .data = (void *)MMP2_SSP },
> -	{},
> -};
> -MODULE_DEVICE_TABLE(of, pxa2xx_spi_of_match);
> -
>  static bool pxa2xx_spi_idma_filter(struct dma_chan *chan, void *param)
>  {
>  	return param == chan->device->dev;
> @@ -1759,6 +1740,25 @@ static const struct dev_pm_ops pxa2xx_spi_pm_ops = {
>  			   pxa2xx_spi_runtime_resume, NULL)
>  };
>  
> +#ifdef CONFIG_ACPI
> +static const struct acpi_device_id pxa2xx_spi_acpi_match[] = {
> +	{ "80860F0E" },
> +	{ "8086228E" },
> +	{ "INT33C0" },
> +	{ "INT33C1" },
> +	{ "INT3430" },
> +	{ "INT3431" },
> +	{}
> +};
> +MODULE_DEVICE_TABLE(acpi, pxa2xx_spi_acpi_match);
> +#endif
> +
> +static const struct of_device_id pxa2xx_spi_of_match[] = {
> +	{ .compatible = "marvell,mmp2-ssp", .data = (void *)MMP2_SSP },
> +	{}
> +};
> +MODULE_DEVICE_TABLE(of, pxa2xx_spi_of_match);
> +
>  static struct platform_driver driver = {
>  	.driver = {
>  		.name	= "pxa2xx-spi",
diff mbox series

Patch

diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index 31927493eeb0..76046612466d 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -1321,25 +1321,6 @@  static void cleanup(struct spi_device *spi)
 	kfree(chip);
 }
 
-#ifdef CONFIG_ACPI
-static const struct acpi_device_id pxa2xx_spi_acpi_match[] = {
-	{ "INT33C0" },
-	{ "INT33C1" },
-	{ "INT3430" },
-	{ "INT3431" },
-	{ "80860F0E" },
-	{ "8086228E" },
-	{ },
-};
-MODULE_DEVICE_TABLE(acpi, pxa2xx_spi_acpi_match);
-#endif
-
-static const struct of_device_id pxa2xx_spi_of_match[] = {
-	{ .compatible = "marvell,mmp2-ssp", .data = (void *)MMP2_SSP },
-	{},
-};
-MODULE_DEVICE_TABLE(of, pxa2xx_spi_of_match);
-
 static bool pxa2xx_spi_idma_filter(struct dma_chan *chan, void *param)
 {
 	return param == chan->device->dev;
@@ -1759,6 +1740,25 @@  static const struct dev_pm_ops pxa2xx_spi_pm_ops = {
 			   pxa2xx_spi_runtime_resume, NULL)
 };
 
+#ifdef CONFIG_ACPI
+static const struct acpi_device_id pxa2xx_spi_acpi_match[] = {
+	{ "80860F0E" },
+	{ "8086228E" },
+	{ "INT33C0" },
+	{ "INT33C1" },
+	{ "INT3430" },
+	{ "INT3431" },
+	{}
+};
+MODULE_DEVICE_TABLE(acpi, pxa2xx_spi_acpi_match);
+#endif
+
+static const struct of_device_id pxa2xx_spi_of_match[] = {
+	{ .compatible = "marvell,mmp2-ssp", .data = (void *)MMP2_SSP },
+	{}
+};
+MODULE_DEVICE_TABLE(of, pxa2xx_spi_of_match);
+
 static struct platform_driver driver = {
 	.driver = {
 		.name	= "pxa2xx-spi",