diff options
author | Rob Herring <[email protected]> | 2023-10-06 17:46:33 -0500 |
---|---|---|
committer | Xu Yilun <[email protected]> | 2023-10-13 23:17:16 +0800 |
commit | 4e807eb05dff41d500822f81744ec5f9c0591aa5 (patch) | |
tree | 7daf6c659450fdcc7a8c31639a10029cd0696a86 /drivers/fpga/altera-hps2fpga.c | |
parent | 6465e260f48790807eef06b583b38ca9789b6072 (diff) |
fpga: 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.
Also drop of_match_ptr for xlnx_pr_decoupler_of_match, which is not
necessary because DT is always used for this driver.
Signed-off-by: Rob Herring <[email protected]>
Acked-by: Xu Yilun <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[[email protected]: merge the fix [email protected]]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Xu Yilun <[email protected]>
Diffstat (limited to 'drivers/fpga/altera-hps2fpga.c')
-rw-r--r-- | drivers/fpga/altera-hps2fpga.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/fpga/altera-hps2fpga.c b/drivers/fpga/altera-hps2fpga.c index aa758426c22b..578663503297 100644 --- a/drivers/fpga/altera-hps2fpga.c +++ b/drivers/fpga/altera-hps2fpga.c @@ -24,7 +24,8 @@ #include <linux/kernel.h> #include <linux/mfd/syscon.h> #include <linux/module.h> -#include <linux/of_platform.h> +#include <linux/of.h> +#include <linux/property.h> #include <linux/regmap.h> #include <linux/reset.h> #include <linux/spinlock.h> @@ -127,18 +128,11 @@ static int alt_fpga_bridge_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct altera_hps2fpga_data *priv; - const struct of_device_id *of_id; struct fpga_bridge *br; u32 enable; int ret; - of_id = of_match_device(altera_fpga_of_match, dev); - if (!of_id) { - dev_err(dev, "failed to match device\n"); - return -ENODEV; - } - - priv = (struct altera_hps2fpga_data *)of_id->data; + priv = (struct altera_hps2fpga_data *)device_get_match_data(dev); priv->bridge_reset = of_reset_control_get_exclusive_by_index(dev->of_node, 0); |