linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/1] iio: dac: stm32-dac: Replace open coded str_enable_disable()
@ 2022-06-16 22:00 Andy Shevchenko
  2022-06-18 15:37 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2022-06-16 22:00 UTC (permalink / raw)
  To: linux-iio, linux-stm32, linux-arm-kernel, linux-kernel
  Cc: Jonathan Cameron, Lars-Peter Clausen, Maxime Coquelin,
	Alexandre Torgue, Andy Shevchenko

Replace open coded str_enable_disable() in error message in
stm32_dac_set_enable_state().

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/iio/dac/stm32-dac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/dac/stm32-dac.c b/drivers/iio/dac/stm32-dac.c
index e842c15c674d..315d66648210 100644
--- a/drivers/iio/dac/stm32-dac.c
+++ b/drivers/iio/dac/stm32-dac.c
@@ -14,6 +14,7 @@
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <linux/pm_runtime.h>
+#include <linux/string_helpers.h>
 
 #include "stm32-dac-core.h"
 
@@ -79,8 +80,7 @@ static int stm32_dac_set_enable_state(struct iio_dev *indio_dev, int ch,
 	ret = regmap_update_bits(dac->common->regmap, STM32_DAC_CR, msk, en);
 	mutex_unlock(&dac->lock);
 	if (ret < 0) {
-		dev_err(&indio_dev->dev, "%s failed\n", en ?
-			"Enable" : "Disable");
+		dev_err(&indio_dev->dev, "%s failed\n", str_enable_disable(en));
 		goto err_put_pm;
 	}
 
-- 
2.35.1


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

* Re: [PATCH v1 1/1] iio: dac: stm32-dac: Replace open coded str_enable_disable()
  2022-06-16 22:00 [PATCH v1 1/1] iio: dac: stm32-dac: Replace open coded str_enable_disable() Andy Shevchenko
@ 2022-06-18 15:37 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2022-06-18 15:37 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: linux-iio, linux-stm32, linux-arm-kernel, linux-kernel,
	Lars-Peter Clausen, Maxime Coquelin, Alexandre Torgue,
	Fabrice Gasnier

On Fri, 17 Jun 2022 01:00:23 +0300
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> Replace open coded str_enable_disable() in error message in
> stm32_dac_set_enable_state().
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+CC Fabrice.

Looks good + harmless to me, so I'll pick it up now, but still time
for any additional feedback as I'll only push it out for 0-day to poke
at initially.

Applied to the togreg branch of iio.git.

Thanks,

Jonathan

> ---
>  drivers/iio/dac/stm32-dac.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/dac/stm32-dac.c b/drivers/iio/dac/stm32-dac.c
> index e842c15c674d..315d66648210 100644
> --- a/drivers/iio/dac/stm32-dac.c
> +++ b/drivers/iio/dac/stm32-dac.c
> @@ -14,6 +14,7 @@
>  #include <linux/module.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_runtime.h>
> +#include <linux/string_helpers.h>
>  
>  #include "stm32-dac-core.h"
>  
> @@ -79,8 +80,7 @@ static int stm32_dac_set_enable_state(struct iio_dev *indio_dev, int ch,
>  	ret = regmap_update_bits(dac->common->regmap, STM32_DAC_CR, msk, en);
>  	mutex_unlock(&dac->lock);
>  	if (ret < 0) {
> -		dev_err(&indio_dev->dev, "%s failed\n", en ?
> -			"Enable" : "Disable");
> +		dev_err(&indio_dev->dev, "%s failed\n", str_enable_disable(en));
>  		goto err_put_pm;
>  	}
>  


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

end of thread, other threads:[~2022-06-18 15:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-16 22:00 [PATCH v1 1/1] iio: dac: stm32-dac: Replace open coded str_enable_disable() Andy Shevchenko
2022-06-18 15:37 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).