]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
treewide: use of_device_get_match_data 21599/head
authorRosen Penev <rosenp@gmail.com>
Mon, 19 Jan 2026 04:15:04 +0000 (20:15 -0800)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 12 Apr 2026 16:18:28 +0000 (18:18 +0200)
Simplifies code slightly.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/21599
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
21 files changed:
package/kernel/lantiq/ltq-atm/Makefile
package/kernel/lantiq/ltq-atm/src/ltq_atm.c
target/linux/generic/files/drivers/net/phy/ar8216.c
target/linux/generic/files/drivers/net/phy/ar8327.c
target/linux/qualcommax/patches-6.12/0805-remoteproc-qcom-Add-Hexagon-based-multipd-rproc-driv.patch
target/linux/qualcommax/patches-6.12/0806-rproc-qcom_q6v5_mpd-split-q6_wcss-to-rootpd-and-user.patch
target/linux/qualcommax/patches-6.12/0807-remoteproc-qcom_q6v5_mpd-fix-incorrent-use-of-rproc-.patch
target/linux/qualcommax/patches-6.12/0813-remoteproc-qcom_q6v5_mpd-enable-clocks.patch
target/linux/qualcommax/patches-6.12/0814-remoteproc-qcom_q6v5_mpd-support-ipq5018.patch
target/linux/qualcommax/patches-6.12/0815-remoteproc-qcom_q6v5_mpd-add-support-for-passing-v1-bootargs.patch
target/linux/qualcommax/patches-6.12/0900-power-Add-Qualcomm-APM.patch
target/linux/qualcommax/patches-6.12/0901-regulator-add-Qualcomm-CPR-regulators.patch
target/linux/ramips/files/drivers/dma/mediatek/hsdma-mt7621.c
target/linux/ramips/files/drivers/dma/ralink-gdma.c
target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
target/linux/ramips/files/drivers/net/ethernet/ralink/mt7530.c
target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c
target/linux/ramips/patches-6.12/835-asoc-add-mt7620-support.patch
target/linux/starfive/patches-6.12/0003-pwm-opencores-Add-PWM-driver-support.patch
target/linux/starfive/patches-6.12/0018-driver-e24-add-e24-driver.patch

index 30f8b4ffd9de28280d6a77c550059c84f74f72aa..5c03507dbe87f0328cc67407e80751ab4363a813 100644 (file)
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 
 PKG_NAME:=ltq-atm
-PKG_RELEASE:=3
+PKG_RELEASE:=4
 
 PKG_MAINTAINER:=John Crispin <john@phrozen.org>
 PKG_LICENSE:=GPL-2.0+
index f488aea7331537e3b6f8311ce09d3fd039a64689..1ba2dfb3cb806c5315499b6575ad6de125c146d0 100644 (file)
@@ -38,7 +38,7 @@
 #include <linux/atmdev.h>
 #include <linux/mod_devicetable.h>
 #include <linux/platform_device.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/atm.h>
 #include <linux/clk.h>
 #include <linux/interrupt.h>
@@ -1756,20 +1756,12 @@ MODULE_DEVICE_TABLE(of, ltq_atm_match);
 
 static int ltq_atm_probe(struct platform_device *pdev)
 {
-       const struct of_device_id *match;
-       struct ltq_atm_ops *ops = NULL;
+       const struct ltq_atm_ops *ops;
        int ret;
        int port_num;
        struct port_cell_info port_cell = {0};
        char ver_str[256];
 
-       match = of_match_device(ltq_atm_match, &pdev->dev);
-       if (!match) {
-               dev_err(&pdev->dev, "failed to find matching device\n");
-               return -ENOENT;
-       }
-       ops = (struct ltq_atm_ops *) match->data;
-
        check_parameters();
 
        ret = init_priv_data();
@@ -1778,6 +1770,7 @@ static int ltq_atm_probe(struct platform_device *pdev)
                goto INIT_PRIV_DATA_FAIL;
        }
 
+       ops = of_device_get_match_data(&pdev->dev);
        ret = ops->init(pdev);
        if (ret)
                return ret;
