Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipmi: si: 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>
Message-Id: <20231115210230.3744198-1-robh@kernel.org>
Signed-off-by: Corey Minyard <minyard@acm.org>

authored by

Rob Herring and committed by
Corey Minyard
5be50eb5 ceb6a6f0

+4 -8
+4 -8
drivers/char/ipmi/ipmi_si_platform.c
··· 11 11 12 12 #include <linux/types.h> 13 13 #include <linux/module.h> 14 - #include <linux/of_device.h> 15 - #include <linux/of_platform.h> 14 + #include <linux/of.h> 16 15 #include <linux/of_address.h> 17 16 #include <linux/of_irq.h> 17 + #include <linux/platform_device.h> 18 + #include <linux/property.h> 18 19 #include <linux/acpi.h> 19 20 #include "ipmi_si.h" 20 21 #include "ipmi_dmi.h" ··· 225 224 226 225 static int of_ipmi_probe(struct platform_device *pdev) 227 226 { 228 - const struct of_device_id *match; 229 227 struct si_sm_io io; 230 228 struct resource resource; 231 229 const __be32 *regsize, *regspacing, *regshift; ··· 236 236 return -ENODEV; 237 237 238 238 dev_info(&pdev->dev, "probing via device tree\n"); 239 - 240 - match = of_match_device(of_ipmi_match, &pdev->dev); 241 - if (!match) 242 - return -ENODEV; 243 239 244 240 if (!of_device_is_available(np)) 245 241 return -EINVAL; ··· 265 269 } 266 270 267 271 memset(&io, 0, sizeof(io)); 268 - io.si_type = (unsigned long) match->data; 272 + io.si_type = (enum si_type)device_get_match_data(&pdev->dev); 269 273 io.addr_source = SI_DEVICETREE; 270 274 io.irq_setup = ipmi_std_irq_setup; 271 275