s3cmci-dont-leak-pdata.patch

When compiling s3cmci as a module and doing an insmod-rmmod-insmod
sequence, s3cmci_probe often oopses because the platform data contains
garbage.

The reason for this is that I'm not providing any platform data (removed
in gta02-mmc-mci.patch), and thus s3cmci tries to put its own defaults:

        if (!host->pdata) {
                pdev->dev.platform_data = &s3cmci_def_pdata;
                host->pdata = &s3cmci_def_pdata;
        }

s3cmci_def_pdata is inside the module, so the pointer in
pdev->dev.platform_data becomes invalid after the module is unloaded.

Since nothing else in s3cmci uses pdev->dev.platform_data, "patching"
it seems unnecessary. This patch removes it.

Signed-off-by: Werner Almesberger <werner@openmoko.org>

Index: ktrack/drivers/mmc/host/s3cmci.c
===================================================================
--- ktrack.orig/drivers/mmc/host/s3cmci.c	2008-11-18 20:14:12.000000000 -0200
+++ ktrack/drivers/mmc/host/s3cmci.c	2008-11-18 20:14:40.000000000 -0200
@@ -1278,10 +1278,8 @@
 	host->is2440	= is2440;
 
 	host->pdata = pdev->dev.platform_data;
-	if (!host->pdata) {
-		pdev->dev.platform_data = &s3cmci_def_pdata;
+	if (!host->pdata)
 		host->pdata = &s3cmci_def_pdata;
-	}
 
 	spin_lock_init(&host->complete_lock);
 	tasklet_init(&host->pio_tasklet, pio_tasklet, (unsigned long) host);
