Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 1e185c7a authored by Mike Dunn's avatar Mike Dunn Committed by Thierry Reding
Browse files

pwm: pxa: Use module_platform_driver



Commit 76abbdde

    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: default avatarMike Dunn <mikedunn@newsguy.com>
Acked-by: default avatarRobert Jarzmik <robert.jarzmik@free.fr>
Acked-by: default avatarMarek Vasut <marex@denx.de>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent ac872bc9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment