mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-29 17:22:07 +00:00
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>
This commit is contained in:
parent
81186dc161
commit
5cb5d0c964
@ -33,10 +33,9 @@
|
|||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <linux/wait.h>
|
#include <linux/wait.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
|
#include <linux/property.h>
|
||||||
#include <linux/io.h>
|
#include <linux/io.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
#include <linux/of_device.h>
|
|
||||||
#include <linux/of_address.h>
|
|
||||||
#include <linux/of_irq.h>
|
#include <linux/of_irq.h>
|
||||||
#include <linux/mailbox_controller.h>
|
#include <linux/mailbox_controller.h>
|
||||||
#include <linux/mailbox/brcm-message.h>
|
#include <linux/mailbox/brcm-message.h>
|
||||||
@ -1494,7 +1493,6 @@ static int pdc_dt_read(struct platform_device *pdev, struct pdc_state *pdcs)
|
|||||||
{
|
{
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct device_node *dn = pdev->dev.of_node;
|
struct device_node *dn = pdev->dev.of_node;
|
||||||
const struct of_device_id *match;
|
|
||||||
const int *hw_type;
|
const int *hw_type;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
@ -1509,11 +1507,9 @@ static int pdc_dt_read(struct platform_device *pdev, struct pdc_state *pdcs)
|
|||||||
|
|
||||||
pdcs->hw_type = PDC_HW;
|
pdcs->hw_type = PDC_HW;
|
||||||
|
|
||||||
match = of_match_device(of_match_ptr(pdc_mbox_of_match), dev);
|
hw_type = device_get_match_data(dev);
|
||||||
if (match != NULL) {
|
if (hw_type)
|
||||||
hw_type = match->data;
|
|
||||||
pdcs->hw_type = *hw_type;
|
pdcs->hw_type = *hw_type;
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
#include <linux/mailbox_controller.h>
|
#include <linux/mailbox_controller.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
#include <linux/of_device.h>
|
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
|
#include <linux/property.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
|
||||||
#include "mailbox.h"
|
#include "mailbox.h"
|
||||||
@ -403,7 +403,6 @@ MODULE_DEVICE_TABLE(of, sti_mailbox_match);
|
|||||||
|
|
||||||
static int sti_mbox_probe(struct platform_device *pdev)
|
static int sti_mbox_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
const struct of_device_id *match;
|
|
||||||
struct mbox_controller *mbox;
|
struct mbox_controller *mbox;
|
||||||
struct sti_mbox_device *mdev;
|
struct sti_mbox_device *mdev;
|
||||||
struct device_node *np = pdev->dev.of_node;
|
struct device_node *np = pdev->dev.of_node;
|
||||||
@ -411,12 +410,11 @@ static int sti_mbox_probe(struct platform_device *pdev)
|
|||||||
int irq;
|
int irq;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
match = of_match_device(sti_mailbox_match, &pdev->dev);
|
pdev->dev.platform_data = (struct sti_mbox_pdata *)device_get_match_data(&pdev->dev);
|
||||||
if (!match) {
|
if (!pdev->dev.platform_data) {
|
||||||
dev_err(&pdev->dev, "No configuration found\n");
|
dev_err(&pdev->dev, "No configuration found\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
pdev->dev.platform_data = (struct sti_mbox_pdata *) match->data;
|
|
||||||
|
|
||||||
mdev = devm_kzalloc(&pdev->dev, sizeof(*mdev), GFP_KERNEL);
|
mdev = devm_kzalloc(&pdev->dev, sizeof(*mdev), GFP_KERNEL);
|
||||||
if (!mdev)
|
if (!mdev)
|
||||||
|
@ -15,10 +15,10 @@
|
|||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/mailbox_controller.h>
|
#include <linux/mailbox_controller.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/of_device.h>
|
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
#include <linux/of_irq.h>
|
#include <linux/of_irq.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
|
#include <linux/property.h>
|
||||||
#include <linux/soc/ti/ti-msgmgr.h>
|
#include <linux/soc/ti/ti-msgmgr.h>
|
||||||
|
|
||||||
#define Q_DATA_OFFSET(proxy, queue, reg) \
|
#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)
|
static int ti_msgmgr_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
const struct of_device_id *of_id;
|
|
||||||
struct device_node *np;
|
struct device_node *np;
|
||||||
const struct ti_msgmgr_desc *desc;
|
const struct ti_msgmgr_desc *desc;
|
||||||
struct ti_msgmgr_inst *inst;
|
struct ti_msgmgr_inst *inst;
|
||||||
@ -828,19 +827,12 @@ static int ti_msgmgr_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
np = dev->of_node;
|
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);
|
inst = devm_kzalloc(dev, sizeof(*inst), GFP_KERNEL);
|
||||||
if (!inst)
|
if (!inst)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
inst->dev = dev;
|
inst->dev = dev;
|
||||||
inst->desc = desc;
|
inst->desc = desc = device_get_match_data(dev);
|
||||||
|
|
||||||
inst->queue_proxy_region =
|
inst->queue_proxy_region =
|
||||||
devm_platform_ioremap_resource_byname(pdev, desc->data_region_name);
|
devm_platform_ioremap_resource_byname(pdev, desc->data_region_name);
|
||||||
|
Loading…
Reference in New Issue
Block a user