* [PATCH 0/2] i2c: stm32: A few cleanups
@ 2021-12-01 11:47 Alain Volmat
2021-12-01 11:47 ` [PATCH 1/2] i2c: stm32: get rid of stm32f7_i2c_release_bus return value Alain Volmat
2021-12-01 11:47 ` [PATCH v2 2/2] i2c: stm32f7: remove noisy and imprecise log messages Alain Volmat
0 siblings, 2 replies; 3+ messages in thread
From: Alain Volmat @ 2021-12-01 11:47 UTC (permalink / raw)
To: wsa, pierre-yves.mordret
Cc: alexandre.torgue, linux-i2c, linux-stm32, linux-arm-kernel,
linux-kernel, fabrice.gasnier, amelie.delaunay, alain.volmat
A few cleanup, removal of unnecessary messages regarding bus busy
and recovering bus.
Make the function stm32f7_i2c_release_bus void since it is never
returning any error message, allowing to get rid of the error handling
within the calling function.
Alain Volmat (1):
i2c: stm32: get rid of stm32f7_i2c_release_bus return value
Wolfram Sang (1):
i2c: stm32f7: remove noisy and imprecise log messages
drivers/i2c/busses/i2c-stm32f7.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/2] i2c: stm32: get rid of stm32f7_i2c_release_bus return value
2021-12-01 11:47 [PATCH 0/2] i2c: stm32: A few cleanups Alain Volmat
@ 2021-12-01 11:47 ` Alain Volmat
2021-12-01 11:47 ` [PATCH v2 2/2] i2c: stm32f7: remove noisy and imprecise log messages Alain Volmat
1 sibling, 0 replies; 3+ messages in thread
From: Alain Volmat @ 2021-12-01 11:47 UTC (permalink / raw)
To: wsa, pierre-yves.mordret
Cc: alexandre.torgue, linux-i2c, linux-stm32, linux-arm-kernel,
linux-kernel, fabrice.gasnier, amelie.delaunay, alain.volmat
Function stm32f7_i2c_release_bus is always returning 0, hence it
should be a void function. Update the function and remove the
return value error checking code in caller functions.
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
---
drivers/i2c/busses/i2c-stm32f7.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
index 66145d2b9b55..fcf43b3ac64f 100644
--- a/drivers/i2c/busses/i2c-stm32f7.c
+++ b/drivers/i2c/busses/i2c-stm32f7.c
@@ -828,7 +828,7 @@ static void stm32f7_i2c_smbus_reload(struct stm32f7_i2c_dev *i2c_dev)
writel_relaxed(cr2, i2c_dev->base + STM32F7_I2C_CR2);
}
-static int stm32f7_i2c_release_bus(struct i2c_adapter *i2c_adap)
+static void stm32f7_i2c_release_bus(struct i2c_adapter *i2c_adap)
{
struct stm32f7_i2c_dev *i2c_dev = i2c_get_adapdata(i2c_adap);
@@ -838,8 +838,6 @@ static int stm32f7_i2c_release_bus(struct i2c_adapter *i2c_adap)
STM32F7_I2C_CR1_PE);
stm32f7_i2c_hw_config(i2c_dev);
-
- return 0;
}
static int stm32f7_i2c_wait_free_bus(struct stm32f7_i2c_dev *i2c_dev)
@@ -856,11 +854,7 @@ static int stm32f7_i2c_wait_free_bus(struct stm32f7_i2c_dev *i2c_dev)
dev_info(i2c_dev->dev, "bus busy\n");
- ret = stm32f7_i2c_release_bus(&i2c_dev->adap);
- if (ret) {
- dev_err(i2c_dev->dev, "Failed to recover the bus (%d)\n", ret);
- return ret;
- }
+ stm32f7_i2c_release_bus(&i2c_dev->adap);
return -EBUSY;
}
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH v2 2/2] i2c: stm32f7: remove noisy and imprecise log messages
2021-12-01 11:47 [PATCH 0/2] i2c: stm32: A few cleanups Alain Volmat
2021-12-01 11:47 ` [PATCH 1/2] i2c: stm32: get rid of stm32f7_i2c_release_bus return value Alain Volmat
@ 2021-12-01 11:47 ` Alain Volmat
1 sibling, 0 replies; 3+ messages in thread
From: Alain Volmat @ 2021-12-01 11:47 UTC (permalink / raw)
To: wsa, pierre-yves.mordret
Cc: alexandre.torgue, linux-i2c, linux-stm32, linux-arm-kernel,
linux-kernel, fabrice.gasnier, amelie.delaunay, alain.volmat
From: Wolfram Sang <wsa@kernel.org>
The log messages talk about 'bus recovery' while it is not a bus
recovery with 9 pulses but merely a controller reset. Controller resets
are not worth log messages. The 'bus busy' message should be emitted by
upper layers, a busy bus may be expected in some cases.
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Reviewed-by: Alain Volmat <alain.volmat@foss.st.com>
---
v2: s/expectected/expected
reworked on top of patch making stm32f7_i2c_release_bus a void
function
drivers/i2c/busses/i2c-stm32f7.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
index fcf43b3ac64f..6d4aa64b195d 100644
--- a/drivers/i2c/busses/i2c-stm32f7.c
+++ b/drivers/i2c/busses/i2c-stm32f7.c
@@ -832,8 +832,6 @@ static void stm32f7_i2c_release_bus(struct i2c_adapter *i2c_adap)
{
struct stm32f7_i2c_dev *i2c_dev = i2c_get_adapdata(i2c_adap);
- dev_info(i2c_dev->dev, "Trying to recover bus\n");
-
stm32f7_i2c_clr_bits(i2c_dev->base + STM32F7_I2C_CR1,
STM32F7_I2C_CR1_PE);
@@ -852,8 +850,6 @@ static int stm32f7_i2c_wait_free_bus(struct stm32f7_i2c_dev *i2c_dev)
if (!ret)
return 0;
- dev_info(i2c_dev->dev, "bus busy\n");
-
stm32f7_i2c_release_bus(&i2c_dev->adap);
return -EBUSY;
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-12-01 11:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01 11:47 [PATCH 0/2] i2c: stm32: A few cleanups Alain Volmat
2021-12-01 11:47 ` [PATCH 1/2] i2c: stm32: get rid of stm32f7_i2c_release_bus return value Alain Volmat
2021-12-01 11:47 ` [PATCH v2 2/2] i2c: stm32f7: remove noisy and imprecise log messages Alain Volmat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®