[PATCH 3/3] i3c: master: Use unsigned int for dev_nack_retry_count consistently
Adrian Hunter
adrian.hunter at intel.com
Tue Jun 16 04:37:52 PDT 2026
Use unsigned int for dev_nack_retry_count across the core and
controller drivers to match the type of master->dev_nack_retry_count.
Update the sysfs store path to use kstrtouint() and adjust the
->set_dev_nack_retry() callback prototype and callers accordingly.
Signed-off-by: Adrian Hunter <adrian.hunter at intel.com>
---
drivers/i3c/master.c | 4 ++--
drivers/i3c/master/dw-i3c-master.c | 4 ++--
include/linux/i3c/master.h | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 903ac01ab413..58d20624ed05 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -760,10 +760,10 @@ static ssize_t dev_nack_retry_count_store(struct device *dev,
{
struct i3c_bus *i3cbus = dev_to_i3cbus(dev);
struct i3c_master_controller *master = dev_to_i3cmaster(dev);
- unsigned long val;
+ unsigned int val;
int ret;
- ret = kstrtoul(buf, 0, &val);
+ ret = kstrtouint(buf, 0, &val);
if (ret)
return ret;
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index c7030d0cd8a6..e4f6d6f29ed5 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -1481,7 +1481,7 @@ static irqreturn_t dw_i3c_master_irq_handler(int irq, void *dev_id)
}
static int dw_i3c_master_set_dev_nack_retry(struct i3c_master_controller *m,
- unsigned long dev_nack_retry_cnt)
+ unsigned int dev_nack_retry_cnt)
{
struct dw_i3c_master *master = to_dw_i3c_master(m);
u32 reg;
@@ -1489,7 +1489,7 @@ static int dw_i3c_master_set_dev_nack_retry(struct i3c_master_controller *m,
if (dev_nack_retry_cnt > DW_I3C_DEV_NACK_RETRY_CNT_MAX) {
dev_err(&master->base.dev,
- "Value %ld exceeds maximum %d\n",
+ "Value %u exceeds maximum %d\n",
dev_nack_retry_cnt, DW_I3C_DEV_NACK_RETRY_CNT_MAX);
return -ERANGE;
}
diff --git a/include/linux/i3c/master.h b/include/linux/i3c/master.h
index f73cede87d36..6f0379bdbb6d 100644
--- a/include/linux/i3c/master.h
+++ b/include/linux/i3c/master.h
@@ -494,7 +494,7 @@ struct i3c_master_controller_ops {
int (*disable_hotjoin)(struct i3c_master_controller *master);
int (*set_speed)(struct i3c_master_controller *master, enum i3c_open_drain_speed speed);
int (*set_dev_nack_retry)(struct i3c_master_controller *master,
- unsigned long dev_nack_retry_cnt);
+ unsigned int dev_nack_retry_cnt);
};
/**
--
2.51.0
More information about the linux-i3c
mailing list