From: Javier Carrasco Date: Sun, 20 Oct 2024 04:07:41 +0000 (-0700) Subject: Input: twl4030-vibra - use cleanup facility for device_node X-Git-Tag: v6.13-rc1~95^2^2~26 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d3dcadd654aefadebe847da74059dce6cc506e6b;p=thirdparty%2Fkernel%2Flinux.git 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 Link: https://lore.kernel.org/r/20241010-input_automate_of_node_put-v1-5-ebc62138fbf8@gmail.com Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/misc/twl4030-vibra.c b/drivers/input/misc/twl4030-vibra.c index 101548b35ee31..5fa7d4a7da363 100644 --- a/drivers/input/misc/twl4030-vibra.c +++ b/drivers/input/misc/twl4030-vibra.c @@ -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)