aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-07-21 07:37:37 -0400
committerFelipe Balbi <balbi@ti.com>2014-09-03 10:16:01 -0400
commit9ce9ec95fb9b82e09b55a52f1bb8a362bf8f74d8 (patch)
tree81ae94686d8f07f9d16bdfd76bc9229f55531c95 /drivers/usb/phy
parent36687e30565100e45f29f8db52dd223dca1d6d99 (diff)
usb: phy: tegra: Avoid use of sizeof(void)
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: 81d5dfe6d8b3 (usb: phy: tegra: Read UTMIP parameters from device tree) Cc: stable@vger.kernel.org Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/phy')
-rw-r--r--drivers/usb/phy/phy-tegra-usb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c
index 13b4fa287da8..886f1807a67b 100644
--- a/drivers/usb/phy/phy-tegra-usb.c
+++ b/drivers/usb/phy/phy-tegra-usb.c
@@ -878,8 +878,8 @@ static int utmi_phy_probe(struct tegra_usb_phy *tegra_phy,
878 return -ENOMEM; 878 return -ENOMEM;
879 } 879 }
880 880
881 tegra_phy->config = devm_kzalloc(&pdev->dev, 881 tegra_phy->config = devm_kzalloc(&pdev->dev, sizeof(*config),
882 sizeof(*tegra_phy->config), GFP_KERNEL); 882 GFP_KERNEL);
883 if (!tegra_phy->config) { 883 if (!tegra_phy->config) {
884 dev_err(&pdev->dev, 884 dev_err(&pdev->dev,
885 "unable to allocate memory for USB UTMIP config\n"); 885 "unable to allocate memory for USB UTMIP config\n");