diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2016-09-06 10:29:26 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2016-09-20 09:21:07 -0400 |
commit | 7d53c1f01210aa79838f1fe34b2a89f8e900d720 (patch) | |
tree | 4ff9964f60a454841d043557a6f4051c42c816cf | |
parent | eac8dbf74f30479b70b9a53f3b24285bd6229d09 (diff) |
ARM: sa1111: use devm_kzalloc()
Use devm_kzalloc() to allocate our driver data, so we can eliminate its
kfree() from the device removal and error cleanup paths.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r-- | arch/arm/common/sa1111.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c index 303c62861d84..f2ce21c03646 100644 --- a/arch/arm/common/sa1111.c +++ b/arch/arm/common/sa1111.c | |||
@@ -696,7 +696,7 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq) | |||
696 | if (!pd) | 696 | if (!pd) |
697 | return -EINVAL; | 697 | return -EINVAL; |
698 | 698 | ||
699 | sachip = kzalloc(sizeof(struct sa1111), GFP_KERNEL); | 699 | sachip = devm_kzalloc(me, sizeof(struct sa1111), GFP_KERNEL); |
700 | if (!sachip) | 700 | if (!sachip) |
701 | return -ENOMEM; | 701 | return -ENOMEM; |
702 | 702 | ||
@@ -808,7 +808,6 @@ static int __sa1111_probe(struct device *me, struct resource *mem, int irq) | |||
808 | err_clkput: | 808 | err_clkput: |
809 | clk_put(sachip->clk); | 809 | clk_put(sachip->clk); |
810 | err_free: | 810 | err_free: |
811 | kfree(sachip); | ||
812 | return ret; | 811 | return ret; |
813 | } | 812 | } |
814 | 813 | ||
@@ -847,7 +846,6 @@ static void __sa1111_remove(struct sa1111 *sachip) | |||
847 | 846 | ||
848 | iounmap(sachip->base); | 847 | iounmap(sachip->base); |
849 | clk_put(sachip->clk); | 848 | clk_put(sachip->clk); |
850 | kfree(sachip); | ||
851 | } | 849 | } |
852 | 850 | ||
853 | struct sa1111_save_data { | 851 | struct sa1111_save_data { |