Skip to content

Commit 7d60a2b

Browse files
krzklag-linaro
authored andcommitted
mfd: core: Simplify storing device_node in mfd_match_of_node_to_dev()
of_node_get() returns the same pointer it received and canonical form of storing device_node is to use of_node_get() in the assignment. Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Link: https://patch.msgid.link/20251224124456.208529-4-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Lee Jones <lee@kernel.org>
1 parent cd18e9a commit 7d60a2b

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

drivers/mfd/mfd-core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,10 @@ static int mfd_match_of_node_to_dev(struct platform_device *pdev,
130130
return -ENOMEM;
131131

132132
of_entry->dev = &pdev->dev;
133-
of_entry->np = np;
133+
of_entry->np = of_node_get(np);
134134
scoped_guard(mutex, &mfd_of_node_mutex)
135135
list_add_tail(&of_entry->list, &mfd_of_node_list);
136136

137-
of_node_get(np);
138137
device_set_node(&pdev->dev, of_fwnode_handle(np));
139138
return 0;
140139
}

0 commit comments

Comments
 (0)