* [PATCH v1 1/1] gpio: zevio: Add missed label initialisation
@ 2024-11-15 12:38 Andy Shevchenko
2024-11-16 14:16 ` Bartosz Golaszewski
0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2024-11-15 12:38 UTC (permalink / raw)
To: Andy Shevchenko, linux-gpio, linux-kernel
Cc: Linus Walleij, Bartosz Golaszewski
Initialise the GPIO chip label correctly.
Fixes: cf8f4462e5fa ("gpio: zevio: drop of_gpio.h header")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/gpio/gpio-zevio.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpio/gpio-zevio.c b/drivers/gpio/gpio-zevio.c
index 2de61337ad3b..d7230fd83f5d 100644
--- a/drivers/gpio/gpio-zevio.c
+++ b/drivers/gpio/gpio-zevio.c
@@ -11,6 +11,7 @@
#include <linux/io.h>
#include <linux/mod_devicetable.h>
#include <linux/platform_device.h>
+#include <linux/property.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
@@ -169,6 +170,7 @@ static const struct gpio_chip zevio_gpio_chip = {
/* Initialization */
static int zevio_gpio_probe(struct platform_device *pdev)
{
+ struct device *dev = &pdev->dev;
struct zevio_gpio *controller;
int status, i;
@@ -180,6 +182,10 @@ static int zevio_gpio_probe(struct platform_device *pdev)
controller->chip = zevio_gpio_chip;
controller->chip.parent = &pdev->dev;
+ controller->chip.label = devm_kasprintf(dev, GFP_KERNEL, "%pfw", dev_fwnode(dev));
+ if (!controller->chip.label)
+ return -ENOMEM;
+
controller->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(controller->regs))
return dev_err_probe(&pdev->dev, PTR_ERR(controller->regs),
--
2.43.0.rc1.1336.g36b5255a03ac
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v1 1/1] gpio: zevio: Add missed label initialisation
2024-11-15 12:38 [PATCH v1 1/1] gpio: zevio: Add missed label initialisation Andy Shevchenko
@ 2024-11-16 14:16 ` Bartosz Golaszewski
0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2024-11-16 14:16 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: linux-gpio, linux-kernel, Linus Walleij
On Fri, Nov 15, 2024 at 1:38 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> Initialise the GPIO chip label correctly.
>
Same as altera - please improve the commit message by saying that this
was previously done by gpiolib-of.
Bart
> Fixes: cf8f4462e5fa ("gpio: zevio: drop of_gpio.h header")
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/gpio/gpio-zevio.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpio/gpio-zevio.c b/drivers/gpio/gpio-zevio.c
> index 2de61337ad3b..d7230fd83f5d 100644
> --- a/drivers/gpio/gpio-zevio.c
> +++ b/drivers/gpio/gpio-zevio.c
> @@ -11,6 +11,7 @@
> #include <linux/io.h>
> #include <linux/mod_devicetable.h>
> #include <linux/platform_device.h>
> +#include <linux/property.h>
> #include <linux/slab.h>
> #include <linux/spinlock.h>
>
> @@ -169,6 +170,7 @@ static const struct gpio_chip zevio_gpio_chip = {
> /* Initialization */
> static int zevio_gpio_probe(struct platform_device *pdev)
> {
> + struct device *dev = &pdev->dev;
> struct zevio_gpio *controller;
> int status, i;
>
> @@ -180,6 +182,10 @@ static int zevio_gpio_probe(struct platform_device *pdev)
> controller->chip = zevio_gpio_chip;
> controller->chip.parent = &pdev->dev;
>
> + controller->chip.label = devm_kasprintf(dev, GFP_KERNEL, "%pfw", dev_fwnode(dev));
> + if (!controller->chip.label)
> + return -ENOMEM;
> +
> controller->regs = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(controller->regs))
> return dev_err_probe(&pdev->dev, PTR_ERR(controller->regs),
> --
> 2.43.0.rc1.1336.g36b5255a03ac
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-11-16 14:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-15 12:38 [PATCH v1 1/1] gpio: zevio: Add missed label initialisation Andy Shevchenko
2024-11-16 14:16 ` Bartosz Golaszewski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox