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). When CONFIG_DRM_ROCKCHIP=m and
CONFIG_ROCKCHIP_DW_MIPI_DSI=y, dw-mipi-dsi-rockchip.o is linked into
rockchipdrm.ko, so omitting .owner leaves phy->ops->owner NULL and does
not pin the module when used as a standalone D-PHY provider.

Set .owner = THIS_MODULE in dw_mipi_dsi_dphy_ops, found with Clang's
require_explicit_initialization attribute.

Fixes: 71f68fe7f121 ("drm/rockchip: dsi: add ability to work as a phy instead 
of full dsi")
Signed-off-by: Ian Rogers <[email protected]>
---
Note: Found using Clang's require_explicit_initialization attribute;
an AI coding assistant helped audit call sites, verify Fixes commits,
and draft the changelog.

 drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c 
b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
index 30d6f83cd5da..d0e2c8338d87 100644
--- a/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
+++ b/drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
@@ -1366,6 +1366,7 @@ static const struct phy_ops dw_mipi_dsi_dphy_ops = {
        .power_off      = dw_mipi_dsi_dphy_power_off,
        .init           = dw_mipi_dsi_dphy_init,
        .exit           = dw_mipi_dsi_dphy_exit,
+       .owner          = THIS_MODULE,
 };
 
 static int __maybe_unused dw_mipi_dsi_rockchip_resume(struct device *dev)

base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
-- 
2.56.1.839.g22a8290db9-goog

Reply via email to