static int SMI_Release(struct inode * a_pstInode, struct file * a_pstFile) { if(NULL != auto_trigger_result) { kfree(auto_trigger_result); } g_Occupied = 0; //printk("SMI Monitor closed!!\n"); SMI_PowerOff(); return 0; }
int SMIProc_smi_pow_write(struct file *file, const char __user *buffer, unsigned long count, void *data) { char cmd_buf[64] = {'\0'}; unsigned long buf_size = (count < (sizeof(cmd_buf) - 1)) ? (count) : (sizeof(cmd_buf) - 1); // if (copy_from_user(cmd_buf, buffer, buf_size)) return -EFAULT; sscanf(cmd_buf, "%lu ", &smi_power); if(smi_power > 0) { SMI_PowerOn(); } else { SMI_PowerOff(); } return count; }
static void smi_uninit(void) { //SMI_DeInit(); SMI_PowerOff(); }