sb_sysfs.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * sb_sysfs.h
  3. * Samsung Mobile SysFS Header
  4. *
  5. * Copyright (C) 2021 Samsung Electronics, Inc.
  6. *
  7. *
  8. * This software is licensed under the terms of the GNU General Public
  9. * License version 2, as published by the Free Software Foundation, and
  10. * may be copied, distributed, and modified under those terms.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. */
  18. #ifndef __SB_SYSFS_H
  19. #define __SB_SYSFS_H __FILE__
  20. #include <linux/err.h>
  21. #include <linux/device.h>
  22. #define SB_SYSFS_DISABLE (-3662)
  23. #if IS_ENABLED(CONFIG_SB_SYSFS)
  24. int sb_sysfs_add_attrs(const char *name, void *pdata, struct device_attribute *attr, unsigned long size);
  25. int sb_sysfs_remove_attrs(const char *name);
  26. void *sb_sysfs_get_pdata(const char *name);
  27. int sb_sysfs_create_attrs(struct device *dev);
  28. #else
  29. static inline int sb_sysfs_add_attrs(const char *name, void *pdata, struct device_attribute *attr, unsigned long size)
  30. { return SB_SYSFS_DISABLE; }
  31. static inline int sb_sysfs_remove_attrs(const char *name)
  32. { return SB_SYSFS_DISABLE; }
  33. static inline void *sb_sysfs_get_pdata(const char *name)
  34. { return ERR_PTR(SB_SYSFS_DISABLE); }
  35. static inline int sb_sysfs_create_attrs(struct device *dev)
  36. { return SB_SYSFS_DISABLE; }
  37. #endif
  38. #endif /* __SB_SYSFS_H */