[PATCH 178/437] soc: sifive: ccache: convert to read/write iterators

Jens Axboe posted 437 patches 1 year, 8 months ago
[PATCH 178/437] soc: sifive: ccache: convert to read/write iterators
Posted by Jens Axboe 1 year, 8 months ago
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
 drivers/cache/sifive_ccache.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/cache/sifive_ccache.c b/drivers/cache/sifive_ccache.c
index 89ed6cd6b059..bcb6691f8f7c 100644
--- a/drivers/cache/sifive_ccache.c
+++ b/drivers/cache/sifive_ccache.c
@@ -71,12 +71,12 @@ enum {
 #ifdef CONFIG_DEBUG_FS
 static struct dentry *sifive_test;
 
-static ssize_t ccache_write(struct file *file, const char __user *data,
-			    size_t count, loff_t *ppos)
+static ssize_t ccache_write(struct kiocb *iocb, struct iov_iter *from)
 {
+	size_t count = iov_iter_count(from);
 	unsigned int val;
 
-	if (kstrtouint_from_user(data, count, 0, &val))
+	if (kstrtouint_from_iter(from, count, 0, &val))
 		return -EINVAL;
 	if ((val < 0xFF) || (val >= 0x10000 && val < 0x100FF))
 		writel(val, ccache_base + SIFIVE_CCACHE_ECCINJECTERR);
@@ -88,7 +88,7 @@ static ssize_t ccache_write(struct file *file, const char __user *data,
 static const struct file_operations ccache_fops = {
 	.owner = THIS_MODULE,
 	.open = simple_open,
-	.write = ccache_write
+	.write_iter = ccache_write
 };
 
 static void setup_sifive_debug(void)
-- 
2.43.0