mirror of https://gitee.com/openkylin/linux.git
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:
parent
8f55fd6041
commit
b10129de2e
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue