Skip to content

Commit cf37f16

Browse files
glneosre
authored andcommitted
power: reset: brcmstb: Use device_get_match_data() for matching
Use device_get_match_data() for finding the matching node and fetching the match data all in one. Signed-off-by: Andrew Davis <[email protected]> Acked-by: Florian Fainelli <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 0174d12 commit cf37f16

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

drivers/power/reset/brcmstb-reboot.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -83,24 +83,16 @@ static const struct reset_reg_mask reset_bits_65nm = {
8383
.sw_mstr_rst_mask = BIT(31),
8484
};
8585

86-
static const struct of_device_id of_match[] = {
87-
{ .compatible = "brcm,brcmstb-reboot", .data = &reset_bits_40nm },
88-
{ .compatible = "brcm,bcm7038-reboot", .data = &reset_bits_65nm },
89-
{},
90-
};
91-
9286
static int brcmstb_reboot_probe(struct platform_device *pdev)
9387
{
9488
int rc;
9589
struct device_node *np = pdev->dev.of_node;
96-
const struct of_device_id *of_id;
9790

98-
of_id = of_match_node(of_match, np);
99-
if (!of_id) {
100-
pr_err("failed to look up compatible string\n");
91+
reset_masks = device_get_match_data(&pdev->dev);
92+
if (!reset_masks) {
93+
pr_err("failed to get match data\n");
10194
return -EINVAL;
10295
}
103-
reset_masks = of_id->data;
10496

10597
regmap = syscon_regmap_lookup_by_phandle(np, "syscon");
10698
if (IS_ERR(regmap)) {
@@ -130,6 +122,12 @@ static int brcmstb_reboot_probe(struct platform_device *pdev)
130122
return rc;
131123
}
132124

125+
static const struct of_device_id of_match[] = {
126+
{ .compatible = "brcm,brcmstb-reboot", .data = &reset_bits_40nm },
127+
{ .compatible = "brcm,bcm7038-reboot", .data = &reset_bits_65nm },
128+
{},
129+
};
130+
133131
static struct platform_driver brcmstb_reboot_driver = {
134132
.probe = brcmstb_reboot_probe,
135133
.driver = {

0 commit comments

Comments
 (0)