[PATCH 06/10] phy: qcom: ipq4019-usb: Set .owner = THIS_MODULE

From: Ian Rogers

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

Fixes: 3c9d8f6c03a2 ("phy: add driver for Qualcomm IPQ40xx USB PHY")
Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c b/drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c
index 13ccad70e77a..afb2b10030cf 100644
--- a/drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c
+++ b/drivers/phy/qualcomm/phy-qcom-ipq4019-usb.c
@@ -50,6 +50,7 @@ static int ipq4019_ss_phy_power_on(struct phy *_phy)
static const struct phy_ops ipq4019_usb_ss_phy_ops = {
.power_on = ipq4019_ss_phy_power_on,
.power_off = ipq4019_ss_phy_power_off,
+ .owner = THIS_MODULE,
};

static int ipq4019_hs_phy_power_off(struct phy *_phy)
@@ -82,6 +83,7 @@ static int ipq4019_hs_phy_power_on(struct phy *_phy)
static const struct phy_ops ipq4019_usb_hs_phy_ops = {
.power_on = ipq4019_hs_phy_power_on,
.power_off = ipq4019_hs_phy_power_off,
+ .owner = THIS_MODULE,
};

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