aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/maxinefb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/maxinefb.c')
-rw-r--r--drivers/video/maxinefb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/video/maxinefb.c b/drivers/video/maxinefb.c
index 5e91c2b30af9..5cf52d3c8e75 100644
--- a/drivers/video/maxinefb.c
+++ b/drivers/video/maxinefb.c
@@ -28,7 +28,6 @@
28#include <linux/errno.h> 28#include <linux/errno.h>
29#include <linux/string.h> 29#include <linux/string.h>
30#include <linux/mm.h> 30#include <linux/mm.h>
31#include <linux/slab.h>
32#include <linux/delay.h> 31#include <linux/delay.h>
33#include <linux/init.h> 32#include <linux/init.h>
34#include <linux/fb.h> 33#include <linux/fb.h>
@@ -92,6 +91,9 @@ static int maxinefb_setcolreg(unsigned regno, unsigned red, unsigned green,
92 /* value to be written into the palette reg. */ 91 /* value to be written into the palette reg. */
93 unsigned long hw_colorvalue = 0; 92 unsigned long hw_colorvalue = 0;
94 93
94 if (regno > 255)
95 return 1;
96
95 red >>= 8; /* The cmap fields are 16 bits */ 97 red >>= 8; /* The cmap fields are 16 bits */
96 green >>= 8; /* wide, but the harware colormap */ 98 green >>= 8; /* wide, but the harware colormap */
97 blue >>= 8; /* registers are only 8 bits wide */ 99 blue >>= 8; /* registers are only 8 bits wide */