[PATCH 02/10] phy: cadence: cdns-dphy-rx: Set .owner = THIS_MODULE

From: Ian Rogers

Date: Mon Nov 30 2026 - 17:54:45 EST


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 cdns_dphy_rx_ops, found with Clang's
require_explicit_initialization attribute.

Fixes: 41d393aaead4 ("phy: cadence: Add Cadence D-PHY Rx driver")
Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
drivers/phy/cadence/cdns-dphy-rx.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/phy/cadence/cdns-dphy-rx.c b/drivers/phy/cadence/cdns-dphy-rx.c
index d3f7e9513dd6..97dbbe789bb5 100644
--- a/drivers/phy/cadence/cdns-dphy-rx.c
+++ b/drivers/phy/cadence/cdns-dphy-rx.c
@@ -232,6 +232,7 @@ static const struct phy_ops cdns_dphy_rx_ops = {
.power_off = cdns_dphy_rx_power_off,
.configure = cdns_dphy_rx_configure,
.validate = cdns_dphy_rx_validate,
+ .owner = THIS_MODULE,
};

static int cdns_dphy_rx_probe(struct platform_device *pdev)
--
2.56.1.839.g22a8290db9-goog