summaryrefslogtreecommitdiffstats
path: root/drivers/phy/samsung/phy-samsung-usb2.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/phy/samsung/phy-samsung-usb2.c')
-rw-r--r--drivers/phy/samsung/phy-samsung-usb2.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/phy/samsung/phy-samsung-usb2.c b/drivers/phy/samsung/phy-samsung-usb2.c
index e51d45eeda60..6c82f4fbe8a2 100644
--- a/drivers/phy/samsung/phy-samsung-usb2.c
+++ b/drivers/phy/samsung/phy-samsung-usb2.c
@@ -156,9 +156,8 @@ static int samsung_usb2_phy_probe(struct platform_device *pdev)
if (!cfg)
return -EINVAL;
- drv = devm_kzalloc(dev, sizeof(struct samsung_usb2_phy_driver) +
- cfg->num_phys * sizeof(struct samsung_usb2_phy_instance),
- GFP_KERNEL);
+ drv = devm_kzalloc(dev, struct_size(drv, instances, cfg->num_phys),
+ GFP_KERNEL);
if (!drv)
return -ENOMEM;