aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-07-05 11:25:57 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-07-06 17:02:50 -0400
commit4148df9b0f38bdd362dd91d52076926c11cbe5a9 (patch)
treea3f119761bbadfc37d0544420263f9272f5209c8
parent793285fcafce4719a05e0c99fa74b188157fe7fe (diff)
fb: Initialize fb_info mutexes in framebuffer_alloc()
This way they'll be properly initialized early enough for users that may touch them before the framebuffer has been registered. Drivers that allocate their fb_info structure some other way (like matrocfb's broken static allocation) need to be fixed up appropriately. Signed-off-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/video/fbmem.c2
-rw-r--r--drivers/video/fbsysfs.c3
-rw-r--r--drivers/video/matrox/matroxfb_base.c1
-rw-r--r--drivers/video/sm501fb.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 53ea05645ff8..53eb39652791 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1513,8 +1513,6 @@ register_framebuffer(struct fb_info *fb_info)
1513 if (!registered_fb[i]) 1513 if (!registered_fb[i])
1514 break; 1514 break;
1515 fb_info->node = i; 1515 fb_info->node = i;
1516 mutex_init(&fb_info->lock);
1517 mutex_init(&fb_info->mm_lock);
1518 1516
1519 fb_info->dev = device_create(fb_class, fb_info->device, 1517 fb_info->dev = device_create(fb_class, fb_info->device,
1520 MKDEV(FB_MAJOR, i), NULL, "fb%d", i); 1518 MKDEV(FB_MAJOR, i), NULL, "fb%d", i);
diff --git a/drivers/video/fbsysfs.c b/drivers/video/fbsysfs.c
index d4a2c11d9809..afc04df39a03 100644
--- a/drivers/video/fbsysfs.c
+++ b/drivers/video/fbsysfs.c
@@ -62,6 +62,9 @@ struct fb_info *framebuffer_alloc(size_t size, struct device *dev)
62 mutex_init(&info->bl_curve_mutex); 62 mutex_init(&info->bl_curve_mutex);
63#endif 63#endif
64 64
65 mutex_init(&info->lock);
66 mutex_init(&info->mm_lock);
67
65 return info; 68 return info;
66#undef PADDING 69#undef PADDING
67#undef BYTES_PER_LONG 70#undef BYTES_PER_LONG
diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c
index 59c3a2e14913..76bc51b616d1 100644
--- a/drivers/video/matrox/matroxfb_base.c
+++ b/drivers/video/matrox/matroxfb_base.c
@@ -2083,6 +2083,7 @@ static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dumm
2083 spin_lock_init(&ACCESS_FBINFO(lock.accel)); 2083 spin_lock_init(&ACCESS_FBINFO(lock.accel));
2084 init_rwsem(&ACCESS_FBINFO(crtc2.lock)); 2084 init_rwsem(&ACCESS_FBINFO(crtc2.lock));
2085 init_rwsem(&ACCESS_FBINFO(altout.lock)); 2085 init_rwsem(&ACCESS_FBINFO(altout.lock));
2086 mutex_init(&ACCESS_FBINFO(fbcon).lock);
2086 mutex_init(&ACCESS_FBINFO(fbcon).mm_lock); 2087 mutex_init(&ACCESS_FBINFO(fbcon).mm_lock);
2087 ACCESS_FBINFO(irq_flags) = 0; 2088 ACCESS_FBINFO(irq_flags) = 0;
2088 init_waitqueue_head(&ACCESS_FBINFO(crtc1.vsync.wait)); 2089 init_waitqueue_head(&ACCESS_FBINFO(crtc1.vsync.wait));
diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c
index 16d4f4c7d52b..98f24f0ec00d 100644
--- a/drivers/video/sm501fb.c
+++ b/drivers/video/sm501fb.c
@@ -1624,8 +1624,6 @@ static int __devinit sm501fb_start_one(struct sm501fb_info *info,
1624 if (!fbi) 1624 if (!fbi)
1625 return 0; 1625 return 0;
1626 1626
1627 mutex_init(&info->fb[head]->mm_lock);
1628
1629 ret = sm501fb_init_fb(info->fb[head], head, drvname); 1627 ret = sm501fb_init_fb(info->fb[head], head, drvname);
1630 if (ret) { 1628 if (ret) {
1631 dev_err(info->dev, "cannot initialise fb %s\n", drvname); 1629 dev_err(info->dev, "cannot initialise fb %s\n", drvname);