md: factor out parsing of fixed-point numbers
[safe/jmp/linux-2.6] / drivers / video / ps3fb.c
index 13c876c..9c0144e 100644 (file)
@@ -32,7 +32,7 @@
 #include <linux/init.h>
 
 #include <asm/abs_addr.h>
-#include <asm/iommu.h>
+#include <asm/cell-regs.h>
 #include <asm/lv1call.h>
 #include <asm/ps3av.h>
 #include <asm/ps3fb.h>
@@ -1123,7 +1123,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev)
 
        info = framebuffer_alloc(sizeof(struct ps3fb_par), &dev->core);
        if (!info)
-               goto err_context_unmap;
+               goto err_context_fb_close;
 
        par = info->par;
        par->mode_id = ~ps3fb_mode;     /* != ps3fb_mode, to trigger change */
@@ -1166,7 +1166,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev)
        if (retval < 0)
                goto err_fb_dealloc;
 
-       dev->core.driver_data = info;
+       ps3_system_bus_set_drvdata(dev, info);
 
        dev_info(info->device, "%s %s, using %u KiB of video memory\n",
                 dev_driver_string(info->dev), dev_name(info->dev),
@@ -1188,6 +1188,8 @@ err_fb_dealloc:
        fb_dealloc_cmap(&info->cmap);
 err_framebuffer_release:
        framebuffer_release(info);
+err_context_fb_close:
+       lv1_gpu_fb_close(ps3fb.context_handle);
 err_context_unmap:
        lv1_gpu_context_iomap(ps3fb.context_handle, GPU_IOIF, xdr_lpar,
                              ps3fb_videomemory.size, CBE_IOPTE_M);
@@ -1209,7 +1211,7 @@ err:
 
 static int ps3fb_shutdown(struct ps3_system_bus_device *dev)
 {
-       struct fb_info *info = dev->core.driver_data;
+       struct fb_info *info = ps3_system_bus_get_drvdata(dev);
        u64 xdr_lpar = ps3_mm_phys_to_lpar(__pa(ps3fb_videomemory.address));
 
        dev_dbg(&dev->core, " -> %s:%d\n", __func__, __LINE__);
@@ -1230,9 +1232,10 @@ static int ps3fb_shutdown(struct ps3_system_bus_device *dev)
                unregister_framebuffer(info);
                fb_dealloc_cmap(&info->cmap);
                framebuffer_release(info);
-               info = dev->core.driver_data = NULL;
+               ps3_system_bus_set_drvdata(dev, NULL);
        }
        iounmap((u8 __force __iomem *)ps3fb.dinfo);
+       lv1_gpu_fb_close(ps3fb.context_handle);
        lv1_gpu_context_iomap(ps3fb.context_handle, GPU_IOIF, xdr_lpar,
                              ps3fb_videomemory.size, CBE_IOPTE_M);
        lv1_gpu_context_free(ps3fb.context_handle);