From 12c4a147646b641ec7fb01749fa567be82796921 Mon Sep 17 00:00:00 2001 From: yxj Date: Thu, 16 Aug 2012 09:54:03 +0800 Subject: [PATCH] fix bug in set_dsp_lut,only 10 words can updated by user before this bug fixed --- drivers/video/rockchip/rkfb_sysfs.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/video/rockchip/rkfb_sysfs.c b/drivers/video/rockchip/rkfb_sysfs.c index 240d48364e54..1ee1b06ceaaa 100644 --- a/drivers/video/rockchip/rkfb_sysfs.c +++ b/drivers/video/rockchip/rkfb_sysfs.c @@ -247,7 +247,7 @@ static ssize_t set_dsp_lut(struct device *dev,struct device_attribute *attr, { int dsp_lut[256]; char *start = buf; - int i=256,temp; + int i=256,j,temp; int space_max = 10; struct fb_info *fbi = dev_get_drvdata(dev); @@ -259,9 +259,10 @@ static ssize_t set_dsp_lut(struct device *dev,struct device_attribute *attr, temp = i; dsp_lut[i] = temp + (temp<<8) + (temp<<16); //init by default value } - //printk("%s\n",start); + //printk("count:%d\n>>%s\n\n",count,start); for(i=0;i<256;i++) { + space_max = 10; //max space number 10; temp = simple_strtoul(start,NULL,10); dsp_lut[i] = temp; do @@ -275,7 +276,14 @@ static ssize_t set_dsp_lut(struct device *dev,struct device_attribute *attr, else start++; } - +#if 0 + for(i=0;i<16;i++) + { + for(j=0;j<16;j++) + printk("0x%08x ",dsp_lut[i*16+j]); + printk("\n"); + } +#endif dev_drv->set_dsp_lut(dev_drv,dsp_lut); return count; -- 2.34.1