summaryrefslogtreecommitdiff
path: root/drivers/mailbox/bcm-pdc-mailbox.c
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-10-06 17:44:06 -0500
committerJassi Brar <jaswinder.singh@linaro.org>2023-10-15 12:39:16 -0500
commit5cb5d0c964d15c14471dfbf6e66587edb5346206 (patch)
tree2ac3e4e62bf11cd39663232d3bebc2721b85046d /drivers/mailbox/bcm-pdc-mailbox.c
parent81186dc1610155fc96740a81aa4f0a8b3cbb7dfb (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/bcm-pdc-mailbox.c')
-rw-r--r--drivers/mailbox/bcm-pdc-mailbox.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/mailbox/bcm-pdc-mailbox.c b/drivers/mailbox/bcm-pdc-mailbox.c
index d67db63b482d..778faeced81e 100644
--- a/drivers/mailbox/bcm-pdc-mailbox.c
+++ b/drivers/mailbox/bcm-pdc-mailbox.c
@@ -33,10 +33,9 @@
#include <linux/interrupt.h>
#include <linux/wait.h>
#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/io.h>
#include <linux/of.h>
-#include <linux/of_device.h>
-#include <linux/of_address.h>
#include <linux/of_irq.h>
#include <linux/mailbox_controller.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_node *dn = pdev->dev.of_node;
- const struct of_device_id *match;
const int *hw_type;
int err;
@@ -1509,11 +1507,9 @@ static int pdc_dt_read(struct platform_device *pdev, struct pdc_state *pdcs)
pdcs->hw_type = PDC_HW;
- match = of_match_device(of_match_ptr(pdc_mbox_of_match), dev);
- if (match != NULL) {
- hw_type = match->data;
+ hw_type = device_get_match_data(dev);
+ if (hw_type)
pdcs->hw_type = *hw_type;
- }
return 0;
}