static int amhdmitx_remove(struct platform_device *pdev) { switch_dev_unregister(&sdev); if(hdmitx_device.HWOp.UnInit){ hdmitx_device.HWOp.UnInit(&hdmitx_device); } hdmitx_device.hpd_event = 0xff; kthread_stop(hdmitx_device.task); vout_unregister_client(&hdmitx_notifier_nb_v); #ifndef DISABLE_AUDIO aout_unregister_client(&hdmitx_notifier_nb_a); #endif /* Remove the cdev */ device_remove_file(hdmitx_dev, &dev_attr_disp_mode); device_remove_file(hdmitx_dev, &dev_attr_aud_mode); device_remove_file(hdmitx_dev, &dev_attr_edid); device_remove_file(hdmitx_dev, &dev_attr_config); device_remove_file(hdmitx_dev, &dev_attr_debug); device_remove_file(hdmitx_dev, &dev_attr_disp_cap); device_remove_file(hdmitx_dev, &dev_attr_hpd_state); device_remove_file(hdmitx_dev, &dev_attr_log); device_remove_file(hdmitx_dev, &dev_attr_cec); cdev_del(&hdmitx_device.cdev); device_destroy(hdmitx_class, hdmitx_id); class_destroy(hdmitx_class); unregister_chrdev_region(hdmitx_id, HDMI_TX_COUNT); return 0; }