All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/3] iio: temperature: ltc2983: Don't hard code defined constants in messages
@ 2022-02-07 10:48 Andy Shevchenko
  2022-02-07 10:48 ` [PATCH v2 2/3] iio: temperature: ltc2983: Use single error path to put OF node Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Andy Shevchenko @ 2022-02-07 10:48 UTC (permalink / raw)
  To: Andy Shevchenko, linux-iio, linux-kernel
  Cc: Nuno Sá, Jonathan Cameron, Lars-Peter Clausen

In a couple of messages the constants, which have their definitions,
are hard coded into the message text. Unhardcode them.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
---
v2: added Rb tag (Nuno)
 drivers/iio/temperature/ltc2983.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c
index 301c3f13fb26..d272c303c1b0 100644
--- a/drivers/iio/temperature/ltc2983.c
+++ b/drivers/iio/temperature/ltc2983.c
@@ -409,8 +409,8 @@ static struct ltc2983_custom_sensor *__ltc2983_custom_sensor_new(
 	new_custom->size = n_entries * n_size;
 	/* check Steinhart size */
 	if (is_steinhart && new_custom->size != LTC2983_CUSTOM_STEINHART_SIZE) {
-		dev_err(dev, "Steinhart sensors size(%zu) must be 24",
-							new_custom->size);
+		dev_err(dev, "Steinhart sensors size(%zu) must be %d", new_custom->size,
+			LTC2983_CUSTOM_STEINHART_SIZE);
 		return ERR_PTR(-EINVAL);
 	}
 	/* Check space on the table. */
@@ -1299,8 +1299,8 @@ static int ltc2983_parse_dt(struct ltc2983_data *st)
 		if (sensor.chan < LTC2983_MIN_CHANNELS_NR ||
 		    sensor.chan > LTC2983_MAX_CHANNELS_NR) {
 			ret = -EINVAL;
-			dev_err(dev,
-				"chan:%d must be from 1 to 20\n", sensor.chan);
+			dev_err(dev, "chan:%d must be from %d to %d\n", sensor.chan,
+				LTC2983_MIN_CHANNELS_NR, LTC2983_MAX_CHANNELS_NR);
 			goto put_child;
 		} else if (channel_avail_mask & BIT(sensor.chan)) {
 			ret = -EINVAL;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-02-10 13:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-07 10:48 [PATCH v2 1/3] iio: temperature: ltc2983: Don't hard code defined constants in messages Andy Shevchenko
2022-02-07 10:48 ` [PATCH v2 2/3] iio: temperature: ltc2983: Use single error path to put OF node Andy Shevchenko
2022-02-07 10:48 ` [PATCH v2 3/3] iio: temperature: ltc2983: Make use of device properties Andy Shevchenko
2022-02-07 16:37 ` [PATCH v2 1/3] iio: temperature: ltc2983: Don't hard code defined constants in messages Joe Perches
2022-02-07 17:21   ` Andy Shevchenko
2022-02-07 17:29     ` Joe Perches
2022-02-07 20:44     ` Jonathan Cameron
2022-02-10 13:54       ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.