w1_smem.c 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * w1_smem.c
  3. *
  4. * Copyright (c) 2004 Evgeniy Polyakov <zbr@ioremap.net>
  5. *
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the smems of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  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. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. */
  21. #include <asm/types.h>
  22. #include <linux/kernel.h>
  23. #include <linux/module.h>
  24. #include <linux/moduleparam.h>
  25. #include <linux/device.h>
  26. #include <linux/types.h>
  27. #include "../w1.h"
  28. #include "../w1_int.h"
  29. #include "../w1_family.h"
  30. MODULE_LICENSE("GPL");
  31. MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>");
  32. MODULE_DESCRIPTION("Driver for 1-wire Dallas network protocol, 64bit memory family.");
  33. MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_SMEM_01));
  34. MODULE_ALIAS("w1-family-" __stringify(W1_FAMILY_SMEM_81));
  35. static struct w1_family w1_smem_family_01 = {
  36. .fid = W1_FAMILY_SMEM_01,
  37. };
  38. static struct w1_family w1_smem_family_81 = {
  39. .fid = W1_FAMILY_SMEM_81,
  40. };
  41. static int __init w1_smem_init(void)
  42. {
  43. int err;
  44. err = w1_register_family(&w1_smem_family_01);
  45. if (err)
  46. return err;
  47. err = w1_register_family(&w1_smem_family_81);
  48. if (err) {
  49. w1_unregister_family(&w1_smem_family_01);
  50. return err;
  51. }
  52. return 0;
  53. }
  54. static void __exit w1_smem_fini(void)
  55. {
  56. w1_unregister_family(&w1_smem_family_01);
  57. w1_unregister_family(&w1_smem_family_81);
  58. }
  59. module_init(w1_smem_init);
  60. module_exit(w1_smem_fini);