Changeset View
Changeset View
Standalone View
Standalone View
head/sys/compat/linuxkpi/common/include/linux/device.h
Show All 34 Lines | |||||
#include <linux/types.h> | #include <linux/types.h> | ||||
#include <linux/kobject.h> | #include <linux/kobject.h> | ||||
#include <linux/sysfs.h> | #include <linux/sysfs.h> | ||||
#include <linux/list.h> | #include <linux/list.h> | ||||
#include <linux/compiler.h> | #include <linux/compiler.h> | ||||
#include <linux/types.h> | #include <linux/types.h> | ||||
#include <linux/module.h> | #include <linux/module.h> | ||||
#include <linux/workqueue.h> | #include <linux/workqueue.h> | ||||
#include <linux/sysfs.h> | |||||
#include <linux/kdev_t.h> | #include <linux/kdev_t.h> | ||||
#include <asm/atomic.h> | #include <asm/atomic.h> | ||||
#include <sys/bus.h> | #include <sys/bus.h> | ||||
struct device; | struct device; | ||||
struct fwnode_handle; | struct fwnode_handle; | ||||
▲ Show 20 Lines • Show All 259 Lines • ▼ Show 20 Lines | |||||
static inline int | static inline int | ||||
device_add(struct device *dev) | device_add(struct device *dev) | ||||
{ | { | ||||
if (dev->bsddev != NULL) { | if (dev->bsddev != NULL) { | ||||
if (dev->devt == 0) | if (dev->devt == 0) | ||||
dev->devt = makedev(0, device_get_unit(dev->bsddev)); | dev->devt = makedev(0, device_get_unit(dev->bsddev)); | ||||
} | } | ||||
kobject_add(&dev->kobj, &dev->class->kobj, dev_name(dev)); | kobject_add(&dev->kobj, &dev->class->kobj, dev_name(dev)); | ||||
if (dev->groups) | |||||
return (sysfs_create_groups(&dev->kobj, dev->groups)); | |||||
return (0); | return (0); | ||||
} | } | ||||
static inline void | static inline void | ||||
device_create_release(struct device *dev) | device_create_release(struct device *dev) | ||||
{ | { | ||||
kfree(dev); | kfree(dev); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 228 Lines • Show Last 20 Lines |