Commit 0c531360 authored by Ben Dooks's avatar Ben Dooks Committed by Linus Torvalds

lcd: add lcd_device to check_fb() entry in lcd_ops

Add the lcd_device being checked to the check_fb entry of lcd_ops.  This
ensures that any driver using this to check against it's own state can do
so, and also makes all the calls in lcd_ops more orthogonal in their
arguments.
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent cccb6d3c
...@@ -33,7 +33,7 @@ static int fb_notifier_callback(struct notifier_block *self, ...@@ -33,7 +33,7 @@ static int fb_notifier_callback(struct notifier_block *self,
ld = container_of(self, struct lcd_device, fb_notif); ld = container_of(self, struct lcd_device, fb_notif);
mutex_lock(&ld->ops_lock); mutex_lock(&ld->ops_lock);
if (ld->ops) if (ld->ops)
if (!ld->ops->check_fb || ld->ops->check_fb(evdata->info)) if (!ld->ops->check_fb || ld->ops->check_fb(ld, evdata->info))
ld->ops->set_power(ld, *(int *)evdata->data); ld->ops->set_power(ld, *(int *)evdata->data);
mutex_unlock(&ld->ops_lock); mutex_unlock(&ld->ops_lock);
return 0; return 0;
......
...@@ -478,7 +478,7 @@ static int bfin_lcd_set_contrast(struct lcd_device *dev, int contrast) ...@@ -478,7 +478,7 @@ static int bfin_lcd_set_contrast(struct lcd_device *dev, int contrast)
return 0; return 0;
} }
static int bfin_lcd_check_fb(struct fb_info *fi) static int bfin_lcd_check_fb(struct lcd_device *dev, struct fb_info *fi)
{ {
if (!fi || (fi == &bfin_bf54x_fb)) if (!fi || (fi == &bfin_bf54x_fb))
return 1; return 1;
......
...@@ -396,7 +396,7 @@ static int bfin_lcd_set_contrast(struct lcd_device *dev, int contrast) ...@@ -396,7 +396,7 @@ static int bfin_lcd_set_contrast(struct lcd_device *dev, int contrast)
return 0; return 0;
} }
static int bfin_lcd_check_fb(struct fb_info *fi) static int bfin_lcd_check_fb(struct lcd_device *dev, struct fb_info *fi)
{ {
if (!fi || (fi == &bfin_t350mcqb_fb)) if (!fi || (fi == &bfin_t350mcqb_fb))
return 1; return 1;
......
...@@ -47,7 +47,7 @@ struct lcd_ops { ...@@ -47,7 +47,7 @@ struct lcd_ops {
int (*set_contrast)(struct lcd_device *, int contrast); int (*set_contrast)(struct lcd_device *, int contrast);
/* Check if given framebuffer device is the one LCD is bound to; /* Check if given framebuffer device is the one LCD is bound to;
return 0 if not, !=0 if it is. If NULL, lcd always matches the fb. */ return 0 if not, !=0 if it is. If NULL, lcd always matches the fb. */
int (*check_fb)(struct fb_info *); int (*check_fb)(struct lcd_device *, struct fb_info *);
}; };
struct lcd_device { struct lcd_device {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment