Fix/cleanup mach64 drm module for building with current kernel.

Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>

---
 drivers/gpu/drm/mach64/mach64_dma.c   |    9 +--------
 drivers/gpu/drm/mach64/mach64_drv.c   |   11 +----------
 drivers/gpu/drm/mach64/mach64_state.c |    4 ++--
 3 files changed, 4 insertions(+), 20 deletions(-)

diff -p -up linux-2.6.28/drivers/gpu/drm/mach64/mach64_dma.c.orig linux-2.6.28/drivers/gpu/drm/mach64/mach64_dma.c
--- linux-2.6.28/drivers/gpu/drm/mach64/mach64_dma.c.orig	2008-12-10 12:19:14.000000000 -0500
+++ linux-2.6.28/drivers/gpu/drm/mach64/mach64_dma.c	2008-12-10 13:34:19.000000000 -0500
@@ -834,14 +834,8 @@ static int mach64_bm_dma_test(struct drm
 
 	/* FIXME: get a dma buffer from the freelist here */
 	DRM_DEBUG("Allocating data memory ...\n");
-#ifdef __FreeBSD__
-	DRM_UNLOCK();
-#endif
 	cpu_addr_dmah =
 	    drm_pci_alloc(dev, 0x1000, 0x1000, 0xfffffffful);
-#ifdef __FreeBSD__
-	DRM_LOCK();
-#endif
 	if (!cpu_addr_dmah) {
 		DRM_INFO("data-memory allocation failed!\n");
 		return -ENOMEM;
@@ -1375,8 +1369,7 @@ int mach64_do_cleanup_dma(struct drm_dev
 	 * may not have been called from userspace and after dev_private
 	 * is freed, it's too late.
 	 */
-	if (dev->irq)
-		drm_irq_uninstall(dev);
+	drm_irq_uninstall(dev);
 
 	if (dev->dev_private) {
 		drm_mach64_private_t *dev_priv = dev->dev_private;
diff -p -up linux-2.6.28/drivers/gpu/drm/mach64/mach64_drv.c.orig linux-2.6.28/drivers/gpu/drm/mach64/mach64_drv.c
--- linux-2.6.28/drivers/gpu/drm/mach64/mach64_drv.c.orig	2008-12-10 12:13:13.000000000 -0500
+++ linux-2.6.28/drivers/gpu/drm/mach64/mach64_drv.c	2008-12-10 12:16:54.000000000 -0500
@@ -38,7 +38,6 @@ static struct pci_device_id pciidlist[] 
 	mach64_PCI_IDS
 };
 
-static int probe(struct pci_dev *pdev, const struct pci_device_id *ent);
 static struct drm_driver driver = {
 	.driver_features =
 	    DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_PCI_DMA | DRIVER_HAVE_DMA
@@ -68,8 +67,6 @@ static struct drm_driver driver = {
 	.pci_driver = {
 		.name = DRIVER_NAME,
 		.id_table = pciidlist,
-		.probe = probe,
-		.remove = __devexit_p(drm_cleanup_pci),
 	},
 
 	.name = DRIVER_NAME,
@@ -80,16 +77,10 @@ static struct drm_driver driver = {
 	.patchlevel = DRIVER_PATCHLEVEL,
 };
 
-static int probe(struct pci_dev *pdev, const struct pci_device_id *ent)
-{
-	return drm_get_dev(pdev, ent, &driver);
-}
-
-
 static int __init mach64_init(void)
 {
 	driver.num_ioctls = mach64_max_ioctl;
-	return drm_init(&driver, pciidlist);
+	return drm_init(&driver);
 }
 
 static void __exit mach64_exit(void)
diff -p -up linux-2.6.28/drivers/gpu/drm/mach64/mach64_state.c.orig linux-2.6.28/drivers/gpu/drm/mach64/mach64_state.c
--- linux-2.6.28/drivers/gpu/drm/mach64/mach64_state.c.orig	2008-12-10 12:13:13.000000000 -0500
+++ linux-2.6.28/drivers/gpu/drm/mach64/mach64_state.c	2008-12-10 13:38:54.000000000 -0500
@@ -455,7 +455,7 @@ static int mach64_do_get_frames_queued(d
 	head = ring->head;
 
 	start = (MACH64_MAX_QUEUED_FRAMES -
-		 DRM_MIN(MACH64_MAX_QUEUED_FRAMES, sarea_priv->frames_queued));
+		 min(MACH64_MAX_QUEUED_FRAMES, sarea_priv->frames_queued));
 
 	if (head == tail) {
 		sarea_priv->frames_queued = 0;
@@ -895,7 +895,7 @@ int mach64_get_param(struct drm_device *
 		value = mach64_do_get_frames_queued(dev_priv);
 		break;
 	case MACH64_PARAM_IRQ_NR:
-		value = dev->irq;
+		value = drm_dev_to_irq(dev);
 		break;
 	default:
 		return -EINVAL;
