linux/drivers/video
Julia Lawall 9e340fdc5a drivers/video/wm8505fb.c: use devm_ functions
The various devm_ functions allocate memory that is released when a driver
detaches.  This patch uses these functions for data that is allocated in
the probe function of a platform device and is only freed in the remove
function.

The patch makes some other cleanups.  First, the original code used
devm_kzalloc, but kfree.  This would lead to a double free.  The problem
was found using the following semantic match (http://coccinelle.lip6.fr/):

// <smpl>
@@
expression x,e;
@@
x = devm_kzalloc(...)
... when != x = e
?-kfree(x,...);
// </smpl>

The error-handing code of devm_request_and_ioremap does not print any
warning message, because devm_request_and_ioremap does this.

The call to dma_alloc_coherent is converted to its devm equivalent,
dmam_alloc_coherent.  This implicitly introduces a call to
dmam_free_coherent, which was completly missing in the original code.

A semicolon is removed at the end of the error-handling code for the call
to dma_alloc_coherent.

The block of code calling fb_alloc_cmap is moved below the block of code
calling wm8505fb_set_par, so that the error-handing code of the call to
wm8505fb_set_par can just return ret.  This way there is only one block of
error-handling code that needs to call fb_dealloc_cmap, and so this is
moved up to the place where it is needed, eliminating the need for all
gotos and labels in the function.  This was suggested by Tony Prisk.

The initializations of fbi and ret at the beginning of the function are not
necessary and are removed.  The call platform_set_drvdata(pdev, NULL); at
the end of the function is also removed.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Tony Prisk <linux@prisktech.co.nz>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2013-04-04 13:07:34 +03:00
..
aty Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
backlight backlight: add new lp8788 backlight driver 2013-02-27 19:10:09 -08:00
console Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2013-02-25 16:46:44 -08:00
exynos Merge branch 'akpm' (incoming from Andrew) 2013-02-21 17:38:49 -08:00
geode drivers/video/geode: remove depends on CONFIG_EXPERIMENTAL 2013-01-21 14:52:46 -08:00
i810 Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
intelfb Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
kyro Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
logo module_param: make bool parameters really bool (drivers & misc) 2012-01-13 09:32:20 +10:30
matrox i2c: Split I2C_M_NOSTART support out of I2C_FUNC_PROTOCOL_MANGLING 2012-05-30 10:55:34 +02:00
mb862xx Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
mbx Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
mmp video: mmpdisp: add spi port in display controller 2013-02-21 17:22:17 -08:00
msm new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
nvidia Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
omap omapfb: fix broken build on OMAP1 2013-03-22 10:14:31 +02:00
omap2 omapdss: features: fix supported outputs for OMAP4 2013-03-22 10:14:32 +02:00
riva Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
savage Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
sis Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
vermilion Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
via viafb: rename display_timing to via_display_timing 2013-01-24 08:59:44 +01:00
68328fb.c mm: kill vma flag VM_RESERVED and mm->reserved_vm counter 2012-10-09 16:22:19 +09:00
Kconfig video: vt8500: Correct descriptions in video/Kconfig 2013-04-04 13:07:33 +03:00
Makefile Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux 2013-02-25 16:46:44 -08:00
acornfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
acornfb.h
amba-clcd.c
amifb.c fbdev/amifb: Remove write-only variable amifb_inverse 2012-08-23 13:19:46 +00:00
arcfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
arkfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
asiliantfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
atafb.c
atafb.h
atafb_iplan2p2.c
atafb_iplan2p4.c
atafb_iplan2p8.c
atafb_mfb.c
atafb_utils.h
atmel_lcdfb.c atmel_lcdfb: fix 16-bpp modes on older SOCs 2013-03-13 10:54:58 +01:00
au1100fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
au1100fb.h
au1200fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
au1200fb.h
auo_k190x.c kgdb: remove #include <linux/serial_8250.h> from kgdb.h 2013-02-04 15:35:26 -08:00
auo_k190x.h video: auo_k190x: add code shared by controller drivers 2012-04-29 19:35:35 +00:00
auo_k1900fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
auo_k1901fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
bf54x-lq043fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
bf537-lq035.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
bfin-lq035q1-fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
bfin-t350mcqb-fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
bfin_adv7393fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
bfin_adv7393fb.h
broadsheetfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
bt431.h Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
bt455.h Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
bw2.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
c2p.h
c2p_core.h
c2p_iplan2.c
c2p_planar.c
carminefb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
carminefb.h
carminefb_regs.h
cfbcopyarea.c
cfbfillrect.c
cfbimgblt.c
cg3.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
cg6.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
cg14.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
chipsfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
cirrusfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
clps711xfb.c ARM defconfigs: add missing inclusions of linux/platform_device.h 2013-02-14 15:14:32 -08:00
cobalt_lcdfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
controlfb.c
controlfb.h
cyber2000fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
cyber2000fb.h
da8xx-fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
display_timing.c video: add display_timing and videomode 2013-01-24 09:03:04 +01:00
dnfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
edid.h
efifb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
ep93xx-fb.c drivers/video/ep93xx-fb.c: include <linux/io.h> for devm_ioremap() 2013-03-22 16:41:20 -07:00
fb-puv3.c mm: kill vma flag VM_RESERVED and mm->reserved_vm counter 2012-10-09 16:22:19 +09:00
fb_ddc.c
fb_defio.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
fb_draw.h fbdev: Make pixel_to_pat() failure mode more friendly 2012-07-29 12:25:06 +00:00
fb_notify.c
fb_sys_fops.c
fbcmap.c
fbcvt.c
fbmem.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2013-02-26 20:16:07 -08:00
fbmon.c fbmon: add of_videomode helpers 2013-01-24 09:04:04 +01:00
fbsysfs.c fb: rework locking to fix lock ordering on takeover 2013-02-08 12:02:40 +10:00
ffb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
fm2fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
fsl-diu-fb.c Merge remote-tracking branch 'agust/next' into next 2013-02-20 11:39:05 +11:00
g364fb.c
gbefb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
goldfishfb.c goldfish: framebuffer driver 2013-02-21 17:22:17 -08:00
grvga.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
gxt4500.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
hdmi.c video: Add generic HDMI infoframe helpers 2013-02-22 08:20:05 +01:00
hecubafb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
hgafb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
hitfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
hpfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
i740_reg.h Resurrect Intel740 driver: i740fb 2012-02-15 04:31:21 +00:00
i740fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
igafb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
imsttfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
imxfb.c This is yet another critical imxfb fixes held off by absence of FB 2013-01-23 20:35:02 -08:00
jz4740_fb.c video: Convert to devm_ioremap_resource() 2013-01-22 11:41:58 -08:00
leo.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
macfb.c macfb: fix black and white modes 2012-01-22 14:50:02 +01:00
macmodes.c
macmodes.h
maxinefb.c
metronomefb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
modedb.c
mx3fb.c drivers/video/mx3fb.c: use NULL for pointer 2013-02-21 17:22:19 -08:00
mxsfb.c ARM: video: mxs: Fix mxsfb misconfiguring VDCTRL0 2013-03-19 11:07:58 +08:00
n411.c
neofb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
nuc900fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
nuc900fb.h ARM: w90x900: move platform_data definitions 2012-09-14 11:18:59 +02:00
of_display_timing.c video: add of helper for display timings/videomode 2013-01-24 09:03:48 +01:00
of_videomode.c video: add of helper for display timings/videomode 2013-01-24 09:03:48 +01:00
offb.c
output.c
p9100.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
platinumfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
platinumfb.h
pm2fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
pm3fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
pmag-aa-fb.c
pmag-ba-fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
pmagb-b-fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
ps3fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
pvr2fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
pxa3xx-gcu.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
pxa3xx-gcu.h
pxa168fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
pxa168fb.h
pxafb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
pxafb.h
q40fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
s1d13xxxfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
s3c-fb.c video: Convert to devm_ioremap_resource() 2013-01-22 11:41:58 -08:00
s3c2410fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
s3c2410fb.h
s3fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
sa1100fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
sa1100fb.h FB: sa11x0: convert to use platform resource and ioremap() 2012-02-24 09:39:59 +00:00
sbuslib.c mm: kill vma flag VM_RESERVED and mm->reserved_vm counter 2012-10-09 16:22:19 +09:00
sbuslib.h
sgivwfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
sh7760fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
sh_mipi_dsi.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
sh_mobile_hdmi.c fbdev: sh_mobile_hdmi: add HDMI Control Register support 2012-05-13 13:07:59 +00:00
sh_mobile_lcdcfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
sh_mobile_lcdcfb.h fbdev: sh_mobile_lcdc: Store the backlight brightness internally 2012-11-21 15:50:01 +01:00
sh_mobile_meram.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
skeletonfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
sm501fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
smscufx.c mm: kill vma flag VM_RESERVED and mm->reserved_vm counter 2012-10-09 16:22:19 +09:00
ssd1307fb.c drivers/video/ssd1307fb.c: fix bit order bug in the byte translation function 2013-01-11 14:54:54 -08:00
sstfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
sticore.h
stifb.c
sunxvr500.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
sunxvr1000.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
sunxvr2500.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
svgalib.c
syscopyarea.c
sysfillrect.c
sysimgblt.c
tcx.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
tdfxfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
tgafb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
tmiofb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
tridentfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
udlfb.c fbdev updates for 3.7 2012-10-12 10:21:02 +09:00
uvesafb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
valkyriefb.c
valkyriefb.h
vesafb.c
vfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
vga16fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
vgastate.c
videomode.c video: add display_timing and videomode 2013-01-24 09:03:04 +01:00
vt8500lcdfb.c video: vt8500: Remove unused platform_data/video-vt8500lcdfb.h 2013-04-04 13:07:33 +03:00
vt8500lcdfb.h
vt8623fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
w100fb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
w100fb.h
wm8505fb.c drivers/video/wm8505fb.c: use devm_ functions 2013-04-04 13:07:34 +03:00
wm8505fb_regs.h
wmt_ge_rops.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
wmt_ge_rops.h video: vt8500: Make wmt_ge_rops optional 2013-04-04 13:07:33 +03:00
xen-fbfront.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00
xilinxfb.c Drivers: video: remove __dev* attributes. 2013-01-03 15:57:01 -08:00