diff options
author | Rob Herring <robh@kernel.org> | 2023-10-06 17:44:06 -0500 |
---|---|---|
committer | Jassi Brar <jaswinder.singh@linaro.org> | 2023-10-15 12:39:16 -0500 |
commit | 5cb5d0c964d15c14471dfbf6e66587edb5346206 (patch) | |
tree | 2ac3e4e62bf11cd39663232d3bebc2721b85046d /drivers/mailbox/ti-msgmgr.c | |
parent | 81186dc1610155fc96740a81aa4f0a8b3cbb7dfb (diff) |
mailbox: 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>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Diffstat (limited to 'drivers/mailbox/ti-msgmgr.c')
-rw-r--r-- | drivers/mailbox/ti-msgmgr.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/mailbox/ti-msgmgr.c b/drivers/mailbox/ti-msgmgr.c index a94577f16a47..9d2d4ff6cda4 100644 --- a/drivers/mailbox/ti-msgmgr.c +++ b/drivers/mailbox/ti-msgmgr.c @@ -15,10 +15,10 @@ #include <linux/kernel.h> #include <linux/mailbox_controller.h> #include <linux/module.h> -#include <linux/of_device.h> #include <linux/of.h> #include <linux/of_irq.h> #include <linux/platform_device.h> +#include <linux/property.h> #include <linux/soc/ti/ti-msgmgr.h> #define Q_DATA_OFFSET(proxy, queue, reg) \ @@ -810,7 +810,6 @@ MODULE_DEVICE_TABLE(of, ti_msgmgr_of_match); static int ti_msgmgr_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - const struct of_device_id *of_id; struct device_node *np; const struct ti_msgmgr_desc *desc; struct ti_msgmgr_inst *inst; @@ -828,19 +827,12 @@ static int ti_msgmgr_probe(struct platform_device *pdev) } np = dev->of_node; - of_id = of_match_device(ti_msgmgr_of_match, dev); - if (!of_id) { - dev_err(dev, "OF data missing\n"); - return -EINVAL; - } - desc = of_id->data; - inst = devm_kzalloc(dev, sizeof(*inst), GFP_KERNEL); if (!inst) return -ENOMEM; inst->dev = dev; - inst->desc = desc; + inst->desc = desc = device_get_match_data(dev); inst->queue_proxy_region = devm_platform_ioremap_resource_byname(pdev, desc->data_region_name); |