diff mbox series

[09/23] gpio: mockup: use KBUILD_MODNAME

Message ID 20200904154547.3836-10-brgl@bgdev.pl (mailing list archive)
State Not Applicable, archived
Headers show
Series gpio: mockup: support dynamically created and removed chips | expand

Commit Message

Bartosz Golaszewski Sept. 4, 2020, 3:45 p.m. UTC
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Drop the definition for the driver name. Let's use KBUILD_MODNAME for
the log format and use the "gpio-mockup" value directly in the only
place where it's relevant: in the name of the device.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 drivers/gpio/gpio-mockup.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Andy Shevchenko Sept. 4, 2020, 4:30 p.m. UTC | #1
On Fri, Sep 04, 2020 at 05:45:33PM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> Drop the definition for the driver name. Let's use KBUILD_MODNAME for
> the log format and use the "gpio-mockup" value directly in the only
> place where it's relevant: in the name of the device.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> ---
>  drivers/gpio/gpio-mockup.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-mockup.c b/drivers/gpio/gpio-mockup.c
> index 73cd51459c2a..78c97f7b6893 100644
> --- a/drivers/gpio/gpio-mockup.c
> +++ b/drivers/gpio/gpio-mockup.c
> @@ -22,9 +22,8 @@
>  #include "gpiolib.h"

>  #undef pr_fmt
> -#define pr_fmt(fmt)		GPIO_MOCKUP_NAME ": " fmt
> +#define pr_fmt(fmt)		KBUILD_MODNAME ": " fmt

This should be part of previous patch with something like "this is equivalent
right now".

> -#define GPIO_MOCKUP_NAME	"gpio-mockup"
>  #define GPIO_MOCKUP_MAX_GC	10
>  /*
>   * We're storing two values per chip: the GPIO base and the number
> @@ -501,7 +500,7 @@ static int gpio_mockup_probe(struct platform_device *pdev)
>  
>  static struct platform_driver gpio_mockup_driver = {
>  	.driver = {
> -		.name = GPIO_MOCKUP_NAME,
> +		.name = "gpio-mockup",
>  	},
>  	.probe = gpio_mockup_probe,
>  };
> @@ -572,7 +571,7 @@ static int __init gpio_mockup_init(void)
>  			properties[prop++] = PROPERTY_ENTRY_BOOL(
>  						"named-gpio-lines");
>  
> -		pdevinfo.name = GPIO_MOCKUP_NAME;
> +		pdevinfo.name = "gpio-mockup";
>  		pdevinfo.id = i;
>  		pdevinfo.properties = properties;
>  
> -- 
> 2.26.1
>
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-mockup.c b/drivers/gpio/gpio-mockup.c
index 73cd51459c2a..78c97f7b6893 100644
--- a/drivers/gpio/gpio-mockup.c
+++ b/drivers/gpio/gpio-mockup.c
@@ -22,9 +22,8 @@ 
 #include "gpiolib.h"
 
 #undef pr_fmt
-#define pr_fmt(fmt)		GPIO_MOCKUP_NAME ": " fmt
+#define pr_fmt(fmt)		KBUILD_MODNAME ": " fmt
 
-#define GPIO_MOCKUP_NAME	"gpio-mockup"
 #define GPIO_MOCKUP_MAX_GC	10
 /*
  * We're storing two values per chip: the GPIO base and the number
@@ -501,7 +500,7 @@  static int gpio_mockup_probe(struct platform_device *pdev)
 
 static struct platform_driver gpio_mockup_driver = {
 	.driver = {
-		.name = GPIO_MOCKUP_NAME,
+		.name = "gpio-mockup",
 	},
 	.probe = gpio_mockup_probe,
 };
@@ -572,7 +571,7 @@  static int __init gpio_mockup_init(void)
 			properties[prop++] = PROPERTY_ENTRY_BOOL(
 						"named-gpio-lines");
 
-		pdevinfo.name = GPIO_MOCKUP_NAME;
+		pdevinfo.name = "gpio-mockup";
 		pdevinfo.id = i;
 		pdevinfo.properties = properties;