[PATCH 180/437] drivers/phy: convert to ->read_iter and ->write_iter

Jens Axboe
2024-04-11T15:36:44Z

drivers/phy/mediatek/phy-mtk-tphy.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c b/drivers/phy/mediatek/phy-mtk-tphy.c
index 25b86bbb9cec..8c57e2d89415 100644
--- a/drivers/phy/mediatek/phy-mtk-tphy.c
+++ b/drivers/phy/mediatek/phy-mtk-tphy.c
@@ -448,19 +448,19 @@ static int u2_phy_params_open(struct inode *inode, struct file *file)
return single_open(file, u2_phy_params_show, inode->i_private);
}

-static ssize_t u2_phy_params_write(struct file *file, const char __user *ubuf,
- size_t count, loff_t *ppos)
+static ssize_t u2_phy_params_write(struct kiocb *iocb, struct iov_iter *from)
{
- const char *fname = file_dentry(file)->d_iname;
- struct seq_file *sf = file->private_data;
+ const char *fname = file_dentry(iocb->ki_filp)->d_iname;
+ struct seq_file *sf = iocb->ki_filp->private_data;
struct mtk_phy_instance *inst = sf->private;
struct u2phy_banks *u2_banks = &inst->u2_banks;
+ size_t count = iov_iter_count(from);
void __iomem *com = u2_banks->com;
ssize_t rc;
u32 val;
int ret;

- rc = kstrtouint_from_user(ubuf, USER_BUF_LEN(count), 0, &val);
+ rc = kstrtouint_from_iter(from, USER_BUF_LEN(count), 0, &val);
if (rc)
return rc;

@@ -504,8 +504,8 @@ static ssize_t u2_phy_params_write(struct file *file, const char __user *ubuf,

static const struct file_operations u2_phy_fops = {
.open = u2_phy_params_open,
- .write = u2_phy_params_write,
- .read = seq_read,
+ .write_iter = u2_phy_params_write,
+ .read_iter = seq_read_iter,
.llseek = seq_lseek,
.release = single_release,
};
@@ -574,19 +574,19 @@ static int u3_phy_params_open(struct inode *inode, struct file *file)
return single_open(file, u3_phy_params_show, inode->i_private);
}

-static ssize_t u3_phy_params_write(struct file *file, const char __user *ubuf,
- size_t count, loff_t *ppos)
+static ssize_t u3_phy_params_write(struct kiocb *iocb, struct iov_iter *from)
{
- const char *fname = file_dentry(file)->d_iname;
- struct seq_file *sf = file->private_data;
+ const char *fname = file_dentry(iocb->ki_filp)->d_iname;
+ struct seq_file *sf = iocb->ki_filp->private_data;
struct mtk_phy_instance *inst = sf->private;
struct u3phy_banks *u3_banks = &inst->u3_banks;
void __iomem *phyd = u3_banks->phyd;
+ size_t count = iov_iter_count(from);
ssize_t rc;
u32 val;
int ret;

- rc = kstrtouint_from_user(ubuf, USER_BUF_LEN(count), 0, &val);
+ rc = kstrtouint_from_iter(from, USER_BUF_LEN(count), 0, &val);
if (rc)
return rc;

@@ -624,8 +624,8 @@ static ssize_t u3_phy_params_write(struct file *file, const char __user *ubuf,

static const struct file_operations u3_phy_fops = {
.open = u3_phy_params_open,
- .write = u3_phy_params_write,
- .read = seq_read,
+ .write_iter = u3_phy_params_write,
+ .read_iter = seq_read_iter,
.llseek = seq_lseek,
.release = single_release,
};
--
2.43.0