Commit 097aa197 authored by Felipe Balbi's avatar Felipe Balbi

usb: gadget: pch_udc: don't free devm allocated memory

Coccinelle caught this instance of us kfree()ing
devm-allocated memory. The solution is just to not
do anything in our gadget_release.
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent f78bbcae
...@@ -2834,17 +2834,6 @@ static void pch_udc_setup_ep0(struct pch_udc_dev *dev) ...@@ -2834,17 +2834,6 @@ static void pch_udc_setup_ep0(struct pch_udc_dev *dev)
UDC_DEVINT_SI | UDC_DEVINT_SC); UDC_DEVINT_SI | UDC_DEVINT_SC);
} }
/**
* gadget_release() - Free the gadget driver private data
* @pdev reference to struct pci_dev
*/
static void gadget_release(struct device *pdev)
{
struct pch_udc_dev *dev = dev_get_drvdata(pdev);
kfree(dev);
}
/** /**
* pch_udc_pcd_reinit() - This API initializes the endpoint structures * pch_udc_pcd_reinit() - This API initializes the endpoint structures
* @dev: Reference to the driver structure * @dev: Reference to the driver structure
...@@ -3151,8 +3140,7 @@ static int pch_udc_probe(struct pci_dev *pdev, ...@@ -3151,8 +3140,7 @@ static int pch_udc_probe(struct pci_dev *pdev,
/* Put the device in disconnected state till a driver is bound */ /* Put the device in disconnected state till a driver is bound */
pch_udc_set_disconnect(dev); pch_udc_set_disconnect(dev);
retval = usb_add_gadget_udc_release(&pdev->dev, &dev->gadget, retval = usb_add_gadget_udc(&pdev->dev, &dev->gadget);
gadget_release);
if (retval) if (retval)
goto finished; goto finished;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment