Pārlūkot izejas kodu

treewide: use of_device_get_match_data

Simplifies code slightly.

Signed-off-by: Rosen Penev <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/21599
Signed-off-by: Hauke Mehrtens <[email protected]>
Rosen Penev 2 mēneši atpakaļ
vecāks
revīzija
c1fa85f659
21 mainītis faili ar 35 papildinājumiem un 98 dzēšanām
  1. 1 1
      package/kernel/lantiq/ltq-atm/Makefile
  2. 3 10
      package/kernel/lantiq/ltq-atm/src/ltq_atm.c
  3. 2 7
      target/linux/generic/files/drivers/net/phy/ar8216.c
  4. 0 1
      target/linux/generic/files/drivers/net/phy/ar8327.c
  5. 2 7
      target/linux/qualcommax/patches-6.12/0805-remoteproc-qcom-Add-Hexagon-based-multipd-rproc-driv.patch
  6. 2 2
      target/linux/qualcommax/patches-6.12/0806-rproc-qcom_q6v5_mpd-split-q6_wcss-to-rootpd-and-user.patch
  7. 1 1
      target/linux/qualcommax/patches-6.12/0807-remoteproc-qcom_q6v5_mpd-fix-incorrent-use-of-rproc-.patch
  8. 1 1
      target/linux/qualcommax/patches-6.12/0813-remoteproc-qcom_q6v5_mpd-enable-clocks.patch
  9. 2 2
      target/linux/qualcommax/patches-6.12/0814-remoteproc-qcom_q6v5_mpd-support-ipq5018.patch
  10. 1 1
      target/linux/qualcommax/patches-6.12/0815-remoteproc-qcom_q6v5_mpd-add-support-for-passing-v1-bootargs.patch
  11. 2 7
      target/linux/qualcommax/patches-6.12/0900-power-Add-Qualcomm-APM.patch
  12. 6 16
      target/linux/qualcommax/patches-6.12/0901-regulator-add-Qualcomm-CPR-regulators.patch
  13. 0 6
      target/linux/ramips/files/drivers/dma/mediatek/hsdma-mt7621.c
  14. 3 8
      target/linux/ramips/files/drivers/dma/ralink-gdma.c
  15. 0 1
      target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c
  16. 0 1
      target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c
  17. 0 1
      target/linux/ramips/files/drivers/net/ethernet/ralink/mt7530.c
  18. 1 5
      target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c
  19. 3 8
      target/linux/ramips/patches-6.12/835-asoc-add-mt7620-support.patch
  20. 2 7
      target/linux/starfive/patches-6.12/0003-pwm-opencores-Add-PWM-driver-support.patch
  21. 3 5
      target/linux/starfive/patches-6.12/0018-driver-e24-add-e24-driver.patch

+ 1 - 1
package/kernel/lantiq/ltq-atm/Makefile

@@ -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 <[email protected]>
 PKG_LICENSE:=GPL-2.0+

+ 3 - 10
package/kernel/lantiq/ltq-atm/src/ltq_atm.c

@@ -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;

+ 2 - 7
target/linux/generic/files/drivers/net/phy/ar8216.c

@@ -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);

+ 0 - 1
target/linux/generic/files/drivers/net/phy/ar8327.c

@@ -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>
 

+ 2 - 7
target/linux/qualcommax/patches-6.12/0805-remoteproc-qcom-Add-Hexagon-based-multipd-rproc-driv.patch

@@ -96,7 +96,7 @@ Signed-off-by: Manikanta Mylavarapu <[email protected]>
  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 <[email protected]>
 +
 +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 <[email protected]>
 +	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 <[email protected]>
 +
 +	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;
 +

+ 2 - 2
target/linux/qualcommax/patches-6.12/0806-rproc-qcom_q6v5_mpd-split-q6_wcss-to-rootpd-and-user.patch

@@ -311,9 +311,9 @@ Signed-off-by: George Moussalem <[email protected]>
  	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;
  

+ 1 - 1
target/linux/qualcommax/patches-6.12/0807-remoteproc-qcom_q6v5_mpd-fix-incorrent-use-of-rproc-.patch

@@ -191,7 +191,7 @@ Signed-off-by: Ziyang Huang <[email protected]>
  	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) {

+ 1 - 1
target/linux/qualcommax/patches-6.12/0813-remoteproc-qcom_q6v5_mpd-enable-clocks.patch

@@ -19,7 +19,7 @@ Signed-off-by: Ziyang Huang <[email protected]>
  	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;
  

+ 2 - 2
target/linux/qualcommax/patches-6.12/0814-remoteproc-qcom_q6v5_mpd-support-ipq5018.patch

@@ -88,7 +88,7 @@ Signed-off-by: Ziyang Huang <[email protected]>
  			     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 <[email protected]>
  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[] = {

+ 1 - 1
target/linux/qualcommax/patches-6.12/0815-remoteproc-qcom_q6v5_mpd-add-support-for-passing-v1-bootargs.patch

@@ -144,7 +144,7 @@ Signed-off-by: George Moussalem <[email protected]>
  		}
  	}
  
-@@ -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,

+ 2 - 7
target/linux/qualcommax/patches-6.12/0900-power-Add-Qualcomm-APM.patch

@@ -49,7 +49,7 @@ Signed-off-by: Robert Marko <[email protected]>
 +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 <[email protected]>
 +{
 +	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 <[email protected]>
 +		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 <[email protected]>
 +	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) {

+ 6 - 16
target/linux/qualcommax/patches-6.12/0901-regulator-add-Qualcomm-CPR-regulators.patch

@@ -77,7 +77,7 @@ Signed-off-by: Robert Marko <[email protected]>
  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 <[email protected]>
 +	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 <[email protected]>
 +		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 <[email protected]>
 +}
 --- /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 <[email protected]>
 +{
 +	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 <[email protected]>
 +	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;

+ 0 - 6
target/linux/ramips/files/drivers/dma/mediatek/hsdma-mt7621.c

@@ -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;

+ 3 - 8
target/linux/ramips/files/drivers/dma/ralink-gdma.c

@@ -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),

+ 0 - 1
target/linux/ramips/files/drivers/net/ethernet/ralink/esw_rt3050.c

@@ -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>
 

+ 0 - 1
target/linux/ramips/files/drivers/net/ethernet/ralink/gsw_mt7620.c

@@ -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>
 

+ 0 - 1
target/linux/ramips/files/drivers/net/ethernet/ralink/mt7530.c

@@ -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>
 

+ 1 - 5
target/linux/ramips/files/drivers/net/ethernet/ralink/mtk_eth_soc.c

@@ -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

+ 3 - 8
target/linux/ramips/patches-6.12/835-asoc-add-mt7620-support.patch

@@ -59,7 +59,7 @@ Signed-off-by: John Crispin <[email protected]>
 +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 <[email protected]>
 + *  Copyright (C) 2016 Michael Lee <[email protected]>
@@ -81,7 +81,6 @@ Signed-off-by: John Crispin <[email protected]>
 +#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 <[email protected]>
 +
 +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 <[email protected]>
 +
 +	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)

+ 2 - 7
target/linux/starfive/patches-6.12/0003-pwm-opencores-Add-PWM-driver-support.patch

@@ -49,7 +49,7 @@ Signed-off-by: William Qiu <[email protected]>
  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 <[email protected]>
 +
 +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 <[email protected]>
 +	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))

+ 3 - 5
target/linux/starfive/patches-6.12/0018-driver-e24-add-e24-driver.patch

@@ -373,7 +373,7 @@ Signed-off-by: shanlong.li <[email protected]>
 +#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 <[email protected]>
 +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;