From: Mike Dunn Date: Thu, 8 Aug 2013 17:00:37 +0000 (-0700) Subject: pwm: pxa: Use module_platform_driver X-Git-Tag: v3.12-rc1~171^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e185c7aafbb56580feaa5bdbc9e4b1d8efaf710;p=pandora-kernel.git pwm: pxa: Use module_platform_driver Commit 76abbdde2d95a3807d0dc6bf9f84d03d0dbd4f3d pwm: Add sysfs interface causes a kernel oops due to a null pointer dereference on PXA platforms. This happens because the class added by the patch is registered in a subsys_initcall (initcall4), but the pxa pwm driver is registered in arch_initcall (initcall3). If the class is not registered before the driver probe function runs, the oops occurs in device_add() when the uninitialized pointers in struct class are dereferenced. I don't see a reason that the driver must be an arch_initcall, so this patch makes it a regular module_platform_driver (initcall6), preventing the oops. Signed-off-by: Mike Dunn Acked-by: Robert Jarzmik Acked-by: Marek Vasut Signed-off-by: Thierry Reding --- Reading git-diff-tree failed