Message ID | 1344954162-7985-3-git-send-email-peter.ujfalusi@ti.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, 2012-08-14 at 17:22 +0300, Peter Ujfalusi wrote:
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
I think this one could use a short commit message, also about why
kfree():s are dropped (handled internally by devm_* etc.)
-Tero
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, Aug 28, 2012 at 12:50:10PM +0300, Tero Kristo wrote: > On Tue, 2012-08-14 at 17:22 +0300, Peter Ujfalusi wrote: > > Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> > I think this one could use a short commit message, also about why > kfree():s are dropped (handled internally by devm_* etc.) Honestly I think people should be able to figure this out, it's not like it's an obscure API nobody ever used before. -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Tero, On 08/28/2012 12:50 PM, Tero Kristo wrote: > On Tue, 2012-08-14 at 17:22 +0300, Peter Ujfalusi wrote: >> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> > > I think this one could use a short commit message, also about why > kfree():s are dropped (handled internally by devm_* etc.) I don't like empty commit messages either but this patch is self explaining I would think that the commit title explains it.
diff --git a/drivers/mfd/twl4030-audio.c b/drivers/mfd/twl4030-audio.c index ac04b4f..efa2d42 100644 --- a/drivers/mfd/twl4030-audio.c +++ b/drivers/mfd/twl4030-audio.c @@ -188,7 +188,8 @@ static int __devinit twl4030_audio_probe(struct platform_device *pdev) twl_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, val, TWL4030_REG_APLL_CTL); - audio = kzalloc(sizeof(struct twl4030_audio), GFP_KERNEL); + audio = devm_kzalloc(&pdev->dev, sizeof(struct twl4030_audio), + GFP_KERNEL); if (!audio) return -ENOMEM; @@ -229,22 +230,18 @@ static int __devinit twl4030_audio_probe(struct platform_device *pdev) ret = -ENODEV; } - if (!ret) - return 0; + if (ret) { + platform_set_drvdata(pdev, NULL); + twl4030_audio_dev = NULL; + } - platform_set_drvdata(pdev, NULL); - kfree(audio); - twl4030_audio_dev = NULL; return ret; } static int __devexit twl4030_audio_remove(struct platform_device *pdev) { - struct twl4030_audio *audio = platform_get_drvdata(pdev); - mfd_remove_devices(&pdev->dev); platform_set_drvdata(pdev, NULL); - kfree(audio); twl4030_audio_dev = NULL; return 0;
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> --- drivers/mfd/twl4030-audio.c | 15 ++++++--------- 1 files changed, 6 insertions(+), 9 deletions(-)