pinctrl: Use device_get_match_data()
authorRob Herring <robh@kernel.org>
Mon, 9 Oct 2023 17:29:13 +0000 (12:29 -0500)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 30 Oct 2023 13:50:42 +0000 (14:50 +0100)
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: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://lore.kernel.org/r/20231009172923.2457844-18-robh@kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
19 files changed:
drivers/pinctrl/bcm/pinctrl-ns.c
drivers/pinctrl/berlin/berlin-bg2.c
drivers/pinctrl/berlin/berlin-bg2cd.c
drivers/pinctrl/berlin/berlin-bg2q.c
drivers/pinctrl/berlin/berlin-bg4ct.c
drivers/pinctrl/berlin/pinctrl-as370.c
drivers/pinctrl/mvebu/pinctrl-armada-38x.c
drivers/pinctrl/mvebu/pinctrl-armada-39x.c
drivers/pinctrl/mvebu/pinctrl-armada-ap806.c
drivers/pinctrl/mvebu/pinctrl-armada-cp110.c
drivers/pinctrl/mvebu/pinctrl-armada-xp.c
drivers/pinctrl/mvebu/pinctrl-dove.c
drivers/pinctrl/mvebu/pinctrl-kirkwood.c
drivers/pinctrl/mvebu/pinctrl-orion.c
drivers/pinctrl/nomadik/pinctrl-abx500.c
drivers/pinctrl/nomadik/pinctrl-nomadik.c
drivers/pinctrl/pinctrl-at91.c
drivers/pinctrl/pinctrl-xway.c
drivers/pinctrl/ti/pinctrl-ti-iodelay.c

index f80630a74d34a5416770291cdc45d04a52649817..d099a7f25f64c9f816918c6b584b2e0322b1c78c 100644 (file)
@@ -7,11 +7,11 @@
 #include <linux/io.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/pinctrl/pinconf-generic.h>
 #include <linux/pinctrl/pinctrl.h>
 #include <linux/pinctrl/pinmux.h>
 #include <linux/platform_device.h>
+#include <linux/property.h>
 #include <linux/slab.h>
 
 #include "../core.h"
@@ -208,7 +208,6 @@ static const struct of_device_id ns_pinctrl_of_match_table[] = {
 static int ns_pinctrl_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
-       const struct of_device_id *of_id;
        struct ns_pinctrl *ns_pinctrl;
        struct pinctrl_desc *pctldesc;
        struct pinctrl_pin_desc *pin;
@@ -225,10 +224,7 @@ static int ns_pinctrl_probe(struct platform_device *pdev)
 
        ns_pinctrl->dev = dev;
 
-       of_id = of_match_device(ns_pinctrl_of_match_table, dev);
-       if (!of_id)
-               return -EINVAL;
-       ns_pinctrl->chipset_flag = (uintptr_t)of_id->data;
+       ns_pinctrl->chipset_flag = (uintptr_t)device_get_match_data(dev);
 
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM,
                                           "cru_gpio_control");
index acbd413340e8be3fcd381ab1cb66c9b642b96214..15aed44676271a34aefd82ffa30adcc0ab72e392 100644 (file)
@@ -8,8 +8,9 @@
  */
 
 #include <linux/init.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
+#include <linux/property.h>
 #include <linux/regmap.h>
 
 #include "berlin.h"
