diff options
-rw-r--r-- | drivers/base/base.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/base/base.h b/drivers/base/base.h index 0e806f641079..9e06c18c7a64 100644 --- a/drivers/base/base.h +++ b/drivers/base/base.h @@ -57,6 +57,19 @@ struct subsys_private { }; #define to_subsys_private(obj) container_of_const(obj, struct subsys_private, subsys.kobj) +static inline struct subsys_private *subsys_get(struct subsys_private *sp) +{ + if (sp) + kset_get(&sp->subsys); + return sp; +} + +static inline void subsys_put(struct subsys_private *sp) +{ + if (sp) + kset_put(&sp->subsys); +} + struct driver_private { struct kobject kobj; struct klist klist_devices; |