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/mailbox-sti.c | |
parent | 81186dc1610155fc96740a81aa4f0a8b3cbb7dfb (diff) | |
download | lwn-5cb5d0c964d15c14471dfbf6e66587edb5346206.tar.gz lwn-5cb5d0c964d15c14471dfbf6e66587edb5346206.zip |
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/mailbox-sti.c')
-rw-r--r-- | drivers/mailbox/mailbox-sti.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/mailbox/mailbox-sti.c b/drivers/mailbox/mailbox-sti.c index 823061dd8c8e..b4b5bdd503cf 100644 --- a/drivers/mailbox/mailbox-sti.c +++ b/drivers/mailbox/mailbox-sti.c @@ -17,8 +17,8 @@ #include <linux/mailbox_controller.h> #include <linux/module.h> #include <linux/of.h> -#include <linux/of_device.h> #include <linux/platform_device.h> +#include <linux/property.h> #include <linux/slab.h> #include "mailbox.h" @@ -403,7 +403,6 @@ MODULE_DEVICE_TABLE(of, sti_mailbox_match); static int sti_mbox_probe(struct platform_device *pdev) { - const struct of_device_id *match; struct mbox_controller *mbox; struct sti_mbox_device *mdev; struct device_node *np = pdev->dev.of_node; @@ -411,12 +410,11 @@ static int sti_mbox_probe(struct platform_device *pdev) int irq; int ret; - match = of_match_device(sti_mailbox_match, &pdev->dev); - if (!match) { + pdev->dev.platform_data = (struct sti_mbox_pdata *)device_get_match_data(&pdev->dev); + if (!pdev->dev.platform_data) { dev_err(&pdev->dev, "No configuration found\n"); return -ENODEV; } - pdev->dev.platform_data = (struct sti_mbox_pdata *) match->data; mdev = devm_kzalloc(&pdev->dev, sizeof(*mdev), GFP_KERNEL); if (!mdev) |