diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-03-26 11:33:16 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-07-08 12:29:56 +0200 |
commit | e33e640ad0b76151534a2b9387b98eb02d6ddda7 (patch) | |
tree | 5a208cdc6feafa4f244c84a4e252fec019bf6802 /drivers/pcmcia/sa11xx_base.c | |
parent | pcmcia: sa11x0: fix missing clk_put() in sa11x0 socket drivers (diff) | |
download | linux-e33e640ad0b76151534a2b9387b98eb02d6ddda7.tar.xz linux-e33e640ad0b76151534a2b9387b98eb02d6ddda7.zip |
pcmcia: sa11x0: convert memory allocation to devm_* API
Convert the sa11x0 socket driver memory allocation to use devm_kzalloc()
to simplify the cleanup path.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/pcmcia/sa11xx_base.c')
-rw-r--r-- | drivers/pcmcia/sa11xx_base.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/pcmcia/sa11xx_base.c b/drivers/pcmcia/sa11xx_base.c index 553d70a67f80..6e6336d47d4a 100644 --- a/drivers/pcmcia/sa11xx_base.c +++ b/drivers/pcmcia/sa11xx_base.c @@ -228,7 +228,7 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, sa11xx_drv_pcmcia_ops(ops); - sinfo = kzalloc(SKT_DEV_INFO_SIZE(nr), GFP_KERNEL); + sinfo = devm_kzalloc(dev, SKT_DEV_INFO_SIZE(nr), GFP_KERNEL); if (!sinfo) return -ENOMEM; @@ -251,7 +251,6 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, if (ret) { while (--i >= 0) soc_pcmcia_remove_one(&sinfo->skt[i]); - kfree(sinfo); } else { dev_set_drvdata(dev, sinfo); } |