Re: [PATCH v3] net: dsa: mt7530: manage the core and io regulators with devm actions

From: Andrew Lunn

Date: Mon Nov 23 2026 - 09:46:51 EST


> Move the enables to mt7530_probe(), right after the regulators are
> acquired

Please add an explanation why this is safe. Since the original code
did not do this, there might be a reason it is done later.

> , and pair each regulator_enable() with a
> devm_add_action_or_reset() that disables it again.

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html


Using device-managed and cleanup.h constructs

Netdev remains skeptical about promises of all “auto-cleanup” APIs,
including even devm_ helpers, historically. They are not the preferred
style of implementation, merely an acceptable one.

This is maybe one case where devm is the wrong solution. Please keep
with the normal way of doing cleanup.

> Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch")

Who does this bother?

Andrew