core.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. *core.c
  3. *
  4. *VIA CBP driver for Linux
  5. *
  6. *Copyright (C) 2011 VIA TELECOM Corporation, Inc.
  7. *Author: VIA TELECOM Corporation, Inc.
  8. *
  9. *This package is free software; you can redistribute it and/or modify
  10. *it under the terms of the GNU General Public License version 2 as
  11. *published by the Free Software Foundation.
  12. *
  13. *THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  14. *IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  15. *WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  16. */
  17. #include <linux/module.h>
  18. #include <linux/interrupt.h>
  19. #include <linux/errno.h>
  20. #include <linux/types.h>
  21. #include <linux/delay.h>
  22. #include <linux/wait.h>
  23. #include <linux/platform_device.h>
  24. static struct kobject *c2k_kobj;
  25. struct kobject *c2k_kobject_add(const char *name)
  26. {
  27. struct kobject *kobj = NULL;
  28. if (c2k_kobj)
  29. kobj = kobject_create_and_add(name, c2k_kobj);
  30. return kobj;
  31. }
  32. static int __init c2k_core_init(void)
  33. {
  34. int ret = 0;
  35. c2k_kobj = kobject_create_and_add("c2k", NULL);
  36. if (!c2k_kobj) {
  37. ret = -ENOMEM;
  38. goto err_create_kobj;
  39. }
  40. err_create_kobj:
  41. return ret;
  42. }
  43. arch_initcall(c2k_core_init);