Skip to content

Commit 469d317

Browse files
robherringsre
authored andcommitted
power: reset: vexpress: 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> Acked-by: Sudeep Holla <sudeep.holla@arm.com> Link: https://lore.kernel.org/r/20231009172923.2457844-19-robh@kernel.org Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
1 parent e186bd1 commit 469d317

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

drivers/power/reset/vexpress-poweroff.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#include <linux/delay.h>
88
#include <linux/notifier.h>
99
#include <linux/of.h>
10-
#include <linux/of_device.h>
1110
#include <linux/platform_device.h>
11+
#include <linux/property.h>
1212
#include <linux/reboot.h>
1313
#include <linux/stat.h>
1414
#include <linux/vexpress.h>
@@ -108,20 +108,17 @@ static int _vexpress_register_restart_handler(struct device *dev)
108108

109109
static int vexpress_reset_probe(struct platform_device *pdev)
110110
{
111-
const struct of_device_id *match =
112-
of_match_device(vexpress_reset_of_match, &pdev->dev);
111+
enum vexpress_reset_func func;
113112
struct regmap *regmap;
114113
int ret = 0;
115114

116-
if (!match)
117-
return -EINVAL;
118-
119115
regmap = devm_regmap_init_vexpress_config(&pdev->dev);
120116
if (IS_ERR(regmap))
121117
return PTR_ERR(regmap);
122118
dev_set_drvdata(&pdev->dev, regmap);
123119

124-
switch ((uintptr_t)match->data) {
120+
func = (uintptr_t)device_get_match_data(&pdev->dev);
121+
switch (func) {
125122
case FUNC_SHUTDOWN:
126123
vexpress_power_off_device = &pdev->dev;
127124
pm_power_off = vexpress_power_off;

0 commit comments

Comments
 (0)