Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: Fix tc6387xb resource reclaim

This patch includes below fixes:
1. add a missing iounmap in tc6387xb_probe() error path
2. fix resource reclaim in tc6387xb_remove()

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>

authored by

Axel Lin and committed by
Samuel Ortiz
08b877b8 fa6e4b18

+7 -3
+7 -3
drivers/mfd/tc6387xb.c
··· 201 201 if (!ret) 202 202 return 0; 203 203 204 + iounmap(tc6387xb->scr); 204 205 err_ioremap: 205 206 release_resource(&tc6387xb->rscr); 206 207 err_resource: ··· 214 213 215 214 static int tc6387xb_remove(struct platform_device *dev) 216 215 { 217 - struct clk *clk32k = platform_get_drvdata(dev); 216 + struct tc6387xb *tc6387xb = platform_get_drvdata(dev); 218 217 219 218 mfd_remove_devices(&dev->dev); 220 - clk_disable(clk32k); 221 - clk_put(clk32k); 219 + iounmap(tc6387xb->scr); 220 + release_resource(&tc6387xb->rscr); 221 + clk_disable(tc6387xb->clk32k); 222 + clk_put(tc6387xb->clk32k); 222 223 platform_set_drvdata(dev, NULL); 224 + kfree(tc6387xb); 223 225 224 226 return 0; 225 227 }