1#ifndef __VSF_LINUX_DEVICE_H__
2#define __VSF_LINUX_DEVICE_H__
49static inline const char * dev_bus_name(
const struct device *dev)
54static inline const char * dev_name(
const struct device *dev)
56 return kobject_name(&dev->
kobj);
59static inline void * dev_get_drvdata(
const struct device *dev)
64static inline void dev_set_drvdata(
struct device *dev,
void *
data)
69#define dev_dbg(__dev, __fmt, ...) pr_debug(__fmt, ##__VA_ARGS__)
70#define dev_emerg(__dev, __fmt, ...) pr_emerg(__fmt, ##__VA_ARGS__)
71#define dev_crit(__dev, __fmt, ...) pr_crit(__fmt, ##__VA_ARGS__)
72#define dev_alert(__dev, __fmt, ...) pr_alert(__fmt, ##__VA_ARGS__)
73#define dev_err(__dev, __fmt, ...) pr_err(__fmt, ##__VA_ARGS__)
74#define dev_warn(__dev, __fmt, ...) pr_warn(__fmt, ##__VA_ARGS__)
75#define dev_notice(__dev, __fmt, ...) pr_notice(__fmt, ##__VA_ARGS__)
76#define dev_info(__dev, __fmt, ...) pr_info(__fmt, ##__VA_ARGS__)
78#define dev_level_once(__level, __dev, __fmt, ...) \
80 static bool __printed = false; \
83 __level(__dev, __fmt, ##__VA_ARGS__); \
86#define dev_dbg_once(__dev, __fmt, ...) dev_level_once(dev_dbg, __dev, __fmt, ##__VA_ARGS__)
87#define dev_emerg_once(__dev, __fmt, ...) dev_level_once(dev_emerg, __dev, __fmt, ##__VA_ARGS__)
88#define dev_crit_once(__dev, __fmt, ...) dev_level_once(dev_crit, __dev, __fmt, ##__VA_ARGS__)
89#define dev_alert_once(__dev, __fmt, ...) dev_level_once(dev_alert, __dev, __fmt, ##__VA_ARGS__)
90#define dev_err_once(__dev, __fmt, ...) dev_level_once(dev_err, __dev, __fmt, ##__VA_ARGS__)
91#define dev_warn_once(__dev, __fmt, ...) dev_level_once(dev_warn, __dev, __fmt, ##__VA_ARGS__)
92#define dev_notice_once(__dev, __fmt, ...) dev_level_once(dev_notice, __dev, __fmt, ##__VA_ARGS__)
93#define dev_info_once(__dev, __fmt, ...) dev_level_once(dev_info, __dev, __fmt, ##__VA_ARGS__)
101#define device_wakeup_enable(__dev)
102#define device_wakeup_disable(__dev)
104static inline int device_is_registered(
struct device *dev)
114static inline void * devm_kmalloc(
struct device *dev,
size_t size,
gfp_t gfp)
116 return kmalloc(
size, gfp);
118static inline void * devm_krealloc(
struct device *dev,
void *ptr,
size_t size,
gfp_t gfp)
120 return krealloc(ptr,
size, gfp);
122static inline void *devm_kzalloc(
struct device *dev,
size_t size,
gfp_t gfp)
126static inline void devm_kfree(
struct device *dev,
const void *p)
#define vsf_container_of(__ptr, __type, __member)
Definition __type.h:164
#define __GFP_ZERO
Definition gfp.h:12
unsigned int gfp_t
Definition gfp.h:10
struct ieee80211_ext_chansw_ie data
Definition ieee80211.h:80
int ssize_t
Definition types.h:68
#define NULL
Definition lvgl.h:26
unsigned int u32
Definition lvgl.h:43
int device_register(struct device *dev)
Definition vsf_linux_core.c:581
char * devm_kasprintf(struct device *dev, gfp_t gfp, const char *fmt,...)
Definition vsf_linux_core.c:979
bool kill_device(struct device *dev)
int device_add(struct device *dev)
Definition vsf_linux_core.c:550
void device_unregister(struct device *dev)
Definition vsf_linux_core.c:587
int dev_set_name(struct device *dev, const char *fmt,...)
Definition vsf_linux_core.c:534
char * devm_kvasprintf(struct device *dev, gfp_t gfp, const char *fmt, va_list ap)
Definition vsf_linux_core.c:960
void device_initialize(struct device *dev)
Definition vsf_linux_core.c:545
void put_device(struct device *dev)
Definition vsf_linux_core.c:527
void device_del(struct device *dev)
Definition vsf_linux_core.c:573
struct device * get_device(struct device *dev)
Definition vsf_linux_core.c:519
const char * name
Definition bus.h:16
struct attribute attr
Definition device.h:28
ssize_t(* show)(struct device *dev, struct device_attribute *attr, char *buf)
Definition device.h:29
ssize_t(* store)(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
Definition device.h:30
int(* uevent)(struct device *dev, struct kobj_uevent_env *env)
Definition device.h:22
const struct dev_pm_ops * pm
Definition device.h:24
const char * name
Definition device.h:21
void(* release)(struct device *dev)
Definition device.h:23
const struct device_type * type
Definition device.h:38
struct device * parent
Definition device.h:35
struct bus_type * bus
Definition device.h:39
struct kobject kobj
Definition device.h:34
struct device_driver * driver
Definition device.h:40
u32 id
Definition device.h:37
void * driver_data
Definition device.h:41
bool state_in_sysfs
Definition kobject.h:20
uint32_t size
Definition vsf_memfs.h:50