devicelock_dummy.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (C) 2011 Michael Buesch <m@bues.ch>
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version 2
  7. * of the License, or (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. */
  14. #include "devicelock_dummy.h"
  15. static void devicelock_dummy_destroy(struct devicelock *s)
  16. {
  17. struct devicelock_dummy *ld = container_of(s, struct devicelock_dummy, devicelock);
  18. free(ld);
  19. }
  20. static struct devicelock * devicelock_dummy_probe(void)
  21. {
  22. struct devicelock_dummy *ld;
  23. ld = zalloc(sizeof(*ld));
  24. if (!ld)
  25. return NULL;
  26. devicelock_init(&ld->devicelock, "dummy");
  27. ld->devicelock.destroy = devicelock_dummy_destroy;
  28. return &ld->devicelock;
  29. }
  30. DEVICELOCK_PROBE(dummy, devicelock_dummy_probe);