static int __init irrc_init ( void ) { APS_FUN (); if ( platform_driver_register ( &irrc_driver ) ) { APS_ERR ( "failed to register platform driver\n" ); return -ENODEV; } return 0; }
/*----------------------------------------------------------------------------*/ static int TGesture_remove(struct platform_device *pdev) { APS_FUN(); int err; printk("==============TGesture_remove==================\n"); if((err = TGesture_delete_attr(&TGesture_driver.driver))) { printk("ap3220_delete_attr fail: %d\n", err); } return 0; }
/*----------------------------------------------------------------------------*/ static int __init TGesture_init(void) { APS_FUN(); if( platform_device_register(&TGesture_sensor)) { printk("failed to register driver"); return 0; } if(platform_driver_register(&TGesture_driver)) { APS_ERR("failed to register driver"); return -ENODEV; } return 0; }
static int TGesture_probe(struct platform_device *pdev) { int err; APS_FUN(); printk("==============TGesture==================\n"); if((err = TGesture_create_attr(&TGesture_driver.driver))) { printk("create attribute err = %d\n", err); return 0; } // Create proc file system tgesture_config_proc = proc_create(TGesture_CONFIG_PROC_FILE, 0666, NULL, &config_proc_ops); if (tgesture_config_proc == NULL) { TGESTURE_DEBUG_FUNC("create_proc_entry %s failed\n", TGesture_CONFIG_PROC_FILE); } else { TGESTURE_DEBUG_FUNC("create proc entry %s success", TGesture_CONFIG_PROC_FILE); } return 0; }
/*----------------------------------------------------------------------------*/ static void __exit TGesture_exit(void) { APS_FUN(); platform_driver_unregister(&TGesture_driver); }
static void __exit irrc_exit ( void ) { APS_FUN (); platform_driver_unregister ( &irrc_driver ); }