Re: [PATCH 10/10] soc: qcom: ubwc: Use __cleanup() for device_node pointers

From: Krzysztof Kozlowski
Date: Tue Nov 18 2025 - 06:44:28 EST


On 17/11/2025 05:51, Kathiravan Thirumoorthy wrote:
> Apply the __cleanup() attribute to device_node pointers to simplify
> resource management and remove explicit of_node_put() calls.
>
> Signed-off-by: Kathiravan Thirumoorthy <kathiravan.thirumoorthy@xxxxxxxxxxxxxxxx>
> ---
> drivers/soc/qcom/ubwc_config.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/soc/qcom/ubwc_config.c b/drivers/soc/qcom/ubwc_config.c
> index 1c09796163b09a19e387c18886966514cc19b209..1e7717aba5236050d8e736fb0891534b02203aae 100644
> --- a/drivers/soc/qcom/ubwc_config.c
> +++ b/drivers/soc/qcom/ubwc_config.c
> @@ -301,15 +301,14 @@ static const struct of_device_id qcom_ubwc_configs[] __maybe_unused = {
>
> const struct qcom_ubwc_cfg_data *qcom_ubwc_config_get_data(void)
> {
> + struct device_node *root __free(device_node) = NULL;
> const struct of_device_id *match;


You are writing worse code than it was before. The code was like that
intentionally.

Best regards,
Krzysztof