diff options
author | Lukasz Majewski <l.majewski@samsung.com> | 2012-05-04 08:17:13 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-05-04 08:53:17 -0400 |
commit | f026a52d4309e1e08752a8bd41ac74aeea815686 (patch) | |
tree | 7cddaad44420cbcb78c680a817f34cbcc6c8a4fa /drivers/usb/gadget/s3c-hsotg.c | |
parent | f99b2bfebe8984db2b6e4c07e2bedc91977d27d8 (diff) |
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 <sangwook.lee@linaro.org>
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget/s3c-hsotg.c')
-rw-r--r-- | drivers/usb/gadget/s3c-hsotg.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index cd7ae3aef0c0..520dc3db612b 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
@@ -3445,9 +3445,21 @@ static void __devexit s3c_hsotg_delete_debug(struct s3c_hsotg *hsotg) | |||
3445 | } | 3445 | } |
3446 | 3446 | ||
3447 | /** | 3447 | /** |
3448 | * s3c_hsotg_release - release callback for hsotg device | ||
3449 | * @dev: Device to for which release is called | ||
3450 | */ | ||
3451 | static void s3c_hsotg_release(struct device *dev) | ||
3452 | { | ||
3453 | struct s3c_hsotg *hsotg = dev_get_drvdata(dev); | ||
3454 | |||
3455 | kfree(hsotg); | ||
3456 | } | ||
3457 | |||
3458 | /** | ||
3448 | * s3c_hsotg_probe - probe function for hsotg driver | 3459 | * s3c_hsotg_probe - probe function for hsotg driver |
3449 | * @pdev: The platform information for the driver | 3460 | * @pdev: The platform information for the driver |
3450 | */ | 3461 | */ |
3462 | |||
3451 | static int __devinit s3c_hsotg_probe(struct platform_device *pdev) | 3463 | static int __devinit s3c_hsotg_probe(struct platform_device *pdev) |
3452 | { | 3464 | { |
3453 | struct s3c_hsotg_plat *plat = pdev->dev.platform_data; | 3465 | struct s3c_hsotg_plat *plat = pdev->dev.platform_data; |
@@ -3531,6 +3543,7 @@ static int __devinit s3c_hsotg_probe(struct platform_device *pdev) | |||
3531 | 3543 | ||
3532 | hsotg->gadget.dev.parent = dev; | 3544 | hsotg->gadget.dev.parent = dev; |
3533 | hsotg->gadget.dev.dma_mask = dev->dma_mask; | 3545 | hsotg->gadget.dev.dma_mask = dev->dma_mask; |
3546 | hsotg->gadget.dev.release = s3c_hsotg_release; | ||
3534 | 3547 | ||
3535 | /* reset the system */ | 3548 | /* reset the system */ |
3536 | 3549 | ||
@@ -3678,7 +3691,6 @@ static int __devexit s3c_hsotg_remove(struct platform_device *pdev) | |||
3678 | clk_put(hsotg->clk); | 3691 | clk_put(hsotg->clk); |
3679 | 3692 | ||
3680 | device_unregister(&hsotg->gadget.dev); | 3693 | device_unregister(&hsotg->gadget.dev); |
3681 | kfree(hsotg); | ||
3682 | return 0; | 3694 | return 0; |
3683 | } | 3695 | } |
3684 | 3696 | ||