Changeset 41293


Ignore:
Timestamp:
2014-06-21T12:00:07+02:00 (4 years ago)
Author:
kaloz
Message:

[ledtrig-netdev]: coding style cleanups, drop old kernel support

Signed-off-by: Imre Kaloz <kaloz@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/target/linux/generic/files/drivers/leds/ledtrig-netdev.c

    r27143 r41293  
    2828#include <linux/ctype.h> 
    2929#include <linux/leds.h> 
    30 #include <linux/version.h> 
    31  
    32 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) 
    33 #include <net/net_namespace.h> 
    34 #endif 
    3530 
    3631#include "leds.h" 
     
    10499 
    105100static ssize_t led_device_name_show(struct device *dev, 
    106                                     struct device_attribute *attr, char *buf) 
     101                struct device_attribute *attr, char *buf) 
    107102{ 
    108103        struct led_classdev *led_cdev = dev_get_drvdata(dev); 
     
    116111} 
    117112 
    118 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21) 
    119 extern struct net init_net; 
    120 #endif 
    121  
    122113static ssize_t led_device_name_store(struct device *dev, 
    123                                      struct device_attribute *attr, const char *buf, size_t size) 
     114                struct device_attribute *attr, const char *buf, size_t size) 
    124115{ 
    125116        struct led_classdev *led_cdev = dev_get_drvdata(dev); 
     
    137128        if (trigger_data->device_name[0] != 0) { 
    138129                /* check for existing device to update from */ 
    139 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26) 
    140130                trigger_data->net_dev = dev_get_by_name(&init_net, trigger_data->device_name); 
    141 #else 
    142                 trigger_data->net_dev = dev_get_by_name(trigger_data->device_name); 
    143 #endif 
    144131                if (trigger_data->net_dev != NULL) 
    145132                        trigger_data->link_up = (dev_get_flags(trigger_data->net_dev) & IFF_LOWER_UP) != 0; 
     
    154141 
    155142static ssize_t led_mode_show(struct device *dev, 
    156                              struct device_attribute *attr, char *buf) 
     143                struct device_attribute *attr, char *buf) 
    157144{ 
    158145        struct led_classdev *led_cdev = dev_get_drvdata(dev); 
     
    179166 
    180167static ssize_t led_mode_store(struct device *dev, 
    181                               struct device_attribute *attr, const char *buf, size_t size) 
     168                struct device_attribute *attr, const char *buf, size_t size) 
    182169{ 
    183170        struct led_classdev *led_cdev = dev_get_drvdata(dev); 
     
    225212 
    226213static ssize_t led_interval_show(struct device *dev, 
    227                                  struct device_attribute *attr, char *buf) 
     214                struct device_attribute *attr, char *buf) 
    228215{ 
    229216        struct led_classdev *led_cdev = dev_get_drvdata(dev); 
     
    238225 
    239226static ssize_t led_interval_store(struct device *dev, 
    240                                   struct device_attribute *attr, const char *buf, size_t size) 
     227                struct device_attribute *attr, const char *buf, size_t size) 
    241228{ 
    242229        struct led_classdev *led_cdev = dev_get_drvdata(dev); 
     
    247234        size_t count = after - buf; 
    248235 
    249         if (*after && isspace(*after)) 
     236        if (isspace(*after)) 
    250237                count++; 
    251238 
     
    254241                write_lock(&trigger_data->lock); 
    255242                trigger_data->interval = msecs_to_jiffies(value); 
    256                 set_baseline_state(trigger_data); // resets timer 
     243                set_baseline_state(trigger_data); /* resets timer */ 
    257244                write_unlock(&trigger_data->lock); 
    258245                ret = count; 
Note: See TracChangeset for help on using the changeset viewer.