Lines Matching refs:kdev
322 struct device *kdev; in drm_sysfs_connector_add() local
325 if (connector->kdev) in drm_sysfs_connector_add()
328 kdev = kzalloc(sizeof(*kdev), GFP_KERNEL); in drm_sysfs_connector_add()
329 if (!kdev) in drm_sysfs_connector_add()
332 device_initialize(kdev); in drm_sysfs_connector_add()
333 kdev->class = drm_class; in drm_sysfs_connector_add()
334 kdev->type = &drm_sysfs_device_connector; in drm_sysfs_connector_add()
335 kdev->parent = dev->primary->kdev; in drm_sysfs_connector_add()
336 kdev->groups = connector_dev_groups; in drm_sysfs_connector_add()
337 kdev->release = drm_sysfs_release; in drm_sysfs_connector_add()
338 dev_set_drvdata(kdev, connector); in drm_sysfs_connector_add()
340 r = dev_set_name(kdev, "card%d-%s", dev->primary->index, connector->name); in drm_sysfs_connector_add()
347 r = device_add(kdev); in drm_sysfs_connector_add()
353 connector->kdev = kdev; in drm_sysfs_connector_add()
356 return sysfs_create_link(&connector->kdev->kobj, in drm_sysfs_connector_add()
361 put_device(kdev); in drm_sysfs_connector_add()
367 if (!connector->kdev) in drm_sysfs_connector_remove()
371 sysfs_remove_link(&connector->kdev->kobj, "ddc"); in drm_sysfs_connector_remove()
376 device_unregister(connector->kdev); in drm_sysfs_connector_remove()
377 connector->kdev = NULL; in drm_sysfs_connector_remove()
387 kobject_uevent_env(&dev->primary->kdev->kobj, KOBJ_CHANGE, envp); in drm_sysfs_lease_event()
408 kobject_uevent_env(&dev->primary->kdev->kobj, KOBJ_CHANGE, envp); in drm_sysfs_hotplug_event()
439 kobject_uevent_env(&dev->primary->kdev->kobj, KOBJ_CHANGE, envp); in drm_sysfs_connector_status_event()
446 struct device *kdev; in drm_sysfs_minor_alloc() local
454 kdev = kzalloc(sizeof(*kdev), GFP_KERNEL); in drm_sysfs_minor_alloc()
455 if (!kdev) in drm_sysfs_minor_alloc()
458 device_initialize(kdev); in drm_sysfs_minor_alloc()
459 kdev->devt = MKDEV(DRM_MAJOR, minor->index); in drm_sysfs_minor_alloc()
460 kdev->class = drm_class; in drm_sysfs_minor_alloc()
461 kdev->type = &drm_sysfs_device_minor; in drm_sysfs_minor_alloc()
462 kdev->parent = minor->dev->dev; in drm_sysfs_minor_alloc()
463 kdev->release = drm_sysfs_release; in drm_sysfs_minor_alloc()
464 dev_set_drvdata(kdev, minor); in drm_sysfs_minor_alloc()
466 r = dev_set_name(kdev, minor_str, minor->index); in drm_sysfs_minor_alloc()
470 return kdev; in drm_sysfs_minor_alloc()
473 put_device(kdev); in drm_sysfs_minor_alloc()