usb: dwc2: pci: Replace kzalloc() with devm_kzalloc()

Use devm_kzalloc() and remove the unnecessary kfree().

Acked-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Vardan Mikayelyan <mvardan@synopsys.com>
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Grigor Tovmasyan <tovmasya@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
This commit is contained in:
Vardan Mikayelyan 2018-01-19 14:45:12 +04:00 committed by Felipe Balbi
parent 8f55fd6041
commit b10129de2e
1 changed files with 1 additions and 2 deletions

View File

@ -83,7 +83,6 @@ static void dwc2_pci_remove(struct pci_dev *pci)
platform_device_unregister(glue->dwc2); platform_device_unregister(glue->dwc2);
usb_phy_generic_unregister(glue->phy); usb_phy_generic_unregister(glue->phy);
kfree(glue);
pci_set_drvdata(pci, NULL); pci_set_drvdata(pci, NULL);
} }
@ -147,7 +146,7 @@ static int dwc2_pci_probe(struct pci_dev *pci,
goto err; goto err;
} }
glue = kzalloc(sizeof(*glue), GFP_KERNEL); glue = devm_kzalloc(dev, sizeof(*glue), GFP_KERNEL);
if (!glue) if (!glue)
return -ENOMEM; return -ENOMEM;