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>
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);