1074 lines · 23.9 KB · C
RawDownload
	evdev->handle.private = evdev; 	evdev->dev.devt = MKDEV(INPUT_MAJOR, EVDEV_MINOR_BASE + minor);	evdev->dev.class = &input_class;	evdev->dev.parent = &dev->dev;	evdev->dev.release = evdev_free;	device_initialize(&evdev->dev); 	error = input_register_handle(&evdev->handle);	if (error)		goto err_free_evdev; 	error = evdev_install_chrdev(evdev);	if (error)		goto err_unregister_handle; 	error = device_add(&evdev->dev);	if (error)		goto err_cleanup_evdev; 	return 0;  err_cleanup_evdev:	evdev_cleanup(evdev); err_unregister_handle:	input_unregister_handle(&evdev->handle); err_free_evdev:	put_device(&evdev->dev);	return error;} static void evdev_disconnect(struct input_handle *handle){	struct evdev *evdev = handle->private; 	device_del(&evdev->dev);	evdev_cleanup(evdev);	input_unregister_handle(handle);	put_device(&evdev->dev);} static const struct input_device_id evdev_ids[] = {	{ .driver_info = 1 },	/* Matches all devices */	{ },			/* Terminating zero entry */}; MODULE_DEVICE_TABLE(input, evdev_ids); static struct input_handler evdev_handler = {	.event		= evdev_event,	.connect	= evdev_connect,	.disconnect	= evdev_disconnect,	.fops		= &evdev_fops,	.minor		= EVDEV_MINOR_BASE,	.name		= "evdev",	.id_table	= evdev_ids,}; static int __init evdev_init(void){	return input_register_handler(&evdev_handler);} static void __exit evdev_exit(void){	input_unregister_handler(&evdev_handler);} module_init(evdev_init);module_exit(evdev_exit); MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");MODULE_DESCRIPTION("Input driver event char devices");MODULE_LICENSE("GPL");

Lines 1001–1074 of 1074. Previous lines

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t