17 #define pr_fmt(fmt) "timed_output: " fmt
19 #include <linux/module.h>
20 #include <linux/types.h>
21 #include <linux/device.h>
27 static struct class *timed_output_class;
34 int remaining = tdev->
get_time(tdev);
36 return sprintf(buf,
"%d\n", remaining);
46 if (
sscanf(buf,
"%d", &value) != 1)
56 static int create_timed_output_class(
void)
58 if (!timed_output_class) {
60 if (IS_ERR(timed_output_class))
61 return PTR_ERR(timed_output_class);
75 ret = create_timed_output_class();
82 if (IS_ERR(tdev->
dev))
83 return PTR_ERR(tdev->
dev);
95 pr_err(
"failed to register driver %s\n",
111 static int __init timed_output_init(
void)
113 return create_timed_output_class();
116 static void __exit timed_output_exit(
void)