From: Rosen Penev <rosenp@gmail.com>
To: linux-usb@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Thierry Reding <thierry.reding@kernel.org>,
Jonathan Hunter <jonathanh@nvidia.com>,
linux-tegra@vger.kernel.org (open list:TEGRA ARCHITECTURE
SUPPORT), linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] usb: phy: tegra: embed UTMI pad config in phy struct
Date: Sun, 20 Sep 2026 18:59:52 -0700 [thread overview]
Message-ID: <20260921015952.1047410-1-rosenp@gmail.com> (raw)
The UTMI pad configuration was kept in a heap-allocated void * member of
struct tegra_usb_phy, even though the driver is the only user of the
field. Embed the struct directly in the phy state to drop the
allocation and the void pointer indirection. The config is
zero-initialized when the phy struct is allocated, so no extra init
is needed.
Assisted-by: LLM
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/usb/phy/phy-tegra-usb.c | 15 ++++-----------
include/linux/usb/tegra_usb_phy.h | 2 +-
2 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c
index 00443a7beaeb..12abc99bdf89 100644
--- a/drivers/usb/phy/phy-tegra-usb.c
+++ b/drivers/usb/phy/phy-tegra-usb.c
@@ -392,7 +392,7 @@ static int utmip_pad_close(struct tegra_usb_phy *phy)
static int utmip_pad_power_on(struct tegra_usb_phy *phy)
{
- struct tegra_utmip_config *config = phy->config;
+ struct tegra_utmip_config *config = &phy->config;
void __iomem *base = phy->pad_regs;
u32 val;
int err;
@@ -549,7 +549,7 @@ static void utmi_phy_clk_enable(struct tegra_usb_phy *phy)
static int utmi_phy_power_on(struct tegra_usb_phy *phy)
{
- struct tegra_utmip_config *config = phy->config;
+ struct tegra_utmip_config *config = &phy->config;
void __iomem *base = phy->regs;
u32 val;
int err;
@@ -888,7 +888,7 @@ static void tegra_hsic_writel(struct tegra_usb_phy *phy, u32 reg, u32 value)
static int uhsic_phy_power_on(struct tegra_usb_phy *phy)
{
- struct tegra_utmip_config *config = phy->config;
+ struct tegra_utmip_config *config = &phy->config;
void __iomem *base = phy->regs;
u32 val;
int err = 0;
@@ -1324,7 +1324,7 @@ static int read_utmi_param(struct platform_device *pdev, const char *param,
static int utmi_phy_probe(struct tegra_usb_phy *tegra_phy,
struct platform_device *pdev)
{
- struct tegra_utmip_config *config;
+ struct tegra_utmip_config *config = &tegra_phy->config;
struct resource *res;
int err;
@@ -1345,13 +1345,6 @@ static int utmi_phy_probe(struct tegra_usb_phy *tegra_phy,
return -ENOMEM;
}
- tegra_phy->config = devm_kzalloc(&pdev->dev, sizeof(*config),
- GFP_KERNEL);
- if (!tegra_phy->config)
- return -ENOMEM;
-
- config = tegra_phy->config;
-
err = read_utmi_param(pdev, "nvidia,hssync-start-delay",
&config->hssync_start_delay);
if (err)
diff --git a/include/linux/usb/tegra_usb_phy.h b/include/linux/usb/tegra_usb_phy.h
index 6343f88df5de..953ba9f06c2a 100644
--- a/include/linux/usb/tegra_usb_phy.h
+++ b/include/linux/usb/tegra_usb_phy.h
@@ -76,7 +76,6 @@ struct tegra_usb_phy {
struct regulator *vbus;
struct regmap *pmc_regmap;
enum usb_dr_mode mode;
- void *config;
const struct tegra_phy_soc_config *soc_config;
struct usb_phy *ulpi;
struct usb_phy u_phy;
@@ -87,6 +86,7 @@ struct tegra_usb_phy {
bool wakeup_enabled;
bool pad_wakeup;
bool powered_on;
+ struct tegra_utmip_config config;
};
#endif /* __TEGRA_USB_PHY_H */
--
2.55.0
reply other threads:[~2026-09-21 1:59 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260921015952.1047410-1-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=thierry.reding@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®