static ssize_t tempcontrol_write(struct device * dev, struct device_attribute * attr, const char * buf, size_t size) { sscanf(buf, "%d\n", &temp_limit); if (temp_limit < 50000) temp_limit = 50000; if (temp_limit > 90000) temp_limit = 90000; pr_info("[imoseyon] TEMPCONTROL threshold changed to %d\n", temp_limit); tempcontrol_update(temp_limit); return size; }
static ssize_t tempcontrol_write(struct device * dev, struct device_attribute * attr, const char * buf, size_t size) { sscanf(buf, "%d\n", &temp_limit); if (temp_limit == 0) temp_limit = DEF_TEMPLIMIT; else { if (temp_limit < TEMP_FLOOR) temp_limit = TEMP_FLOOR; if (temp_limit > TEMP_CEILING) temp_limit = TEMP_CEILING; } pr_info("[imoseyon] TEMPCONTROL threshold changed to %d\n", temp_limit); tempcontrol_update(temp_limit); return size; }