[PATCH 09/10] phy: sunplus: usb2: Set .owner = THIS_MODULE

From: Ian Rogers

Date: Mon Nov 30 2026 - 17:55:17 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 sp_uphy_ops, found with Clang's
require_explicit_initialization attribute.

Fixes: 99d9ccd97385 ("phy: usb: Add USB2.0 phy driver for Sunplus SP7021")
Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
drivers/phy/sunplus/phy-sunplus-usb2.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/phy/sunplus/phy-sunplus-usb2.c b/drivers/phy/sunplus/phy-sunplus-usb2.c
index 6fe096ff1e43..15c068ae48c1 100644
--- a/drivers/phy/sunplus/phy-sunplus-usb2.c
+++ b/drivers/phy/sunplus/phy-sunplus-usb2.c
@@ -227,6 +227,7 @@ static const struct phy_ops sp_uphy_ops = {
.power_on = sp_uphy_power_on,
.power_off = sp_uphy_power_off,
.exit = sp_uphy_exit,
+ .owner = THIS_MODULE,
};

static const struct of_device_id sp_uphy_dt_ids[] = {
--
2.56.1.839.g22a8290db9-goog