Skip to content

Commit 0e7ad4b

Browse files
robherringdamien-lemoal
authored andcommitted
ata: imx: Use device_get_match_data()
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> Reviewed-by: Niklas Cassel <niklas.cassel@wdc.com> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
1 parent 0ecbef3 commit 0e7ad4b

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

drivers/ata/ahci_imx.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
#include <linux/kernel.h>
1010
#include <linux/module.h>
1111
#include <linux/platform_device.h>
12+
#include <linux/property.h>
1213
#include <linux/regmap.h>
1314
#include <linux/ahci_platform.h>
1415
#include <linux/gpio/consumer.h>
15-
#include <linux/of_device.h>
16+
#include <linux/of.h>
1617
#include <linux/mfd/syscon.h>
1718
#include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
1819
#include <linux/libata.h>
@@ -1050,24 +1051,19 @@ static int imx8_sata_probe(struct device *dev, struct imx_ahci_priv *imxpriv)
10501051
static int imx_ahci_probe(struct platform_device *pdev)
10511052
{
10521053
struct device *dev = &pdev->dev;
1053-
const struct of_device_id *of_id;
10541054
struct ahci_host_priv *hpriv;
10551055
struct imx_ahci_priv *imxpriv;
10561056
unsigned int reg_val;
10571057
int ret;
10581058

1059-
of_id = of_match_device(imx_ahci_of_match, dev);
1060-
if (!of_id)
1061-
return -EINVAL;
1062-
10631059
imxpriv = devm_kzalloc(dev, sizeof(*imxpriv), GFP_KERNEL);
10641060
if (!imxpriv)
10651061
return -ENOMEM;
10661062

10671063
imxpriv->ahci_pdev = pdev;
10681064
imxpriv->no_device = false;
10691065
imxpriv->first_time = true;
1070-
imxpriv->type = (unsigned long)of_id->data;
1066+
imxpriv->type = (enum ahci_imx_type)device_get_match_data(dev);
10711067

10721068
imxpriv->sata_clk = devm_clk_get(dev, "sata");
10731069
if (IS_ERR(imxpriv->sata_clk)) {

0 commit comments

Comments
 (0)