iio: temperature: ltc2983: Don't hard code defined constants in messages
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 7 Mar 2022 20:36:04 +0000 (22:36 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Mon, 4 Apr 2022 08:11:24 +0000 (09:11 +0100)
In a couple of messages the constants, which have their definitions,
are hard coded into the message text. Unhardcode them.

While at it, add a trailing \n where it's currently missing.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20220307203606.87258-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/temperature/ltc2983.c

index 301c3f13fb26c23a8ff8a154212ee73fb43f24be..94d6dd4db47af8cd394945eeaa47ea9d0c4d7c7d 100644 (file)
@@ -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 %u\n", 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 %u to %u\n", sensor.chan,
+                               LTC2983_MIN_CHANNELS_NR, LTC2983_MAX_CHANNELS_NR);
                        goto put_child;
                } else if (channel_avail_mask & BIT(sensor.chan)) {
                        ret = -EINVAL;