Re: [PATCH 3/4] pwm: omap-dmtimer: put_device() after of_find_device_by_node()

From: Markus Elfring
Date: Mon Nov 11 2019 - 08:42:06 EST


> This was found by coccicheck:
>
> drivers/pwm/pwm-omap-dmtimer.c:304:2-8: ERROR: missing put_device;
> call of_find_device_by_node on line 255, but without a corresponding
> object release within this function.

How do you think about to add a wording according to âimperative moodâ
for your change description?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=31f4f5b495a62c9a8b15b1c3581acd5efeb9af8c#n151

â
> +++ b/drivers/pwm/pwm-omap-dmtimer.c
â
> @@ -352,7 +352,14 @@ static int pwm_omap_dmtimer_probe(struct platform_device *pdev)
â
> pdata->free(dm_timer);
> -put:
> +err_request_timer:
> +
> +err_timer_property:
> +err_platdata:
> +
> + put_device(&timer_pdev->dev);

Would the use of the label âput_deviceâ be more appropriate?


> +err_find_timer_pdev:
> +
> of_node_put(timer);
â

Would the use of the label âput_nodeâ be better here?


> @@ -372,6 +379,8 @@ static int pwm_omap_dmtimer_remove(struct platform_device *pdev)
>
> omap->pdata->free(omap->dm_timer);
>
> + put_device(&omap->dm_timer_pdev->dev);
> +
> mutex_destroy(&omap->mutex);
>
> return 0;

I suggest to omit a few blank lines.

Regards,
Markus