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>
if (!pd)
return -EINVAL;
- sachip = kzalloc(sizeof(struct sa1111), GFP_KERNEL);
+ sachip = devm_kzalloc(me, sizeof(struct sa1111), GFP_KERNEL);
if (!sachip)
return -ENOMEM;
err_clkput:
clk_put(sachip->clk);
err_free:
- kfree(sachip);
return ret;
}
iounmap(sachip->base);
clk_put(sachip->clk);
- kfree(sachip);
}
struct sa1111_save_data {