[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240411153126.16201-149-axboe@kernel.dk>
Date: Thu, 11 Apr 2024 09:14:48 -0600
From: Jens Axboe <axboe@...nel.dk>
To: linux-kernel@...r.kernel.org
Cc: Jens Axboe <axboe@...nel.dk>
Subject: [PATCH 148/437] drm: armada: convert to read/write iterators
Signed-off-by: Jens Axboe <axboe@...nel.dk>
---
drivers/gpu/drm/armada/armada_debugfs.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/armada/armada_debugfs.c b/drivers/gpu/drm/armada/armada_debugfs.c
index 29f4b52e3c8d..eaa0384a3bd4 100644
--- a/drivers/gpu/drm/armada/armada_debugfs.c
+++ b/drivers/gpu/drm/armada/armada_debugfs.c
@@ -48,22 +48,23 @@ static int armada_debugfs_crtc_reg_open(struct inode *inode, struct file *file)
inode->i_private);
}
-static int armada_debugfs_crtc_reg_write(struct file *file,
- const char __user *ptr, size_t len, loff_t *off)
+static int armada_debugfs_crtc_reg_write(struct kiocb *iocb,
+ struct iov_iter *from)
{
+ size_t len = iov_iter_count(from);
struct armada_crtc *dcrtc;
unsigned long reg, mask, val;
char buf[32];
int ret;
u32 v;
- if (*off != 0)
+ if (iocb->ki_pos != 0)
return 0;
if (len > sizeof(buf) - 1)
len = sizeof(buf) - 1;
- ret = strncpy_from_user(buf, ptr, len);
+ ret = strncpy_from_iter(from, ptr, len);
if (ret < 0)
return ret;
buf[len] = '\0';
@@ -85,8 +86,8 @@ static int armada_debugfs_crtc_reg_write(struct file *file,
static const struct file_operations armada_debugfs_crtc_reg_fops = {
.owner = THIS_MODULE,
.open = armada_debugfs_crtc_reg_open,
- .read = seq_read,
- .write = armada_debugfs_crtc_reg_write,
+ .read_iter = seq_read_iter,
+ .write_iter = armada_debugfs_crtc_reg_write,
.llseek = seq_lseek,
.release = single_release,
};
--
2.43.0
Powered by blists - more mailing lists