usb: typec: qcom-pmic-typec: use fwnode_handle_put() to release fwnodes
authorJavier Carrasco <javier.carrasco.cruz@gmail.com>
Sun, 20 Oct 2024 12:56:34 +0000 (14:56 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Nov 2024 15:28:22 +0000 (16:28 +0100)
commit 7f02b8a5b602098f2901166e7e4d583acaed872a upstream.

The right function to release a fwnode acquired via
device_get_named_child_node() is fwnode_handle_put(), and not
fwnode_remove_software_node(), as no software node is being handled.

Replace the calls to fwnode_remove_software_node() with
fwnode_handle_put() in qcom_pmic_typec_probe() and
qcom_pmic_typec_remove().

Cc: stable@vger.kernel.org
Fixes: a4422ff22142 ("usb: typec: qcom: Add Qualcomm PMIC Type-C driver")
Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Acked-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20241020-qcom_pmic_typec-fwnode_remove-v2-1-7054f3d2e215@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c

index 581199d37b49daaceb130b378a9e690ab8233c5d..5f67925a19d3b84b64fefca80f1044cf4a4a1784 100644 (file)
@@ -268,7 +268,7 @@ static int qcom_pmic_typec_probe(struct platform_device *pdev)
        return 0;
 
 fwnode_remove:
-       fwnode_remove_software_node(tcpm->tcpc.fwnode);
+       fwnode_handle_put(tcpm->tcpc.fwnode);
 
        return ret;
 }
@@ -280,7 +280,7 @@ static void qcom_pmic_typec_remove(struct platform_device *pdev)
        qcom_pmic_typec_pdphy_stop(tcpm->pmic_typec_pdphy);
        qcom_pmic_typec_port_stop(tcpm->pmic_typec_port);
        tcpm_unregister_port(tcpm->tcpm_port);
-       fwnode_remove_software_node(tcpm->tcpc.fwnode);
+       fwnode_handle_put(tcpm->tcpc.fwnode);
 }
 
 static struct pmic_typec_pdphy_resources pm8150b_pdphy_res = {