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

media: ir-hix5hd2: 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: Sean Young <sean@mess.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>

authored by

Rob Herring and committed by
Hans Verkuil
7d21a2df 26dde1be

+5 -5
+5 -5
drivers/media/rc/ir-hix5hd2.c
··· 9 9 #include <linux/interrupt.h> 10 10 #include <linux/mfd/syscon.h> 11 11 #include <linux/module.h> 12 - #include <linux/of_device.h> 12 + #include <linux/of.h> 13 + #include <linux/platform_device.h> 14 + #include <linux/property.h> 13 15 #include <linux/regmap.h> 14 16 #include <media/rc-core.h> 15 17 ··· 253 251 struct device *dev = &pdev->dev; 254 252 struct hix5hd2_ir_priv *priv; 255 253 struct device_node *node = pdev->dev.of_node; 256 - const struct of_device_id *of_id; 257 254 const char *map_name; 258 255 int ret; 259 256 ··· 260 259 if (!priv) 261 260 return -ENOMEM; 262 261 263 - of_id = of_match_device(hix5hd2_ir_table, dev); 264 - if (!of_id) { 262 + priv->socdata = device_get_match_data(dev); 263 + if (!priv->socdata) { 265 264 dev_err(dev, "Unable to initialize IR data\n"); 266 265 return -ENODEV; 267 266 } 268 - priv->socdata = of_id->data; 269 267 270 268 priv->regmap = syscon_regmap_lookup_by_phandle(node, 271 269 "hisilicon,power-syscon");