aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPatrice Chotard2021-01-20 13:43:40 +0100
committerPatrick Delaunay2021-02-09 10:26:01 +0100
commitca5cc312d4bea03a106dd36026ae637b19fa5599 (patch)
tree6a88c879483327496c32aa07589b8c7557e199d2 /drivers
parent54f5bf3d61084c15a9e364ac7a5fdede7c1c780e (diff)
pinctrl: stmfx: Use PINNAME_SIZE for pin's name size
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> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pinctrl/pinctrl-stmfx.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
index b4baf357dd5..1a8d0a3a35e 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;
}