summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorMinghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>2022-03-07 03:36:31 +0000
committerGuenter Roeck <linux@roeck-us.net>2022-03-08 09:15:22 -0800
commit92abe50490d36ac2ee56f63db24adee219ed63c5 (patch)
tree733c8c73c501b4bfeb783bfed759c416c9a9cc63 /drivers/hwmon
parent007e433cf0373334a2bef1b0c9831647184906ba (diff)
hwmon: (vexpress-hwmon) Use of_device_get_match_data()
Use of_device_get_match_data() to simplify the code. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn> Link: https://lore.kernel.org/r/20220307033631.2075160-1-chi.minghao@zte.com.cn Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/vexpress-hwmon.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/hwmon/vexpress-hwmon.c b/drivers/hwmon/vexpress-hwmon.c
index 44d798be3d59..2ac5fb96bba4 100644
--- a/drivers/hwmon/vexpress-hwmon.c
+++ b/drivers/hwmon/vexpress-hwmon.c
@@ -207,7 +207,6 @@ MODULE_DEVICE_TABLE(of, vexpress_hwmon_of_match);
static int vexpress_hwmon_probe(struct platform_device *pdev)
{
- const struct of_device_id *match;
struct vexpress_hwmon_data *data;
const struct vexpress_hwmon_type *type;
@@ -216,10 +215,9 @@ static int vexpress_hwmon_probe(struct platform_device *pdev)
return -ENOMEM;
platform_set_drvdata(pdev, data);
- match = of_match_device(vexpress_hwmon_of_match, &pdev->dev);
- if (!match)
+ type = of_device_get_match_data(&pdev->dev);
+ if (!type)
return -ENODEV;
- type = match->data;
data->reg = devm_regmap_init_vexpress_config(&pdev->dev);
if (IS_ERR(data->reg))