From 80c37bca675f02fb2bfe71f6ae5ba0232c65bd40 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Tue, 14 May 2024 13:42:06 +0200 Subject: week 2 done: fix driver (reboot'd) --- driver/fopdrv.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'driver/fopdrv.c') diff --git a/driver/fopdrv.c b/driver/fopdrv.c index 18a1d35..87aa30e 100644 --- a/driver/fopdrv.c +++ b/driver/fopdrv.c @@ -7,8 +7,6 @@ bool printed = false; // driver/char/mem.c read_null (/dev/null) ssize_t fop_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) { - printk("%s(, , %u, )\n", __PRETTY_FUNCTION__, count); - if (count < 2) return 0; if (printed) return 0; @@ -29,8 +27,6 @@ ssize_t fop_read(struct file *file, char __user *buf, size_t count, loff_t *ppos } ssize_t fop_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) { - printk("%s(, , %u, )\n", __PRETTY_FUNCTION__, count); - // only allow single character as input if (count < 1) return count; if (count > 2) return count; @@ -44,11 +40,11 @@ ssize_t fop_write(struct file *file, const char __user *buf, size_t count, loff_ barrier(); if (input_buf[0] == '0') { - printk("TODO: TURN OFF OUTPUT\n"); + printk(DRV_NAME": OUTPUT OFF\n"); iowrite32((1<, )\n", __PRETTY_FUNCTION__); printed = false; return 0; // 0 seems to be a safe return value as it's used in driver/char/mem.c. The @@ -68,7 +63,6 @@ int fop_open(struct inode * inode, struct file * file) { } int fop_release(struct inode * inode, struct file * file) { - printk("%s(, )\n", __PRETTY_FUNCTION__); return 0; // same as above, but found in driver/char/lp.c } -- cgit v1.2.3