Commit f9295047 authored by Thierry Reding's avatar Thierry Reding Committed by Greg Kroah-Hartman

usb: phy: tegra: Avoid use of sizeof(void)

commit 9ce9ec95 upstream.

The PHY configuration is stored in an opaque "config" field, but when
allocating the structure, its proper size needs to be known. In the case
of UTMI, the proper structure is tegra_utmip_config of which a local
variable already exists, so we can use that to obtain the size from.

Fixes the following warning from the sparse checker:

	drivers/usb/phy/phy-tegra-usb.c:882:17: warning: expression using sizeof(void)

Fixes: 81d5dfe6 (usb: phy: tegra: Read UTMIP parameters from device tree)
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2be92748
...@@ -881,8 +881,8 @@ static int utmi_phy_probe(struct tegra_usb_phy *tegra_phy, ...@@ -881,8 +881,8 @@ static int utmi_phy_probe(struct tegra_usb_phy *tegra_phy,
return -ENOMEM; return -ENOMEM;
} }
tegra_phy->config = devm_kzalloc(&pdev->dev, tegra_phy->config = devm_kzalloc(&pdev->dev, sizeof(*config),
sizeof(*tegra_phy->config), GFP_KERNEL); GFP_KERNEL);
if (!tegra_phy->config) { if (!tegra_phy->config) {
dev_err(&pdev->dev, dev_err(&pdev->dev,
"unable to allocate memory for USB UTMIP config\n"); "unable to allocate memory for USB UTMIP config\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment