openwrt/target/linux/generic/files/drivers/net/phy/swconfig_leds.c
/* speed_mask file handler - store value */
speed_mask file handler - store value
speed_mask file handler - store value
static ssize_t swconfig_trig_speed_mask_store(struct device *dev,
					      struct device_attribute *attr,
					      const char *buf, size_t size)
{
	struct led_classdev *led_cdev = dev_get_drvdata(dev);
	struct swconfig_trig_data *trig_data = led_cdev->trigger_data;
	u8 speed_mask;
	int ret;
	ret = kstrtou8(buf, 0, &speed_mask);
	if (ret)
		return ret;
	write_lock(&trig_data->lock);
	trig_data->speed_mask = speed_mask & SWCONFIG_LED_PORT_SPEED_ALL;
	write_unlock(&trig_data->lock);
	return size;
}
static ssize_t swconfig_trig_speed_mask_store ( struct device * dev , struct device_attribute * attr , const char * buf , size_t size ) { struct led_classdev * led_cdev = dev_get_drvdata ( dev ) ; struct swconfig_trig_data * trig_data = led_cdev -> trigger_data ; u8 speed_mask ; int ret ; ret = kstrtou8 ( buf , 0 , & speed_mask ) ; if ( ret ) return ret ; write_lock ( & trig_data -> lock ) ; trig_data -> speed_mask = speed_mask & SWCONFIG_LED_PORT_SPEED_ALL ; write_unlock ( & trig_data -> lock ) ; return size ; }
speed_mask file handler - store value
speed_mask file handler - store value