static int iqs62x_keys_parse_prop(struct platform_device *pdev,
                                  struct iqs62x_keys_private *iqs62x_keys)
 {
-       struct fwnode_handle *child;
        unsigned int val;
        int ret, i;
 
        }
 
        for (i = 0; i < ARRAY_SIZE(iqs62x_keys->switches); i++) {
-               child = device_get_named_child_node(&pdev->dev,
+               struct fwnode_handle *child __free(fwnode_handle) =
+                       device_get_named_child_node(&pdev->dev,
                                                    iqs62x_switch_names[i]);
                if (!child)
                        continue;
                if (ret) {
                        dev_err(&pdev->dev, "Failed to read switch code: %d\n",
                                ret);
-                       fwnode_handle_put(child);
                        return ret;
                }
                iqs62x_keys->switches[i].code = val;
                        iqs62x_keys->switches[i].flag = (i == IQS62X_SW_HALL_N ?
                                                         IQS62X_EVENT_HALL_N_T :
                                                         IQS62X_EVENT_HALL_S_T);
-
-               fwnode_handle_put(child);
        }
 
        return 0;