Skip to content

Commit

Permalink
usb: dwc2: pci: Replace kzalloc() with devm_kzalloc()
Browse files Browse the repository at this point in the history
Use devm_kzalloc() and remove the unnecessary kfree().

Acked-by: John Youn <[email protected]>
Signed-off-by: Vardan Mikayelyan <[email protected]>
Signed-off-by: John Youn <[email protected]>
Signed-off-by: Grigor Tovmasyan <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
  • Loading branch information
Vardan Mikayelyan authored and Felipe Balbi committed Mar 13, 2018
1 parent 8f55fd6 commit b10129d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/usb/dwc2/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit b10129d

Please sign in to comment.