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+
#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>
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();
goto INIT_PRIV_DATA_FAIL;
}
+ ops = of_device_get_match_data(&pdev->dev);
ret = ops->init(pdev);
if (ret)
return ret;
#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>
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);
#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>
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.
+
+static int q6_wcss_probe(struct platform_device *pdev)
+{
-+ const struct wcss_data *desc;
+ struct q6_wcss *wcss;
+ struct rproc *rproc;
+ int ret;
+ 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)
+
+ 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;
+
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;
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) {
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;
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);
}
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[] = {
}
}
-@@ -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,
+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.
+ *
+{
+ 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");
+ 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");
+ 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) {
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.
+ *
+ 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");
+ 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;
+}
--- /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.
+ *
+{
+ 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) {
+ 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;
#include <linux/irq.h>
#include <linux/of_dma.h>
#include <linux/reset.h>
-#include <linux/of_device.h>
#include "../virt-dma.h"
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;
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;
#include <linux/irq.h>
#include <linux/of_dma.h>
#include <linux/reset.h>
-#include <linux/of_device.h>
#include "virt-dma.h"
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;
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;
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),
#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>
#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>
#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>
#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>
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;
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
+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>
+#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>
+
+
+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)
+
+ 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)
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
+
+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);
+ 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))
+#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
+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;