aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorAndy Whitcroft <apw@canonical.com>2010-07-29 09:42:21 +0100
committerLeann Ogasawara <leann.ogasawara@canonical.com>2011-08-30 10:14:55 -0700
commitc25bf4b44483e64736d2c2a8c35bde7a948ca404 (patch)
treea93b4a023f5e1934b631b1650d5988e7b33bc119 /drivers
parent499c0abd0ac5fd4d233d017e284a216360f914cb (diff)
UBUNTU: SAUCE: (no-up) Modularize vesafb -- fix initialisation
When this patch was rolled forward, likely between Dapper and Hardy a chunk of initialisation was lost. Pull this back in so we actually have an vesafb_info structure initialised. Else we may well panic when we rmmod vesafb. Signed-off-by: Andy Whitcroft <apw@canonical.com> Acked-by: Stefan Bader <stefan.bader@canonical.com> Acked-by: Brad Figg <brad.figg@canonical.com> Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/vesafb.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/video/vesafb.c b/drivers/video/vesafb.c
index 97af4869c5a..e3acd0131ee 100644
--- a/drivers/video/vesafb.c
+++ b/drivers/video/vesafb.c
@@ -258,6 +258,7 @@ static int __init vesafb_setup(char *options)
static int __init vesafb_probe(struct platform_device *dev)
{
struct fb_info *info;
+ struct vesafb_info *vfb_info;
int i, err;
unsigned int size_vmode;
unsigned int size_remap;
@@ -316,13 +317,14 @@ static int __init vesafb_probe(struct platform_device *dev)
spaces our resource handlers simply don't know about */
}
- info = framebuffer_alloc(sizeof(u32) * 256, &dev->dev);
+ info = framebuffer_alloc(sizeof(struct vesafb_info), &dev->dev);
if (!info) {
release_mem_region(vesafb_fix.smem_start, size_total);
return -ENOMEM;
}
- info->pseudo_palette = info->par;
- info->par = NULL;
+ vfb_info = (struct vesafb_info *) info->par;
+ vfb_info->mtrr_hdl = -1;
+ info->pseudo_palette = vfb_info->pseudo_palette;
/* set vesafb aperture size for generic probing */
info->apertures = alloc_apertures(1);
@@ -452,17 +454,15 @@ static int __init vesafb_probe(struct platform_device *dev)
}
if (type) {
- int rc;
-
/* Find the largest power-of-two */
temp_size = roundup_pow_of_two(temp_size);
/* Try and find a power of two to add */
do {
- rc = mtrr_add(vesafb_fix.smem_start, temp_size,
+ vfb_info->mtrr_hdl = mtrr_add(vesafb_fix.smem_start, temp_size,
type, 1);
temp_size >>= 1;
- } while (temp_size >= PAGE_SIZE && rc == -EINVAL);
+ } while (temp_size >= PAGE_SIZE && vfb_info->mtrr_hdl == -EINVAL);
}
}
#endif