Re: [PATCH] watchdog: orion_wdt: Use devm APIs for clock and watchdog management

From: Rosen Penev

Date: Tue May 19 2026 - 18:47:12 EST


On Tue, May 19, 2026 at 3:34 PM Guenter Roeck <linux@xxxxxxxxxxxx> wrote:
>
> On Tue, May 19, 2026 at 02:42:29PM -0700, Rosen Penev wrote:
> > Replace clk_get/clk_prepare_enable/clk_put with devm_clk_get_enabled
> > and devm_clk_get_optional_enabled so the clock lifecycle is managed
> > automatically. Switch to devm_watchdog_register_device to eliminate
> > the manual remove callback and the disable_clk error path.
> >
> > Switching to devm in these functions is fine as the proper
> > platform_device is passed in.
> >
> > Assisted-by: Claude:Sonnet-4.6
> > Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
>
> drivers/watchdog/orion_wdt.c: In function 'orion_wdt_clock_init':
> drivers/watchdog/orion_wdt.c:82:13: error: unused variable 'ret' [-Werror=unused-variable]
> 82 | int ret;
> | ^~~
> drivers/watchdog/orion_wdt.c: In function 'armada370_wdt_clock_init':
> drivers/watchdog/orion_wdt.c:95:13: error: unused variable 'ret' [-Werror=unused-variable]
> 95 | int ret;
> | ^~~
> drivers/watchdog/orion_wdt.c: In function 'armada375_wdt_clock_init':
> drivers/watchdog/orion_wdt.c:113:13: error: unused variable 'ret' [-Werror=unused-variable]
> 113 | int ret;
> | ^~~
> drivers/watchdog/orion_wdt.c: In function 'armadaxp_wdt_clock_init':
> drivers/watchdog/orion_wdt.c:144:13: error: unused variable 'ret' [-Werror=unused-variable]
> 144 | int ret;
>
> On top of that, the APIs are not 1:1 replaceable.
>
> I am so tired of this. Please stop. I am no longer going to accept any "cleanup"
> patches.
If I don't, the bot yells at me. If I do, you yell at me. It seems I
am at an impasse.
>
> Guenter