leds: leds-ns2: fix oops at module removal
authorSimon Guinot <simon.guinot@sequanux.org>
Tue, 19 Mar 2013 18:07:29 +0000 (11:07 -0700)
committerBryan Wu <cooloney@gmail.com>
Mon, 1 Apr 2013 18:04:52 +0000 (11:04 -0700)
This patch fixes a regression introduced by commit 72052fcc10
("leds: leds-ns2: add device tree binding").

When the driver is initialized with device tree data, platform_data
pointer is NULL. This causes a kernel oops at removal.

To fix this bug, num_leds is moved into driver_data and platform_data
is not longer used from ns2_led_remove().

Signed-off-by: Simon Guinot <simon.guinot@sequanux.org>
Signed-off-by: Bryan Wu <cooloney@gmail.com>
drivers/leds/leds-ns2.c

Simple merge