summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-10-26 18:58:18 +0000
committerjuhosg <juhosg@3c298f89-4303-0410-b956-a3cf2f4a3e73>2012-10-26 18:58:18 +0000
commit118178a078be6329a6b96b242e88bb85e5225cf5 (patch)
tree489d736c0949b490c80b5bb833f2265492c50622
parent52ff80a55b5069d0770d9a6b32c2943a06798150 (diff)
generic: swconfig: use led_set_brightness in LED control code
The 'led_brightness_set' function has been renamed to 'led_set_brightness' in recent ernels. Use the new name and add a compatibility patch for 3.3. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33946 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--target/linux/generic/files/drivers/net/phy/swconfig_leds.c4
-rw-r--r--target/linux/generic/patches-3.3/a01-swconfig_leds-define-leds_set_brightness.patch11
2 files changed, 13 insertions, 2 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/swconfig_leds.c b/target/linux/generic/files/drivers/net/phy/swconfig_leds.c
index 6f54cc15b..2fc5d554d 100644
--- a/target/linux/generic/files/drivers/net/phy/swconfig_leds.c
+++ b/target/linux/generic/files/drivers/net/phy/swconfig_leds.c
@@ -46,7 +46,7 @@ static void
swconfig_trig_set_brightness(struct swconfig_trig_data *trig_data,
enum led_brightness brightness)
{
- led_brightness_set(trig_data->led_cdev, brightness);
+ led_set_brightness(trig_data->led_cdev, brightness);
trig_data->prev_brightness = brightness;
}
@@ -209,7 +209,7 @@ swconfig_trig_led_event(struct switch_led_trigger *sw_trig,
link = !!(sw_trig->port_link & port_mask);
if (!link) {
if (link != trig_data->prev_link)
- led_brightness_set(trig_data->led_cdev, LED_OFF);
+ led_set_brightness(trig_data->led_cdev, LED_OFF);
} else {
unsigned long traffic;
int i;
diff --git a/target/linux/generic/patches-3.3/a01-swconfig_leds-define-leds_set_brightness.patch b/target/linux/generic/patches-3.3/a01-swconfig_leds-define-leds_set_brightness.patch
new file mode 100644
index 000000000..e9362e420
--- /dev/null
+++ b/target/linux/generic/patches-3.3/a01-swconfig_leds-define-leds_set_brightness.patch
@@ -0,0 +1,11 @@
+--- a/drivers/net/phy/swconfig_leds.c
++++ b/drivers/net/phy/swconfig_leds.c
+@@ -20,6 +20,8 @@
+ #define SWCONFIG_LED_TIMER_INTERVAL (HZ / 10)
+ #define SWCONFIG_LED_NUM_PORTS 32
+
++#define led_set_brightness(_led, _switch) led_brightness_set((_led), (_switch))
++
+ struct switch_led_trigger {
+ struct led_trigger trig;
+ struct switch_dev *swdev;