summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2023-10-20 16:02:56 +0300
committerThomas Gleixner <tglx@linutronix.de>2023-10-27 10:15:44 +0300
commit08d4c174828d868d314d2475fbcaa1393f0bbba9 (patch)
treedef8a6d2bbaa6b090e72e38e15c7e45e63ac3212 /drivers
parent5e7afb2eb7b2a7c81e9f608cbdf74a07606fd1b5 (diff)
downloadlinux-08d4c174828d868d314d2475fbcaa1393f0bbba9.tar.xz
irqchip/ls-scfg-msi: Use device_get_match_data()
Use preferred device_get_match_data() instead of of_match_device() to get the driver match data in a single step without the unnecessary intermediate match pointer. With this, adjust the includes to explicitly include the correct headers. That also serves as preparation to remove implicit includes within the DT headers. of_platform.h currently includes platform_device.h among others. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://lore.kernel.org/r/20231020130255.2954415-3-robh@kernel.org
Diffstat (limited to 'drivers')
-rw-r--r--drivers/irqchip/irq-ls-scfg-msi.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/irqchip/irq-ls-scfg-msi.c b/drivers/irqchip/irq-ls-scfg-msi.c
index f31a262fe438..15cf80b46322 100644
--- a/drivers/irqchip/irq-ls-scfg-msi.c
+++ b/drivers/irqchip/irq-ls-scfg-msi.c
@@ -17,7 +17,8 @@
#include <linux/irqdomain.h>
#include <linux/of_irq.h>
#include <linux/of_pci.h>
-#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/spinlock.h>
#define MSI_IRQS_PER_MSIR 32
@@ -334,20 +335,17 @@ MODULE_DEVICE_TABLE(of, ls_scfg_msi_id);
static int ls_scfg_msi_probe(struct platform_device *pdev)
{
- const struct of_device_id *match;
struct ls_scfg_msi *msi_data;
struct resource *res;
int i, ret;
- match = of_match_device(ls_scfg_msi_id, &pdev->dev);
- if (!match)
- return -ENODEV;
-
msi_data = devm_kzalloc(&pdev->dev, sizeof(*msi_data), GFP_KERNEL);
if (!msi_data)
return -ENOMEM;
- msi_data->cfg = (struct ls_scfg_msi_cfg *) match->data;
+ msi_data->cfg = (struct ls_scfg_msi_cfg *)device_get_match_data(&pdev->dev);
+ if (!msi_data->cfg)
+ return -ENODEV;
msi_data->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(msi_data->regs)) {