diff mbox series

[v1,3/3] gpiolib: Move error message out of a spinlock

Message ID 20220330145910.1946-3-andriy.shevchenko@linux.intel.com
State New
Headers show
Series [v1,1/3] gpiolib: Split out for_each_gpio_desc() macro | expand

Commit Message

Andy Shevchenko March 30, 2022, 2:59 p.m. UTC
An error path is a slow path, no need to block other CPUs
when printing error messages.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/gpio/gpiolib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bartosz Golaszewski April 9, 2022, 8:36 p.m. UTC | #1
On Wed, Mar 30, 2022 at 4:59 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> An error path is a slow path, no need to block other CPUs
> when printing error messages.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/gpio/gpiolib.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index f956c533f218..062d127d9a0d 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -289,7 +289,6 @@ static int gpiodev_add_to_list(struct gpio_device *gdev)
>                 }
>         }
>
> -       dev_err(&gdev->dev, "GPIO integer space overlap, cannot add chip\n");
>         return -EBUSY;
>  }
>
> @@ -724,6 +723,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
>         ret = gpiodev_add_to_list(gdev);
>         if (ret) {
>                 spin_unlock_irqrestore(&gpio_lock, flags);
> +               chip_err(gc, "GPIO integer space overlap, cannot add chip\n");
>                 goto err_free_label;
>         }
>
> --
> 2.35.1
>

Applied, thanks!

Bart
diff mbox series

Patch

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index f956c533f218..062d127d9a0d 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -289,7 +289,6 @@  static int gpiodev_add_to_list(struct gpio_device *gdev)
 		}
 	}
 
-	dev_err(&gdev->dev, "GPIO integer space overlap, cannot add chip\n");
 	return -EBUSY;
 }
 
@@ -724,6 +723,7 @@  int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
 	ret = gpiodev_add_to_list(gdev);
 	if (ret) {
 		spin_unlock_irqrestore(&gpio_lock, flags);
+		chip_err(gc, "GPIO integer space overlap, cannot add chip\n");
 		goto err_free_label;
 	}