diff options
author | Vardan Mikayelyan <mvardan@synopsys.com> | 2018-01-19 11:45:12 +0100 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2018-03-13 09:47:44 +0100 |
commit | b10129de2ef40613bdaaa6993bda5360fbaa3224 (patch) | |
tree | b4817a7218af0ae48ab71ca005d81ea5ed642712 /drivers/usb/dwc2/pci.c | |
parent | usb: dwc2: Change TxFIFO and RxFIFO flushing flow (diff) | |
download | linux-b10129de2ef40613bdaaa6993bda5360fbaa3224.tar.xz linux-b10129de2ef40613bdaaa6993bda5360fbaa3224.zip |
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/pci.c')
-rw-r--r-- | drivers/usb/dwc2/pci.c | 3 |
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; |