[PATCH 04/17] i3c: master: Replace WARN_ON() with dev_err() in i3c_dev_free_ibi_locked()

Adrian Hunter
2025-12-19T14:46:01Z

IBI disable failures are not indicative of a software bug, so using
WARN_ON() is not appropriate. Replace these warnings with dev_err().

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
---
drivers/i3c/master.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index e6384bffd4ae..ff6cbc044787 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -3113,8 +3113,11 @@ void i3c_dev_free_ibi_locked(struct i3c_dev_desc *dev)
if (!dev->ibi)
return;

- if (WARN_ON(dev->ibi->enabled))
- WARN_ON(i3c_dev_disable_ibi_locked(dev));
+ if (dev->ibi->enabled) {
+ dev_err(&master->dev, "Freeing IBI that is still enabled\n");
+ if (i3c_dev_disable_ibi_locked(dev))
+ dev_err(&master->dev, "Failed to disable IBI before freeing\n");
+ }

master->ops->free_ibi(dev);

--
2.51.0