diff mbox series

pinctrl: single: set function name when adding function

Message ID 20210125201703.48575-1-drew@beagleboard.org
State Accepted
Commit 4739b1b168abce498e8ebe7b157a527f3ec44352
Headers show
Series pinctrl: single: set function name when adding function | expand

Commit Message

Drew Fustini Jan. 25, 2021, 8:17 p.m. UTC
pcs_add_function() fails to set the function name in struct pcs_function
when adding a new function.  As a result this line in pcs_set_mux():

        dev_dbg(pcs->dev, "enabling %s function%i\n",
                func->name, fselector);

prints "(null)" for the function:

pinctrl-single 44e10800.pinmux: enabling (null) function0
pinctrl-single 44e10800.pinmux: enabling (null) function1
pinctrl-single 44e10800.pinmux: enabling (null) function2
pinctrl-single 44e10800.pinmux: enabling (null) function3

With this fix, the output is now:

pinctrl-single 44e10800.pinmux: enabling pinmux-uart0-pins function0
pinctrl-single 44e10800.pinmux: enabling pinmux-mmc0-pins function1
pinctrl-single 44e10800.pinmux: enabling pinmux-i2c0-pins function2
pinctrl-single 44e10800.pinmux: enabling pinmux-mmc0-pins function3

Cc: Jason Kridner <jkridner@beagleboard.org>
Cc: Robert Nelson <robertcnelson@beagleboard.org>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Tony Lindgren <tony@atomide.com>
Signed-off-by: Drew Fustini <drew@beagleboard.org>
---
 drivers/pinctrl/pinctrl-single.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index 0271a13a535d..e7f3ddbbd515 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -790,6 +790,7 @@  static int pcs_add_function(struct pcs_device *pcs,
 
 	function->vals = vals;
 	function->nvals = nvals;
+	function->name = name;
 
 	pr_warn("DEBUG pcs_add_function(): name=%s nvals=%d pgnames[0]=%s npgnames=%d vals[0].val=0x%x vals[0].mask=0x%x vals[0].offset=0x%x", 
 		                   	   name,   nvals,   pgnames[0],   npgnames,   vals[0].val,     vals[0].mask,     vals[0].offset);