mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-28 06:44:36 -05:00
Input: twl4030-vibra - use cleanup facility for device_node
Use the '__free(device_node)' macro to simplify the code by automatically freeing the device node. Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Link: https://lore.kernel.org/r/20241010-input_automate_of_node_put-v1-5-ebc62138fbf8@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
committed by
Dmitry Torokhov
parent
0ba9d3a597
commit
d3dcadd654
@@ -165,15 +165,10 @@ static DEFINE_SIMPLE_DEV_PM_OPS(twl4030_vibra_pm_ops,
|
||||
|
||||
static bool twl4030_vibra_check_coexist(struct device_node *parent)
|
||||
{
|
||||
struct device_node *node;
|
||||
struct device_node *node __free(device_node) =
|
||||
of_get_child_by_name(parent, "codec");
|
||||
|
||||
node = of_get_child_by_name(parent, "codec");
|
||||
if (node) {
|
||||
of_node_put(node);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return node != NULL;
|
||||
}
|
||||
|
||||
static int twl4030_vibra_probe(struct platform_device *pdev)
|
||||
|
||||
Reference in New Issue
Block a user