diff mbox series

[2/2] pinctrl: stmfx: Use PINNAME_SIZE for pin's name size

Message ID 20210120124340.23612-2-patrice.chotard@foss.st.com
State Accepted
Commit ca5cc312d4bea03a106dd36026ae637b19fa5599
Delegated to: Patrick Delaunay
Headers show
Series None | expand

Commit Message

Patrice Chotard Jan. 20, 2021, 12:43 p.m. UTC
Instead of redefining a pin's name size, use PINNAME_SIZE defined
in include/dm/pinctrl.h

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
---

 drivers/pinctrl/pinctrl-stmfx.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Patrick Delaunay Jan. 27, 2021, 2:06 p.m. UTC | #1
Hi Patrice,

On 1/20/21 1:43 PM, Patrice Chotard wrote:
> Instead of redefining a pin's name size, use PINNAME_SIZE defined
> in include/dm/pinctrl.h
>
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
> ---
>
>   drivers/pinctrl/pinctrl-stmfx.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
>
>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>

Thanks

Patrick
Patrick Delaunay Feb. 9, 2021, 9:27 a.m. UTC | #2
Hi,


On 1/20/21 1:43 PM, Patrice Chotard wrote:
> Instead of redefining a pin's name size, use PINNAME_SIZE defined
> in include/dm/pinctrl.h
>
> Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
> ---
>
>   drivers/pinctrl/pinctrl-stmfx.c | 7 +++----
>   1 file changed, 3 insertions(+), 4 deletions(-)
>

Applied to u-boot-stm/master, thanks!


Regards

Patrick
diff mbox series

Patch

diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
index b789f3686c..fbbd479575 100644
--- a/drivers/pinctrl/pinctrl-stmfx.c
+++ b/drivers/pinctrl/pinctrl-stmfx.c
@@ -346,15 +346,14 @@  static int stmfx_pinctrl_get_pins_count(struct udevice *dev)
  * STMFX pins[15:0] are called "gpio[15:0]"
  * and STMFX pins[23:16] are called "agpio[7:0]"
  */
-#define MAX_PIN_NAME_LEN 7
-static char pin_name[MAX_PIN_NAME_LEN];
+static char pin_name[PINNAME_SIZE];
 static const char *stmfx_pinctrl_get_pin_name(struct udevice *dev,
 					      unsigned int selector)
 {
 	if (selector < STMFX_MAX_GPIO)
-		snprintf(pin_name, MAX_PIN_NAME_LEN, "gpio%u", selector);
+		snprintf(pin_name, PINNAME_SIZE, "gpio%u", selector);
 	else
-		snprintf(pin_name, MAX_PIN_NAME_LEN, "agpio%u", selector - 16);
+		snprintf(pin_name, PINNAME_SIZE, "agpio%u", selector - 16);
 	return pin_name;
 }