mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-22 20:30:58 +02:00
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>
This commit is contained in:
@@ -9,7 +9,9 @@
|
|||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <linux/mfd/syscon.h>
|
#include <linux/mfd/syscon.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/of_device.h>
|
#include <linux/of.h>
|
||||||
|
#include <linux/platform_device.h>
|
||||||
|
#include <linux/property.h>
|
||||||
#include <linux/regmap.h>
|
#include <linux/regmap.h>
|
||||||
#include <media/rc-core.h>
|
#include <media/rc-core.h>
|
||||||
|
|
||||||
@@ -251,7 +253,6 @@ static int hix5hd2_ir_probe(struct platform_device *pdev)
|
|||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct hix5hd2_ir_priv *priv;
|
struct hix5hd2_ir_priv *priv;
|
||||||
struct device_node *node = pdev->dev.of_node;
|
struct device_node *node = pdev->dev.of_node;
|
||||||
const struct of_device_id *of_id;
|
|
||||||
const char *map_name;
|
const char *map_name;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@@ -259,12 +260,11 @@ static int hix5hd2_ir_probe(struct platform_device *pdev)
|
|||||||
if (!priv)
|
if (!priv)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
of_id = of_match_device(hix5hd2_ir_table, dev);
|
priv->socdata = device_get_match_data(dev);
|
||||||
if (!of_id) {
|
if (!priv->socdata) {
|
||||||
dev_err(dev, "Unable to initialize IR data\n");
|
dev_err(dev, "Unable to initialize IR data\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
priv->socdata = of_id->data;
|
|
||||||
|
|
||||||
priv->regmap = syscon_regmap_lookup_by_phandle(node,
|
priv->regmap = syscon_regmap_lookup_by_phandle(node,
|
||||||
"hisilicon,power-syscon");
|
"hisilicon,power-syscon");
|
||||||
|
Reference in New Issue
Block a user