summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc2
diff options
context:
space:
mode:
authorVardan Mikayelyan <mvardan@synopsys.com>2018-01-19 13:45:12 +0300
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-03-13 11:47:44 +0300
commitb10129de2ef40613bdaaa6993bda5360fbaa3224 (patch)
treeb4817a7218af0ae48ab71ca005d81ea5ed642712 /drivers/usb/dwc2
parent8f55fd6041323dd528e85d4303519d053110a5d4 (diff)
downloadlinux-b10129de2ef40613bdaaa6993bda5360fbaa3224.tar.xz
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>
Diffstat (limited to 'drivers/usb/dwc2')
-rw-r--r--drivers/usb/dwc2/pci.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/usb/dwc2/pci.c b/drivers/usb/dwc2/pci.c
index 3ecc951a1aea..8c6a65188412 100644
--- a/drivers/usb/dwc2/pci.c
+++ b/drivers/usb/dwc2/pci.c
@@ -83,7 +83,6 @@ static void dwc2_pci_remove(struct pci_dev *pci)
platform_device_unregister(glue->dwc2);
usb_phy_generic_unregister(glue->phy);
- kfree(glue);
pci_set_drvdata(pci, NULL);
}
@@ -147,7 +146,7 @@ static int dwc2_pci_probe(struct pci_dev *pci,
goto err;
}
- glue = kzalloc(sizeof(*glue), GFP_KERNEL);
+ glue = devm_kzalloc(dev, sizeof(*glue), GFP_KERNEL);
if (!glue)
return -ENOMEM;