index 33b17cea4f4debf1165b60ab456216e2c88e5b30..c1988defcae6fde227b6cfb1cd6da338749e8c3a 100644 (file)
@@ -23,7 +23,7 @@
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
 #include <linux/netlink.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
 #include <linux/of_mdio.h>
 #include <linux/of_net.h>
 #include <linux/bitops.h>
@@ -2757,23 +2757,18 @@ static const struct of_device_id ar8xxx_mdiodev_of_match[] = {
 static int
 ar8xxx_mdiodev_probe(struct mdio_device *mdiodev)
 {
-       const struct of_device_id *match;
        struct ar8xxx_priv *priv;
        struct switch_dev *swdev;
        struct device_node *mdio_node;
        int ret;
 
-       match = of_match_device(ar8xxx_mdiodev_of_match, &mdiodev->dev);
-       if (!match)
-               return -EINVAL;
-
        priv = ar8xxx_create();
        if (priv == NULL)
                return -ENOMEM;
 
        priv->mii_bus = mdiodev->bus;
        priv->pdev = &mdiodev->dev;
-       priv->chip = (const struct ar8xxx_chip *) match->data;
+       priv->chip = of_device_get_match_data(&mdiodev->dev);
 
        ret = of_property_read_u32(priv->pdev->of_node, "qca,mib-poll-interval",
                                   &priv->mib_poll_interval);
index bf7d7af5b71ae29efdfc8b16063fbf3a51cf54b4..ce93bfcd09ee18b67434c0aa8b1216153dcc7a1a 100644 (file)
@@ -23,7 +23,6 @@
 #include <linux/lockdep.h>
 #include <linux/workqueue.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/leds.h>
 #include <linux/mdio.h>
 
index fc80d772384feab2f8c522acfd9cca93a6d67511..98b49818036df7da9bdd056be23b01090ad2cd01 100644 (file)
@@ -96,7 +96,7 @@ Signed-off-by: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
  obj-$(CONFIG_QCOM_Q6V5_WCSS)          += qcom_q6v5_wcss.o
 --- /dev/null
 +++ b/drivers/remoteproc/qcom_q6v5_mpd.c
-@@ -0,0 +1,801 @@
+@@ -0,0 +1,796 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2016-2018 Linaro Ltd.
@@ -788,7 +788,6 @@ Signed-off-by: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
 +
 +static int q6_wcss_probe(struct platform_device *pdev)
 +{
-+      const struct wcss_data *desc;
 +      struct q6_wcss *wcss;
 +      struct rproc *rproc;
 +      int ret;
@@ -796,10 +795,6 @@ Signed-off-by: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
 +      struct device_node *userpd_np;
 +      const struct rproc_ops *ops = &q6_wcss_ops;
 +
-+      desc = of_device_get_match_data(&pdev->dev);
-+      if (!desc)
-+              return -EINVAL;
-+
 +      firmware = devm_kcalloc(&pdev->dev, MAX_FIRMWARE,
 +                              sizeof(*firmware), GFP_KERNEL);
 +      if (!firmware)
@@ -817,7 +812,7 @@ Signed-off-by: Manikanta Mylavarapu <quic_mmanikan@quicinc.com>
 +
 +      wcss = rproc->priv;
 +      wcss->dev = &pdev->dev;
-+      wcss->desc = desc;
++      wcss->desc = of_device_get_match_data(&pdev->dev);
 +      wcss->firmware = firmware;
 +      wcss->version = Q6_IPQ;
 +
index 4f09717cf5ddf0cc0828ffde23cf6cc2917c93a5..5f403585e0e270e35eacca530fab28e62bde951e 100644 (file)
@@ -311,9 +311,9 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
        return 0;
  
  free_rproc:
-@@ -720,7 +707,6 @@ static int q6_wcss_probe(struct platform
+@@ -715,7 +702,6 @@ static int q6_wcss_probe(struct platform
        wcss->dev = &pdev->dev;
-       wcss->desc = desc;
+       wcss->desc = of_device_get_match_data(&pdev->dev);
        wcss->firmware = firmware;
 -      wcss->version = Q6_IPQ;
  
index 42ffaab66e5b286a11daf545c10d809ca65b6688..cd73dd0f1ccb00a782ba606d9f23b22ce45e495d 100644 (file)
@@ -191,7 +191,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
        platform_set_drvdata(userpd_pdev, rproc);
        qcom_add_ssr_subdev(rproc, &upd->ssr_subdev, userpd_pdev->name);
        return 0;
-@@ -729,10 +736,10 @@ static int q6_wcss_probe(struct platform
+@@ -724,10 +731,10 @@ static int q6_wcss_probe(struct platform
  
        /* Iterate over userpd child's and register with rproc */
        for_each_available_child_of_node(pdev->dev.of_node, userpd_np) {
index 7af2567cdabab1f91e5e3274e151cb3bda76ec8c..efa485570f0b8923d3b678acf26fa94fbc2a5b52 100644 (file)
@@ -19,7 +19,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
        const struct wcss_data *desc;
        const char **firmware;
        struct userpd *upd[MAX_UPD];
-@@ -719,6 +721,16 @@ static int q6_wcss_probe(struct platform
+@@ -714,6 +716,16 @@ static int q6_wcss_probe(struct platform
        if (ret)
                goto free_rproc;
  
index 9cdf59ad21d695018d7425a30b40b7c20ad2bf25..e50417fda59f6d04c72b6ee7ad7bad3babb50202 100644 (file)
@@ -88,7 +88,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
                             wcss->mem_phys, wcss->mem_size,
                             NULL);
  }
-@@ -776,6 +800,12 @@ static void q6_wcss_remove(struct platfo
+@@ -771,6 +795,12 @@ static void q6_wcss_remove(struct platfo
        rproc_free(rproc);
  }
  
@@ -101,7 +101,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
  static const struct wcss_data q6_ipq5332_res_init = {
        .pasid = MPD_WCNSS_PAS_ID,
        .share_upd_info_to_q6 = true,
-@@ -786,6 +816,7 @@ static const struct wcss_data q6_ipq9574
+@@ -781,6 +811,7 @@ static const struct wcss_data q6_ipq9574
  };
  
  static const struct of_device_id q6_wcss_of_match[] = {
index f601377e474072e1560f93f35abb274890f6220c..2c4a7b12df8b89c77f507cc56c2237d1f26461f3 100644 (file)
@@ -144,7 +144,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
                }
        }
  
-@@ -802,13 +849,15 @@ static void q6_wcss_remove(struct platfo
+@@ -797,13 +844,15 @@ static void q6_wcss_remove(struct platfo
  
  static const struct wcss_data q6_ipq5018_res_init = {
        .pasid = MPD_WCNSS_PAS_ID,
index f062191973056918c94edc4eda1bbcd7ed5591ab..c0744d74e25c39e17a1b016ea6daccf7c2e368c5 100644 (file)
@@ -49,7 +49,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
 +obj-$(CONFIG_QCOM_APM)                += apm.o
 --- /dev/null
 +++ b/drivers/power/qcom/apm.c
-@@ -0,0 +1,941 @@
+@@ -0,0 +1,936 @@
 +/*
 + * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
 + *
@@ -893,7 +893,6 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
 +{
 +      struct device *dev = &pdev->dev;
 +      struct msm_apm_ctrl_dev *ctrl;
-+      const struct of_device_id *match;
 +      int ret = 0;
 +
 +      dev_dbg(dev, "probing MSM Array Power Mux driver\n");
@@ -903,10 +902,6 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
 +              return -ENODEV;
 +      }
 +
-+      match = of_match_device(msm_apm_match_table, dev);
-+      if (!match)
-+              return -ENODEV;
-+
 +      ctrl = devm_kzalloc(dev, sizeof(*ctrl), GFP_KERNEL);
 +      if (!ctrl) {
 +              dev_err(dev, "MSM APM controller memory allocation failed\n");
@@ -916,7 +911,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
 +      INIT_LIST_HEAD(&ctrl->list);
 +      spin_lock_init(&ctrl->lock);
 +      ctrl->dev = dev;
-+      ctrl->msm_id = (uintptr_t)match->data;
++      ctrl->msm_id = (uintptr_t)of_device_get_match_data(dev);
 +      platform_set_drvdata(pdev, ctrl);
 +
 +      switch (ctrl->msm_id) {
index a6c5c4b1673fe90f8d87fc22f909a87da7ea9608..dc1b8369b8198a47f11c98fc4f9add400470b38d 100644 (file)
@@ -77,7 +77,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
  obj-$(CONFIG_REGULATOR_PF8X00) += pf8x00-regulator.o
 --- /dev/null
 +++ b/drivers/regulator/cpr3-npu-regulator.c
-@@ -0,0 +1,694 @@
+@@ -0,0 +1,689 @@
 +/*
 + * Copyright (c) 2017, The Linux Foundation. All rights reserved.
 + *
@@ -652,8 +652,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
 +      struct device *dev = &pdev->dev;
 +      struct cpr3_controller *ctrl;
 +      int i, rc;
-+      const struct of_device_id *match;
-+      struct cpr3_reg_data *cpr_data;
++      const struct cpr3_reg_data *cpr_data;
 +
 +      if (!dev->of_node) {
 +              dev_err(dev, "Device tree node is missing\n");
@@ -665,11 +664,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
 +              return -ENOMEM;
 +      g_ctrl = ctrl;
 +
-+      match = of_match_device(cpr3_regulator_match_table, &pdev->dev);
-+      if (!match)
-+              return -ENODEV;
-+
-+      cpr_data = (struct cpr3_reg_data *)match->data;
++      cpr_data = of_device_get_match_data(&pdev->dev);
 +      g_valid_npu_fuse_count = cpr_data->cpr_valid_fuse_count;
 +      dev_info(dev, "NPU CPR valid fuse count: %d\n", g_valid_npu_fuse_count);
 +      ctrl->cpr_clock_rate = cpr_data->cpr_clk_rate;
@@ -9863,7 +9858,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
 +}
 --- /dev/null
 +++ b/drivers/regulator/cpr4-apss-regulator.c
-@@ -0,0 +1,1818 @@
+@@ -0,0 +1,1813 @@
 +/*
 + * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
 + *
@@ -11560,8 +11555,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
 +{
 +      struct device *dev = &pdev->dev;
 +      struct cpr3_controller *ctrl;
-+      const struct of_device_id *match;
-+      struct cpr4_reg_data *cpr_data;
++      const struct cpr4_reg_data *cpr_data;
 +      int i, rc;
 +
 +      if (!dev->of_node) {
@@ -11573,11 +11567,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
 +      if (!ctrl)
 +              return -ENOMEM;
 +
-+      match = of_match_device(cpr4_regulator_match_table, &pdev->dev);
-+      if (!match)
-+              return -ENODEV;
-+
-+      cpr_data = (struct cpr4_reg_data *)match->data;
++      cpr_data = of_device_get_match_data(&pdev->dev);
 +      g_valid_fuse_count = cpr_data->cpr_valid_fuse_count;
 +      dev_info(dev, "CPR valid fuse count: %d\n", g_valid_fuse_count);
 +      ctrl->cpr_clock_rate = cpr_data->cpr_clk_rate;
index 013fa88a0e63aaa8c5a719e2f025cb4b5c4db364..82d6955f8e6cd5950b726d5ccbae500cf115d883 100644 (file)
@@ -16,7 +16,6 @@
 #include <linux/irq.h>
 #include <linux/of_dma.h>
 #include <linux/reset.h>
-#include <linux/of_device.h>
 
 #include "../virt-dma.h"
 
@@ -644,7 +643,6 @@ static const struct of_device_id mtk_hsdma_of_match[] = {
 
 static int mtk_hsdma_probe(struct platform_device *pdev)
 {
-       const struct of_device_id *match;
        struct mtk_hsdma_chan *chan;
        struct mtk_hsdam_engine *hsdma;
        struct dma_device *dd;
@@ -656,10 +654,6 @@ static int mtk_hsdma_probe(struct platform_device *pdev)
        if (ret)
                return ret;
 
-       match = of_match_device(mtk_hsdma_of_match, &pdev->dev);
-       if (!match)
-               return -EINVAL;
-
        hsdma = devm_kzalloc(&pdev->dev, sizeof(*hsdma), GFP_KERNEL);
        if (!hsdma)
                return -EINVAL;
index b6458967a198930292e2f0d1c89ee5efb4cd5fb7..d92475e48f2a378e4f1b4983984366a45fcd5124 100644 (file)
@@ -15,7 +15,6 @@
 #include <linux/irq.h>
 #include <linux/of_dma.h>
 #include <linux/reset.h>
-#include <linux/of_device.h>
 
 #include "virt-dma.h"
 
@@ -118,7 +117,7 @@ struct gdma_dmaengine_chan {
 struct gdma_dma_dev {
        struct dma_device ddev;
        struct device_dma_parameters dma_parms;
-       struct gdma_data *data;
+       const struct gdma_data *data;
        void __iomem *base;
        struct tasklet_struct task;
        volatile unsigned long chan_issued;
@@ -789,7 +788,6 @@ MODULE_DEVICE_TABLE(of, gdma_of_match_table);
 
 static int gdma_dma_probe(struct platform_device *pdev)
 {
-       const struct of_device_id *match;
        struct gdma_dmaengine_chan *chan;
        struct gdma_dma_dev *dma_dev;
        struct dma_device *dd;
@@ -797,16 +795,13 @@ static int gdma_dma_probe(struct platform_device *pdev)
        int ret;
        int irq;
        void __iomem *base;
-       struct gdma_data *data;
+       const struct gdma_data *data;
 
        ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
        if (ret)
                return ret;
 
-       match = of_match_device(gdma_of_match_table, &pdev->dev);
-       if (!match)
-               return -EINVAL;
-       data = (struct gdma_data *)match->data;
+       data = of_device_get_match_data(&pdev->dev);
 
        dma_dev = devm_kzalloc(&pdev->dev,
                               struct_size(dma_dev, chan, data->chancnt),
index 3bf2c2e83cebee7fc788afa843afa9bc70cfa182..75464adf53e86772b2b0ae62dffacc71ead21935 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/kernel.h>
 #include <linux/platform_device.h>
 #include <asm/mach-ralink/ralink_regs.h>
-#include <linux/of_device.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
index f45c874eee6554d3d23e246a4dd86cc757453e3a..ebb1d44c0ef7175d5d544b5bdc870ab14ef45c33 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/platform_device.h>
-#include <linux/of_device.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
 
index 9d40dfb520098b56484b969104b80b193c51a1b3..07f092a2f8caeef24e1e515c850b108f217eac7f 100644 (file)
@@ -30,7 +30,6 @@
 #include <linux/etherdevice.h>
 #include <linux/lockdep.h>
 #include <linux/workqueue.h>
-#include <linux/of_device.h>
 #include <linux/of.h>
 #include <asm/byteorder.h>
 
index f53746eee830acdf7854e3eabe344dc59d227463..031f0728f69e8e6efbc0cecc398363388512f921 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/etherdevice.h>
 #include <linux/ethtool.h>
 #include <linux/platform_device.h>
-#include <linux/of_device.h>
 #include <linux/clk.h>
 #include <linux/of_net.h>
 #include <linux/of_mdio.h>
@@ -1523,7 +1522,6 @@ static void fe_pending_work(struct work_struct *work)
 
 static int fe_probe(struct platform_device *pdev)
 {
-       const struct of_device_id *match;
        struct fe_soc_data *soc;
        struct net_device *netdev;
        struct fe_priv *priv;
@@ -1534,9 +1532,7 @@ static int fe_probe(struct platform_device *pdev)
        if (err)
                dev_err(&pdev->dev, "failed to reset device\n");
 
-       match = of_match_device(of_fe_match, &pdev->dev);
-       soc = (struct fe_soc_data *)match->data;
-
+       soc = (struct fe_soc_data *)of_device_get_match_data(&pdev->dev);
        if (soc->reg_table)
                fe_reg_table = soc->reg_table;
        else
index d4027c904ad3f8a6425d0778587afab1a97a33e4..08edb5504aee3bd49596aa7b8ac16ed698c656f8 100644 (file)
@@ -59,7 +59,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +obj-$(CONFIG_SND_RALINK_SOC_I2S) += snd-soc-ralink-i2s.o
 --- /dev/null
 +++ b/sound/soc/ralink/ralink-i2s.c
-@@ -0,0 +1,921 @@
+@@ -0,0 +1,916 @@
 +/*
 + *  Copyright (C) 2010, Lars-Peter Clausen <lars@metafoo.de>
 + *  Copyright (C) 2016 Michael Lee <igvtee@gmail.com>
@@ -81,7 +81,6 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +#include <linux/regmap.h>
 +#include <linux/reset.h>
 +#include <linux/debugfs.h>
-+#include <linux/of_device.h>
 +#include <sound/pcm_params.h>
 +#include <sound/dmaengine_pcm.h>
 +
@@ -848,14 +847,13 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +
 +static int ralink_i2s_probe(struct platform_device *pdev)
 +{
-+      const struct of_device_id *match;
 +      struct device_node *np = pdev->dev.of_node;
 +      struct device *dev = &pdev->dev;
 +      struct resource *res;
 +      struct ralink_i2s *i2s;
 +      int irq, ret;
 +      u32 dma_req;
-+      struct rt_i2s_data *data;
++      const struct rt_i2s_data *data;
 +
 +      i2s = devm_kzalloc(dev, sizeof(*i2s), GFP_KERNEL);
 +      if (!i2s)
@@ -863,10 +861,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +
 +      i2s->dev = dev;
 +
-+      match = of_match_device(ralink_i2s_match_table, dev);
-+      if (!match)
-+              return -EINVAL;
-+      data = (struct rt_i2s_data *)match->data;
++      data = of_device_get_match_data(dev);
 +      i2s->flags = data->flags;
 +      /* setup out 12Mhz refclk to codec as mclk */
 +      if (data->refclk_setup)
index 4c0f046dc0e601a7fdcb8f7e0a0cd8a00a903535..0cb700409e6e56575e39c59887c0a177219c61e8 100644 (file)
@@ -49,7 +49,7 @@ Signed-off-by: William Qiu <william.qiu@starfivetech.com>
  obj-$(CONFIG_PWM_PXA)         += pwm-pxa.o
 --- /dev/null
 +++ b/drivers/pwm/pwm-ocores.c
-@@ -0,0 +1,230 @@
+@@ -0,0 +1,225 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * OpenCores PWM Driver
@@ -213,16 +213,11 @@ Signed-off-by: William Qiu <william.qiu@starfivetech.com>
 +
 +static int ocores_pwm_probe(struct platform_device *pdev)
 +{
-+      const struct of_device_id *id;
 +      struct device *dev = &pdev->dev;
 +      struct ocores_pwm_device *ddata;
 +      struct pwm_chip *chip;
 +      int ret;
 +
-+      id = of_match_device(ocores_pwm_of_match, dev);
-+      if (!id)
-+              return -EINVAL;
-+
 +      chip = devm_pwmchip_alloc(dev, 8, sizeof(*ddata));
 +      if (IS_ERR(chip))
 +              return PTR_ERR(chip);
@@ -230,7 +225,7 @@ Signed-off-by: William Qiu <william.qiu@starfivetech.com>
 +      chip->ops = &ocores_pwm_ops;
 +
 +      ddata = chip_to_ocores(chip);
-+      ddata->data = id->data;
++      ddata->data = of_device_get_match_data(dev);
 +
 +      ddata->regs = devm_platform_ioremap_resource(pdev, 0);
 +      if (IS_ERR(ddata->regs))
index 511e80e9ae18137a180d00417060fbb6447b2a9a..ca61b4652fcfe5adaf33bbfd106f27d9db999d39 100644 (file)
@@ -373,7 +373,7 @@ Signed-off-by: shanlong.li <shanlong.li@starfivetech.com>
 +#endif
 --- /dev/null
 +++ b/drivers/e24/starfive_e24.c
-@@ -0,0 +1,1524 @@
+@@ -0,0 +1,1522 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * e24 driver for StarFive JH7110 SoC
@@ -1863,11 +1863,9 @@ Signed-off-by: shanlong.li <shanlong.li@starfivetech.com>
 +static int e24_probe(struct platform_device *pdev)
 +{
 +      long ret = -EINVAL;
-+      const struct of_device_id *match;
-+      e24_init_function *init;
++      const e24_init_function *init;
 +
-+      match = of_match_device(e24_of_match, &pdev->dev);
-+      init = match->data;
++      init = of_device_get_match_data(&pdev->dev);
 +      ret = init(pdev);
 +
 +      return IS_ERR_VALUE(ret) ? ret : 0;