static int __init tv_init_module(void) { int ret ; info=(disp_module_info_t*)kmalloc(sizeof(disp_module_info_t),GFP_KERNEL) ; if (!info) { amlog_mask_level(LOG_MASK_INIT,LOG_LEVEL_HIGH,"can't alloc display info struct\r\n"); return -ENOMEM; } memset(info, 0, sizeof(disp_module_info_t)); sprintf(info->name,TV_CLASS_NAME) ; ret=register_chrdev(TV_CONF_MAJOR,info->name,&am_tv_fops); if(ret <0) { amlog_mask_level(LOG_MASK_INIT,LOG_LEVEL_HIGH,"register char dev tv error\r\n"); return ret ; } info->major=TV_CONF_MAJOR; amlog_mask_level(LOG_MASK_INIT,LOG_LEVEL_HIGH,"major number %d for disp\r\n",ret); if(vout_register_server(&tv_server)) { amlog_mask_level(LOG_MASK_INIT,LOG_LEVEL_HIGH,"register tv module server fail \r\n"); } else { amlog_mask_level(LOG_MASK_INIT,LOG_LEVEL_HIGH,"register tv module server ok \r\n"); } create_tv_attr(info); return 0; }
static int __init tv_init_module(void) { int ret; #ifdef CONFIG_INSTABOOT INIT_LIST_HEAD(&tvconf_ops.node); register_syscore_ops(&tvconf_ops); #endif tv_out_ioremap(); info = &disp_module_info; vout_log_info("%s\n", __func__); sprintf(info->name, TV_CLASS_NAME); ret = register_chrdev(0, info->name, &am_tv_fops); if (ret < 0) { vout_log_err("register char dev tv error\n"); return ret; } info->major = ret; _init_vout(); vout_log_err("major number %d for disp\n", ret); if (vout_register_server(&tv_server)) vout_log_err("register tv module server fail\n"); else vout_log_info("register tv module server ok\n"); create_tv_attr(info); return 0; }
static int __init tv_init_module(void) { int ret ; #ifdef CONFIG_HIBERNATION INIT_LIST_HEAD(&tvconf_ops.node); register_syscore_ops(&tvconf_ops); #endif info=&disp_module_info; printk("%s\n", __func__); /*if (!info) { amlog_mask_level(LOG_MASK_INIT,LOG_LEVEL_HIGH,"can't alloc display info struct\n"); return -ENOMEM; }*/ memset(info, 0, sizeof(disp_module_info_t)); sprintf(info->name,TV_CLASS_NAME) ; ret=register_chrdev(0,info->name,&am_tv_fops); if(ret <0) { amlog_mask_level(LOG_MASK_INIT,LOG_LEVEL_HIGH,"register char dev tv error\n"); return ret ; } info->major=ret; _init_vout(); amlog_mask_level(LOG_MASK_INIT,LOG_LEVEL_HIGH,"major number %d for disp\n",ret); if(vout_register_server(&tv_server)) { amlog_mask_level(LOG_MASK_INIT,LOG_LEVEL_HIGH,"register tv module server fail\n"); } else { amlog_mask_level(LOG_MASK_INIT,LOG_LEVEL_HIGH,"register tv module server ok\n"); } create_tv_attr(info); return 0; }