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

video: sa1100fb: move pseudo palette into sa1100fb_info structure

Move the pseudo palette inside the driver private data structure so we
don't have to play tricks to cater for it.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>

authored by

Russell King and committed by
Bartlomiej Zolnierkiewicz
cb6bc3ff 0ab76581

+5 -6
+3 -6
drivers/video/fbdev/sa1100fb.c
··· 323 323 * according to the RGB bitfield information. 324 324 */ 325 325 if (regno < 16) { 326 - u32 *pal = fbi->fb.pseudo_palette; 327 - 328 326 val = chan_to_field(red, &fbi->fb.var.red); 329 327 val |= chan_to_field(green, &fbi->fb.var.green); 330 328 val |= chan_to_field(blue, &fbi->fb.var.blue); 331 329 332 - pal[regno] = val; 330 + fbi->pseudo_palette[regno] = val; 333 331 ret = 0; 334 332 } 335 333 break; ··· 1130 1132 struct sa1100fb_info *fbi; 1131 1133 unsigned i; 1132 1134 1133 - fbi = devm_kzalloc(dev, sizeof(struct sa1100fb_info) + sizeof(u32) * 16, 1134 - GFP_KERNEL); 1135 + fbi = devm_kzalloc(dev, sizeof(struct sa1100fb_info), GFP_KERNEL); 1135 1136 if (!fbi) 1136 1137 return NULL; 1137 1138 ··· 1155 1158 fbi->fb.fbops = &sa1100fb_ops; 1156 1159 fbi->fb.flags = FBINFO_DEFAULT; 1157 1160 fbi->fb.monspecs = monspecs; 1158 - fbi->fb.pseudo_palette = (fbi + 1); 1161 + fbi->fb.pseudo_palette = fbi->pseudo_palette; 1159 1162 1160 1163 fbi->rgb[RGB_4] = &rgb_4; 1161 1164 fbi->rgb[RGB_8] = &rgb_8;
+2
drivers/video/fbdev/sa1100fb.h
··· 69 69 70 70 const struct sa1100fb_mach_info *inf; 71 71 struct clk *clk; 72 + 73 + u32 pseudo_palette[16]; 72 74 }; 73 75 74 76 #define TO_INF(ptr,member) container_of(ptr,struct sa1100fb_info,member)