pcspeaker.c 348 B

1234567891011121314151617181920
  1. #include <linux/platform_device.h>
  2. #include <linux/errno.h>
  3. #include <linux/init.h>
  4. static __init int add_pcspkr(void)
  5. {
  6. struct platform_device *pd;
  7. int ret;
  8. pd = platform_device_alloc("pcspkr", -1);
  9. if (!pd)
  10. return -ENOMEM;
  11. ret = platform_device_add(pd);
  12. if (ret)
  13. platform_device_put(pd);
  14. return ret;
  15. }
  16. device_initcall(add_pcspkr);