mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
usb:hsotg:samsung: Add release function for hsotg device
Add release function to prevent kernel warning. Kfree is performed when all references are gone. Signed-off-by: Sangwook Lee <[email protected]> Signed-off-by: Lukasz Majewski <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
This commit is contained in:
parent
f99b2bfebe
commit
f026a52d43
1 changed files with 13 additions and 1 deletions
|
|
@ -3444,10 +3444,22 @@ static void __devexit s3c_hsotg_delete_debug(struct s3c_hsotg *hsotg)
|
|||
debugfs_remove(hsotg->debug_root);
|
||||
}
|
||||
|
||||
/**
|
||||
* s3c_hsotg_release - release callback for hsotg device
|
||||
* @dev: Device to for which release is called
|
||||
*/
|
||||
static void s3c_hsotg_release(struct device *dev)
|
||||
{
|
||||
struct s3c_hsotg *hsotg = dev_get_drvdata(dev);
|
||||
|
||||
kfree(hsotg);
|
||||
}
|
||||
|
||||
/**
|
||||
* s3c_hsotg_probe - probe function for hsotg driver
|
||||
* @pdev: The platform information for the driver
|
||||
*/
|
||||
|
||||
static int __devinit s3c_hsotg_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct s3c_hsotg_plat *plat = pdev->dev.platform_data;
|
||||
|
|
@ -3531,6 +3543,7 @@ static int __devinit s3c_hsotg_probe(struct platform_device *pdev)
|
|||
|
||||
hsotg->gadget.dev.parent = dev;
|
||||
hsotg->gadget.dev.dma_mask = dev->dma_mask;
|
||||
hsotg->gadget.dev.release = s3c_hsotg_release;
|
||||
|
||||
/* reset the system */
|
||||
|
||||
|
|
@ -3678,7 +3691,6 @@ static int __devexit s3c_hsotg_remove(struct platform_device *pdev)
|
|||
clk_put(hsotg->clk);
|
||||
|
||||
device_unregister(&hsotg->gadget.dev);
|
||||
kfree(hsotg);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue