* [PATCH] ata: imx: Use device_get_match_data()
@ 2023-10-06 21:44 Rob Herring
2023-10-09 14:32 ` Niklas Cassel
2023-10-11 11:11 ` Damien Le Moal
0 siblings, 2 replies; 3+ messages in thread
From: Rob Herring @ 2023-10-06 21:44 UTC (permalink / raw)
To: Damien Le Moal, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, NXP Linux Team
Cc: linux-ide, linux-arm-kernel, linux-kernel
Use preferred device_get_match_data() instead of of_match_device() to
get the driver match data. With this, adjust the includes to explicitly
include the correct headers.
Signed-off-by: Rob Herring <robh@kernel.org>
---
drivers/ata/ahci_imx.c | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c
index 9fa005965f3b..cb768f66f0a7 100644
--- a/drivers/ata/ahci_imx.c
+++ b/drivers/ata/ahci_imx.c
@@ -9,10 +9,11 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/ahci_platform.h>
#include <linux/gpio/consumer.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
#include <linux/mfd/syscon.h>
#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
#include <linux/libata.h>
@@ -1050,16 +1051,11 @@ static int imx8_sata_probe(struct device *dev, struct imx_ahci_priv *imxpriv)
static int imx_ahci_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
- const struct of_device_id *of_id;
struct ahci_host_priv *hpriv;
struct imx_ahci_priv *imxpriv;
unsigned int reg_val;
int ret;
- of_id = of_match_device(imx_ahci_of_match, dev);
- if (!of_id)
- return -EINVAL;
-
imxpriv = devm_kzalloc(dev, sizeof(*imxpriv), GFP_KERNEL);
if (!imxpriv)
return -ENOMEM;
@@ -1067,7 +1063,7 @@ static int imx_ahci_probe(struct platform_device *pdev)
imxpriv->ahci_pdev = pdev;
imxpriv->no_device = false;
imxpriv->first_time = true;
- imxpriv->type = (unsigned long)of_id->data;
+ imxpriv->type = (enum ahci_imx_type)device_get_match_data(dev);
imxpriv->sata_clk = devm_clk_get(dev, "sata");
if (IS_ERR(imxpriv->sata_clk)) {
--
2.40.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] ata: imx: Use device_get_match_data()
2023-10-06 21:44 [PATCH] ata: imx: Use device_get_match_data() Rob Herring
@ 2023-10-09 14:32 ` Niklas Cassel
2023-10-11 11:11 ` Damien Le Moal
1 sibling, 0 replies; 3+ messages in thread
From: Niklas Cassel @ 2023-10-09 14:32 UTC (permalink / raw)
To: Rob Herring
Cc: Damien Le Moal, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, NXP Linux Team, linux-ide@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
On Fri, Oct 06, 2023 at 04:44:42PM -0500, Rob Herring wrote:
> Use preferred device_get_match_data() instead of of_match_device() to
> get the driver match data. With this, adjust the includes to explicitly
> include the correct headers.
>
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
> drivers/ata/ahci_imx.c | 10 +++-------
> 1 file changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c
> index 9fa005965f3b..cb768f66f0a7 100644
> --- a/drivers/ata/ahci_imx.c
> +++ b/drivers/ata/ahci_imx.c
> @@ -9,10 +9,11 @@
> #include <linux/kernel.h>
> #include <linux/module.h>
> #include <linux/platform_device.h>
> +#include <linux/property.h>
> #include <linux/regmap.h>
> #include <linux/ahci_platform.h>
> #include <linux/gpio/consumer.h>
> -#include <linux/of_device.h>
> +#include <linux/of.h>
> #include <linux/mfd/syscon.h>
> #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
> #include <linux/libata.h>
> @@ -1050,16 +1051,11 @@ static int imx8_sata_probe(struct device *dev, struct imx_ahci_priv *imxpriv)
> static int imx_ahci_probe(struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> - const struct of_device_id *of_id;
> struct ahci_host_priv *hpriv;
> struct imx_ahci_priv *imxpriv;
> unsigned int reg_val;
> int ret;
>
> - of_id = of_match_device(imx_ahci_of_match, dev);
> - if (!of_id)
> - return -EINVAL;
> -
> imxpriv = devm_kzalloc(dev, sizeof(*imxpriv), GFP_KERNEL);
> if (!imxpriv)
> return -ENOMEM;
> @@ -1067,7 +1063,7 @@ static int imx_ahci_probe(struct platform_device *pdev)
> imxpriv->ahci_pdev = pdev;
> imxpriv->no_device = false;
> imxpriv->first_time = true;
> - imxpriv->type = (unsigned long)of_id->data;
> + imxpriv->type = (enum ahci_imx_type)device_get_match_data(dev);
>
> imxpriv->sata_clk = devm_clk_get(dev, "sata");
> if (IS_ERR(imxpriv->sata_clk)) {
> --
> 2.40.1
>
Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] ata: imx: Use device_get_match_data()
2023-10-06 21:44 [PATCH] ata: imx: Use device_get_match_data() Rob Herring
2023-10-09 14:32 ` Niklas Cassel
@ 2023-10-11 11:11 ` Damien Le Moal
1 sibling, 0 replies; 3+ messages in thread
From: Damien Le Moal @ 2023-10-11 11:11 UTC (permalink / raw)
To: Rob Herring, Shawn Guo, Sascha Hauer, Pengutronix Kernel Team,
Fabio Estevam, NXP Linux Team
Cc: linux-ide, linux-arm-kernel, linux-kernel
On 10/7/23 06:44, Rob Herring wrote:
> Use preferred device_get_match_data() instead of of_match_device() to
> get the driver match data. With this, adjust the includes to explicitly
> include the correct headers.
>
> Signed-off-by: Rob Herring <robh@kernel.org>
Applied to for-6.7. Thanks !
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-10-11 11:11 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-06 21:44 [PATCH] ata: imx: Use device_get_match_data() Rob Herring
2023-10-09 14:32 ` Niklas Cassel
2023-10-11 11:11 ` Damien Le Moal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox