Subject: [PATCH] Fix platform_driver emulation for kernels <= 2.6.14 The platform_driver_register() substitute in alsa-driver-1.0.10 sets drv->driver.probe and drv->driver.remove functions without checking for non-NULL drv->probe and drv->remove; snd_platform_driver_probe() and snd_platform_driver_remove() also do not check for NULL in those fields. However, snd_generic_driver has NULL ->probe and ->remove functions, therefore attempts to use it on kernels <= 2.6.14 lead to oopses. This patch changes platform_driver_register() provided by alsa-driver for old kernels to match the implementation in post-2.6.14 kernels, which checks for NULL ->probe and ->remove functions. Signed-off-by: Sergey Vlasov --- alsa-driver-1.0.10/include/platform_device_compat.h.alt-platform_device_compat 2005-11-14 17:42:27 +0300 +++ alsa-driver-1.0.10/include/platform_device_compat.h 2005-12-03 23:01:26 +0300 @@ -61,8 +61,10 @@ static inline int platform_driver_register(struct platform_driver *drv) { drv->driver.bus = &platform_bus_type; - drv->driver.probe = snd_platform_driver_probe; - drv->driver.remove = snd_platform_driver_remove; + if (drv->probe) + drv->driver.probe = snd_platform_driver_probe; + if (drv->remove) + drv->driver.remove = snd_platform_driver_remove; if (drv->suspend) drv->driver.suspend = snd_platform_driver_suspend; if (drv->resume)