Lines Matching defs:device
89 * @userp: buffer to copy information about new device for userspace to
96 * device in i_private of the inode.
109 struct binder_device *device;
121 /* Reserve new minor number for the new device. */
138 device = kzalloc(sizeof(*device), GFP_KERNEL);
139 if (!device)
161 refcount_set(&device->ref, 1);
162 device->binderfs_inode = inode;
163 device->context.binder_context_mgr_uid = INVALID_UID;
164 device->context.name = name;
165 device->miscdev.name = name;
166 device->miscdev.minor = minor;
167 mutex_init(&device->context.context_mgr_node_lock);
196 inode->i_private = device;
205 kfree(device);
216 * binderfs_ctl_ioctl - handle binder device node allocation requests
218 * The request handler for the binder-control device. All requests operate on
219 * the binderfs mount the binder-control device resides in:
221 * Allocate a new binder device.
230 struct binderfs_device __user *device = (struct binderfs_device __user *)arg;
235 ret = copy_from_user(&device_req, device, sizeof(device_req));
241 ret = binderfs_binder_device_create(inode, device, &device_req);
252 struct binder_device *device = inode->i_private;
257 if (!S_ISCHR(inode->i_mode) || !device)
262 ida_free(&binderfs_minors, device->miscdev.minor);
265 if (refcount_dec_and_test(&device->ref)) {
266 kfree(device->context.name);
267 kfree(device);
374 * binderfs_binder_ctl_create - create a new binder-control device
377 * This function creates a new binder-control device node in the binderfs mount
386 struct binder_device *device;
396 device = kzalloc(sizeof(*device), GFP_KERNEL);
397 if (!device)
411 /* Reserve a new minor number for the new device. */
431 refcount_set(&device->ref, 1);
432 device->binderfs_inode = inode;
433 device->miscdev.minor = minor;
439 inode->i_private = device;
446 kfree(device);
653 * just create random device nodes via mknod() since it owns the
656 * is through the binder-control device which userns root is explicitly
784 /* Verify that the default binderfs device names are valid. */