[PATCH 01/10] phy: allwinner: phy-sun6i-mipi-dphy: Set .owner = THIS_MODULE
Jernej Škrabec
jernej.skrabec at gmail.com
Mon Nov 30 21:16:16 PST 2026
Dne ponedeljek, 30. november 2026 ob 23:54:17 Srednjeevropski standardni čas je Ian Rogers napisal(a):
> phy_get() and of_phy_get() call try_module_get(phy->ops->owner) to pin
> the PHY provider module while the PHY is in use, and of_phy_put() calls
> module_put(phy->ops->owner). Because phy->ops is const struct phy_ops *,
> phy_create() cannot populate ops->owner at runtime, and
> try_module_get(NULL) returns true without incrementing the module
> reference count.
>
> Set .owner = THIS_MODULE in sun6i_dphy_ops, found with Clang's
> require_explicit_initialization attribute.
>
> Fixes: bb3b6fcb6849 ("sun6i: dsi: Convert to generic phy handling")
> Signed-off-by: Ian Rogers <irogers at google.com>
Acked-by: Jernej Skrabec <jernej.skrabec at gmail.com>
Best regards,
Jernej
> ---
> drivers/phy/allwinner/phy-sun6i-mipi-dphy.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c b/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c
> index e5a9aa3f4aac..663b3d4d295b 100644
> --- a/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c
> +++ b/drivers/phy/allwinner/phy-sun6i-mipi-dphy.c
> @@ -535,6 +535,7 @@ static const struct phy_ops sun6i_dphy_ops = {
> .power_off = sun6i_dphy_power_off,
> .init = sun6i_dphy_init,
> .exit = sun6i_dphy_exit,
> + .owner = THIS_MODULE,
> };
>
> static const struct regmap_config sun6i_dphy_regmap_config = {
>
More information about the linux-arm-kernel
mailing list