Skip to content

Commit 05e5f73

Browse files
robherringnmenon
authored andcommitted
firmware: ti_sci: 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> Link: https://lore.kernel.org/r/20231006224638.445168-1-robh@kernel.org Signed-off-by: Nishanth Menon <nm@ti.com>
1 parent 82e83cb commit 05e5f73

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

drivers/firmware/ti_sci.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616
#include <linux/kernel.h>
1717
#include <linux/mailbox_client.h>
1818
#include <linux/module.h>
19-
#include <linux/of_device.h>
19+
#include <linux/of.h>
20+
#include <linux/of_platform.h>
21+
#include <linux/platform_device.h>
22+
#include <linux/property.h>
2023
#include <linux/semaphore.h>
2124
#include <linux/slab.h>
2225
#include <linux/soc/ti/ti-msgmgr.h>
@@ -3293,7 +3296,6 @@ MODULE_DEVICE_TABLE(of, ti_sci_of_match);
32933296
static int ti_sci_probe(struct platform_device *pdev)
32943297
{
32953298
struct device *dev = &pdev->dev;
3296-
const struct of_device_id *of_id;
32973299
const struct ti_sci_desc *desc;
32983300
struct ti_sci_xfer *xfer;
32993301
struct ti_sci_info *info = NULL;
@@ -3304,12 +3306,7 @@ static int ti_sci_probe(struct platform_device *pdev)
33043306
int reboot = 0;
33053307
u32 h_id;
33063308

3307-
of_id = of_match_device(ti_sci_of_match, dev);
3308-
if (!of_id) {
3309-
dev_err(dev, "OF data missing\n");
3310-
return -EINVAL;
3311-
}
3312-
desc = of_id->data;
3309+
desc = device_get_match_data(dev);
33133310

33143311
info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
33153312
if (!info)

0 commit comments

Comments
 (0)