@@ -227,10 +228,7 @@ static const struct of_device_id berlin2_pinctrl_match[] = {
 
 static int berlin2_pinctrl_probe(struct platform_device *pdev)
 {
-       const struct of_device_id *match =
-               of_match_device(berlin2_pinctrl_match, &pdev->dev);
-
-       return berlin_pinctrl_probe(pdev, match->data);
+       return berlin_pinctrl_probe(pdev, device_get_match_data(&pdev->dev));
 }
 
 static struct platform_driver berlin2_pinctrl_driver = {
index c0f5d86d5d01d9970e7628de21012d6ff641bbf5..73a1d8c2308866abc3ec98e4e7209e9e4189f9f6 100644 (file)
@@ -8,8 +8,9 @@
  */
 
 #include <linux/init.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
+#include <linux/property.h>
 #include <linux/regmap.h>
 
 #include "berlin.h"
@@ -172,10 +173,7 @@ static const struct of_device_id berlin2cd_pinctrl_match[] = {
 
 static int berlin2cd_pinctrl_probe(struct platform_device *pdev)
 {
-       const struct of_device_id *match =
-               of_match_device(berlin2cd_pinctrl_match, &pdev->dev);
-
-       return berlin_pinctrl_probe(pdev, match->data);
+       return berlin_pinctrl_probe(pdev, device_get_match_data(&pdev->dev));
 }
 
 static struct platform_driver berlin2cd_pinctrl_driver = {
index 20a3216ede07a7681e05bc2742815940ebc09a38..a5dbc8f279e70a2f2667b361cdf52c05bcd74716 100644 (file)
@@ -8,8 +8,9 @@
  */
 
 #include <linux/init.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
+#include <linux/property.h>
 #include <linux/regmap.h>
 
 #include "berlin.h"
@@ -389,10 +390,7 @@ static const struct of_device_id berlin2q_pinctrl_match[] = {
 
 static int berlin2q_pinctrl_probe(struct platform_device *pdev)
 {
-       const struct of_device_id *match =
-               of_match_device(berlin2q_pinctrl_match, &pdev->dev);
-
-       return berlin_pinctrl_probe(pdev, match->data);
+       return berlin_pinctrl_probe(pdev, device_get_match_data(&pdev->dev));
 }
 
 static struct platform_driver berlin2q_pinctrl_driver = {
index 3026a3b3da2dd948209574732736f712ebc2beb5..9bf0a54f2798a252dee0b9f38d95b9dae8b35aeb 100644 (file)
@@ -8,8 +8,9 @@
  */
 
 #include <linux/init.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
+#include <linux/property.h>
 #include <linux/regmap.h>
 
 #include "berlin.h"
@@ -449,8 +450,8 @@ static const struct of_device_id berlin4ct_pinctrl_match[] = {
 
 static int berlin4ct_pinctrl_probe(struct platform_device *pdev)
 {
-       const struct of_device_id *match =
-               of_match_device(berlin4ct_pinctrl_match, &pdev->dev);
+       const struct berlin_pinctrl_desc *desc =
+               device_get_match_data(&pdev->dev);
        struct regmap_config *rmconfig;
        struct regmap *regmap;
        struct resource *res;
@@ -473,7 +474,7 @@ static int berlin4ct_pinctrl_probe(struct platform_device *pdev)
        if (IS_ERR(regmap))
                return PTR_ERR(regmap);
 
-       return berlin_pinctrl_probe_regmap(pdev, match->data, regmap);
+       return berlin_pinctrl_probe_regmap(pdev, desc, regmap);
 }
 
 static struct platform_driver berlin4ct_pinctrl_driver = {
index b631c14813a7dce50bd0baee1488fdd6abe16e3c..fc0daec94e1059f5c6c99b062fd7728fb52dfebf 100644 (file)
@@ -8,8 +8,9 @@
  */
 
 #include <linux/init.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/platform_device.h>
+#include <linux/property.h>
 #include <linux/regmap.h>
 
 #include "berlin.h"
@@ -330,8 +331,8 @@ static const struct of_device_id as370_pinctrl_match[] = {
 
 static int as370_pinctrl_probe(struct platform_device *pdev)
 {
-       const struct of_device_id *match =
-               of_match_device(as370_pinctrl_match, &pdev->dev);
+       const struct berlin_pinctrl_desc *desc =
+               device_get_match_data(&pdev->dev);
        struct regmap_config *rmconfig;
        struct regmap *regmap;
        struct resource *res;
@@ -354,7 +355,7 @@ static int as370_pinctrl_probe(struct platform_device *pdev)
        if (IS_ERR(regmap))
                return PTR_ERR(regmap);
 
-       return berlin_pinctrl_probe_regmap(pdev, match->data, regmap);
+       return berlin_pinctrl_probe_regmap(pdev, desc, regmap);
 }
 
 static struct platform_driver as370_pinctrl_driver = {
index 040e418dbfc1bea038bd7055eecbdf25a4a9cf27..162dfc213669a7feaee9c75faf500e9b00c82624 100644 (file)
@@ -12,8 +12,8 @@
 #include <linux/io.h>
 #include <linux/platform_device.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/pinctrl/pinctrl.h>
+#include <linux/property.h>
 
 #include "pinctrl-mvebu.h"
 
@@ -404,13 +404,8 @@ static struct pinctrl_gpio_range armada_38x_mpp_gpio_ranges[] = {
 static int armada_38x_pinctrl_probe(struct platform_device *pdev)
 {
        struct mvebu_pinctrl_soc_info *soc = &armada_38x_pinctrl_info;
-       const struct of_device_id *match =
-               of_match_device(armada_38x_pinctrl_of_match, &pdev->dev);
 
-       if (!match)
-               return -ENODEV;
-
-       soc->variant = (unsigned) match->data & 0xff;
+       soc->variant = (unsigned)device_get_match_data(&pdev->dev) & 0xff;
        soc->controls = armada_38x_mpp_controls;
        soc->ncontrols = ARRAY_SIZE(armada_38x_mpp_controls);
        soc->gpioranges = armada_38x_mpp_gpio_ranges;
index c33f1cbaf661aacf04e440cad3bc2f9ecd8cd993..d9c98faa7b0e9442ffe99db3ddef41f3d2733bc0 100644 (file)
@@ -12,8 +12,8 @@
 #include <linux/io.h>
 #include <linux/platform_device.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/pinctrl/pinctrl.h>
+#include <linux/property.h>
 
 #include "pinctrl-mvebu.h"
 
@@ -386,13 +386,8 @@ static struct pinctrl_gpio_range armada_39x_mpp_gpio_ranges[] = {
 static int armada_39x_pinctrl_probe(struct platform_device *pdev)
 {
        struct mvebu_pinctrl_soc_info *soc = &armada_39x_pinctrl_info;
-       const struct of_device_id *match =
-               of_match_device(armada_39x_pinctrl_of_match, &pdev->dev);
 
-       if (!match)
-               return -ENODEV;
-
-       soc->variant = (unsigned) match->data & 0xff;
+       soc->variant = (unsigned)device_get_match_data(&pdev->dev) & 0xff;
        soc->controls = armada_39x_mpp_controls;
        soc->ncontrols = ARRAY_SIZE(armada_39x_mpp_controls);
        soc->gpioranges = armada_39x_mpp_gpio_ranges;
index 89bab536717df6feb3d7fa4d21e961760bc50206..7becf2781a0b9f69d69f849bc2f69f84769c0f40 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/io.h>
 #include <linux/platform_device.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/pinctrl/pinctrl.h>
 
 #include "pinctrl-mvebu.h"
@@ -106,10 +105,8 @@ static struct pinctrl_gpio_range armada_ap806_mpp_gpio_ranges[] = {
 static int armada_ap806_pinctrl_probe(struct platform_device *pdev)
 {
        struct mvebu_pinctrl_soc_info *soc = &armada_ap806_pinctrl_info;
-       const struct of_device_id *match =
-               of_match_device(armada_ap806_pinctrl_of_match, &pdev->dev);
 
-       if (!match || !pdev->dev.parent)
+       if (!pdev->dev.parent)
                return -ENODEV;
 
        soc->variant = 0; /* no variants for Armada AP806 */
index 8ba8f3e9121f042a06c79762918f6af739da7e01..9a250c491f33d349c9edaaf7c4ce655883e8c513 100644 (file)
@@ -12,9 +12,9 @@
 #include <linux/io.h>
 #include <linux/mfd/syscon.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/pinctrl/pinctrl.h>
 #include <linux/platform_device.h>
+#include <linux/property.h>
 
 #include "pinctrl-mvebu.h"
 
@@ -638,8 +638,6 @@ static void mvebu_pinctrl_assign_variant(struct mvebu_mpp_mode *m,
 static int armada_cp110_pinctrl_probe(struct platform_device *pdev)
 {
        struct mvebu_pinctrl_soc_info *soc;
-       const struct of_device_id *match =
-               of_match_device(armada_cp110_pinctrl_of_match, &pdev->dev);
        int i;
 
        if (!pdev->dev.parent)
@@ -650,7 +648,7 @@ static int armada_cp110_pinctrl_probe(struct platform_device *pdev)
        if (!soc)
                return -ENOMEM;
 
-       soc->variant = (unsigned long) match->data & 0xff;
+       soc->variant = (unsigned long)device_get_match_data(&pdev->dev) & 0xff;
        soc->controls = armada_cp110_mpp_controls;
        soc->ncontrols = ARRAY_SIZE(armada_cp110_mpp_controls);
        soc->modes = armada_cp110_mpp_modes;
index 48e2a6c56a83b96a3e128dc571689494066b9447..487825bfd125f3e00f9a7e4f24610959fffa03b0 100644 (file)
@@ -19,8 +19,8 @@
 #include <linux/platform_device.h>
 #include <linux/clk.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/pinctrl/pinctrl.h>
+#include <linux/property.h>
 #include <linux/bitops.h>
 
 #include "pinctrl-mvebu.h"
@@ -568,14 +568,9 @@ static int armada_xp_pinctrl_resume(struct platform_device *pdev)
 static int armada_xp_pinctrl_probe(struct platform_device *pdev)
 {
        struct mvebu_pinctrl_soc_info *soc = &armada_xp_pinctrl_info;
-       const struct of_device_id *match =
-               of_match_device(armada_xp_pinctrl_of_match, &pdev->dev);
        int nregs;
 
-       if (!match)
-               return -ENODEV;
-
-       soc->variant = (unsigned) match->data & 0xff;
+       soc->variant = (unsigned)device_get_match_data(&pdev->dev) & 0xff;
 
        switch (soc->variant) {
        case V_MV78230:
index bd74daa9ed666395131599c03e387a197a91bb36..1947da73e5121052b4a6cc29035850c144851cef 100644 (file)
@@ -12,9 +12,9 @@
 #include <linux/platform_device.h>
 #include <linux/clk.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/mfd/syscon.h>
 #include <linux/pinctrl/pinctrl.h>
+#include <linux/property.h>
 #include <linux/regmap.h>
 
 #include "pinctrl-mvebu.h"
@@ -765,13 +765,11 @@ static int dove_pinctrl_probe(struct platform_device *pdev)
 {
        struct resource *res, *mpp_res;
        struct resource fb_res;
-       const struct of_device_id *match =
-               of_match_device(dove_pinctrl_of_match, &pdev->dev);
        struct mvebu_mpp_ctrl_data *mpp_data;
        void __iomem *base;
        int i;
 
-       pdev->dev.platform_data = (void *)match->data;
+       pdev->dev.platform_data = (void *)device_get_match_data(&pdev->dev);
 
        /*
         * General MPP Configuration Register is part of pdma registers.
index d45c31f281c85647fe8cf96139f1a8ccd3c6eae2..4789d7442f788ededf227f89879de810a2d2ce8a 100644 (file)
@@ -11,8 +11,8 @@
 #include <linux/platform_device.h>
 #include <linux/clk.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/pinctrl/pinctrl.h>
+#include <linux/property.h>
 
 #include "pinctrl-mvebu.h"
 
@@ -470,10 +470,7 @@ static const struct of_device_id kirkwood_pinctrl_of_match[] = {
 
 static int kirkwood_pinctrl_probe(struct platform_device *pdev)
 {
-       const struct of_device_id *match =
-               of_match_device(kirkwood_pinctrl_of_match, &pdev->dev);
-
-       pdev->dev.platform_data = (void *)match->data;
+       pdev->dev.platform_data = (void *)device_get_match_data(&pdev->dev);
 
        return mvebu_pinctrl_simple_mmio_probe(pdev);
 }
index cc97d270be61b4594c08668be8e0865152f706f3..2b6ab7f2afc781278d3fb08e3f26596e36b4931d 100644 (file)
@@ -19,8 +19,8 @@
 #include <linux/platform_device.h>
 #include <linux/clk.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/pinctrl/pinctrl.h>
+#include <linux/property.h>
 
 #include "pinctrl-mvebu.h"
 
@@ -218,10 +218,7 @@ static const struct of_device_id orion_pinctrl_of_match[] = {
 
 static int orion_pinctrl_probe(struct platform_device *pdev)
 {
-       const struct of_device_id *match =
-               of_match_device(orion_pinctrl_of_match, &pdev->dev);
-
-       pdev->dev.platform_data = (void*)match->data;
+       pdev->dev.platform_data = (void*)device_get_match_data(&pdev->dev);
 
        mpp_base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(mpp_base))
index 233857d5440351d99fd32cf06c666b425d6a866b..d3c32d809bac409fd3d8d45b8d8bf40e78f5cb49 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/platform_device.h>
+#include <linux/property.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
 #include <linux/types.h>
@@ -985,7 +986,6 @@ static const struct of_device_id abx500_gpio_match[] = {
 static int abx500_gpio_probe(struct platform_device *pdev)
 {
        struct device_node *np = pdev->dev.of_node;
-       const struct of_device_id *match;
        struct abx500_pinctrl *pct;
        unsigned int id = -1;
        int ret;
@@ -1006,12 +1006,7 @@ static int abx500_gpio_probe(struct platform_device *pdev)
        pct->chip.parent = &pdev->dev;
        pct->chip.base = -1; /* Dynamic allocation */
 
-       match = of_match_device(abx500_gpio_match, &pdev->dev);
-       if (!match) {
-               dev_err(&pdev->dev, "gpio dt not matching\n");
-               return -ENODEV;
-       }
-       id = (unsigned long)match->data;
+       id = (unsigned long)device_get_match_data(&pdev->dev);
 
        /* Poke in other ASIC variants here */
        switch (id) {
index 86a638077a697391136bb9057bd306c77c5b63f3..863732287b1e573d1d5ea96c8fd31f7941d5d9ef 100644 (file)
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
+#include <linux/of.h>
 #include <linux/of_address.h>
-#include <linux/of_device.h>
+#include <linux/of_platform.h>
 #include <linux/platform_device.h>
+#include <linux/property.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
 #include <linux/spinlock.h>
@@ -1838,7 +1840,6 @@ static int nmk_pinctrl_resume(struct device *dev)
 
 static int nmk_pinctrl_probe(struct platform_device *pdev)
 {
-       const struct of_device_id *match;
        struct device_node *np = pdev->dev.of_node;
        struct device_node *prcm_np;
        struct nmk_pinctrl *npct;
@@ -1849,10 +1850,7 @@ static int nmk_pinctrl_probe(struct platform_device *pdev)
        if (!npct)
                return -ENOMEM;
 
-       match = of_match_device(nmk_pinctrl_match, &pdev->dev);
-       if (!match)
-               return -ENODEV;
-       version = (unsigned int) match->data;
+       version = (unsigned int)device_get_match_data(&pdev->dev);
 
        /* Poke in other ASIC variants here */
        if (version == PINCTRL_NMK_STN8815)
index 608f55c5ba5fe6190fc2df544045b538049d4ce8..5aa9d5c533c6a9c7be0c82e6ccb7aea3df742645 100644 (file)
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/of.h>
-#include <linux/of_address.h>
-#include <linux/of_device.h>
-#include <linux/of_irq.h>
+#include <linux/platform_device.h>
 #include <linux/pm.h>
+#include <linux/property.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
 #include <linux/string_helpers.h>
@@ -1302,8 +1301,8 @@ static int at91_pinctrl_probe_dt(struct platform_device *pdev,
        if (!np)
                return -ENODEV;
 
-       info->dev = dev;
-       info->ops = of_device_get_match_data(dev);
+       info->dev = &pdev->dev;
+       info->ops = device_get_match_data(&pdev->dev);
        at91_pinctrl_child_count(info, np);
 
        /*
@@ -1845,7 +1844,7 @@ static int at91_gpio_probe(struct platform_device *pdev)
        if (IS_ERR(at91_chip->regbase))
                return PTR_ERR(at91_chip->regbase);
 
-       at91_chip->ops = of_device_get_match_data(dev);
+       at91_chip->ops = device_get_match_data(dev);
        at91_chip->pioc_virq = irq;
 
        at91_chip->clock = devm_clk_get_enabled(dev, NULL);
index cf0383f575d9c9b67a5bddef13ecffc9c9e17b91..f4256a918165f4d7dda8d2c8a4adf71b141f918b 100644 (file)
 #include <linux/gpio/driver.h>
 #include <linux/slab.h>
 #include <linux/module.h>
-#include <linux/of_platform.h>
-#include <linux/of_address.h>
+#include <linux/of.h>
 #include <linux/ioport.h>
 #include <linux/io.h>
 #include <linux/device.h>
 #include <linux/platform_device.h>
+#include <linux/property.h>
 
 #include "pinctrl-lantiq.h"
 
@@ -1451,7 +1451,6 @@ MODULE_DEVICE_TABLE(of, xway_match);
 
 static int pinmux_xway_probe(struct platform_device *pdev)
 {
-       const struct of_device_id *match;
        const struct pinctrl_xway_soc *xway_soc;
        int ret, i;
 
@@ -1460,10 +1459,8 @@ static int pinmux_xway_probe(struct platform_device *pdev)
        if (IS_ERR(xway_info.membase[0]))
                return PTR_ERR(xway_info.membase[0]);
 
-       match = of_match_device(xway_match, &pdev->dev);
-       if (match)
-               xway_soc = (const struct pinctrl_xway_soc *) match->data;
-       else
+       xway_soc = device_get_match_data(&pdev->dev);
+       if (!xway_soc)
                xway_soc = &danube_pinctrl;
 
        /* find out how many pads we have */
index 0ac2548ca68dce8c9b7d998e4a29a7ac7304285c..040f2c46a868def2dbcf54e7aff0c4954447d630 100644 (file)
@@ -14,7 +14,8 @@
 #include <linux/io.h>
 #include <linux/module.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
+#include <linux/platform_device.h>
+#include <linux/property.h>
 #include <linux/regmap.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
@@ -822,7 +823,6 @@ static int ti_iodelay_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
        struct device_node *np = of_node_get(dev->of_node);
-       const struct of_device_id *match;
        struct resource *res;
        struct ti_iodelay_device *iod;
        int ret = 0;
@@ -833,20 +833,18 @@ static int ti_iodelay_probe(struct platform_device *pdev)
                goto exit_out;
        }
 
-       match = of_match_device(ti_iodelay_of_match, dev);
-       if (!match) {
-               ret = -EINVAL;
-               dev_err(dev, "No DATA match\n");
-               goto exit_out;
-       }
-
        iod = devm_kzalloc(dev, sizeof(*iod), GFP_KERNEL);
        if (!iod) {
                ret = -ENOMEM;
                goto exit_out;
        }
        iod->dev = dev;
-       iod->reg_data = match->data;
+       iod->reg_data = device_get_match_data(dev);
+       if (!iod->reg_data) {
+               ret = -EINVAL;
+               dev_err(dev, "No DATA match\n");
+               goto exit_out;
+       }
 
        /* So far We can assume there is only 1 bank of registers */
        iod->reg_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);