lkml.org 
[lkml]   [2019]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/4] pwm: omap-dmtimer: put_device() after of_find_device_by_node()
From
Date
> 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

\
 
 \ /
  Last update: 2019-11-11 14:42    [W:0.102 / U:6.744 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site