From: Tony Lindgren <tony@atomide.com> To: Dario Binacchi <dariobin@libero.it> Cc: linux-kernel@vger.kernel.org, Haojian Zhuang <haojian.zhuang@linaro.org>, Linus Walleij <linus.walleij@linaro.org>, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-omap@vger.kernel.org Subject: Re: [PATCH v2 2/2] pinctrl: single: set pinmux from pins debug file Date: Tue, 18 May 2021 09:05:23 +0300 [thread overview] Message-ID: <YKNZIzyO5Q/XGLRs@atomide.com> (raw) In-Reply-To: <20210517200002.6316-3-dariobin@libero.it> Hi, I noticed few more things I started to wonder about after looking at this again. * Dario Binacchi <dariobin@libero.it> [210517 20:00]: > +static int pcs_pin_dbg_set(struct pinctrl_dev *pctldev, unsigned int pin, > + char *buf) > +{ > + struct pcs_device *pcs; > + unsigned int val, mux_bytes; > + > + buf = skip_spaces(buf); > + if (kstrtouint(buf, 0, &val)) > + return -EINVAL; > + > + pcs = pinctrl_dev_get_drvdata(pctldev); > + > + mux_bytes = pcs->width / BITS_PER_BYTE; > + pcs->write(val, pcs->base + pin * mux_bytes); > + return 0; > +} Since you're adding a new interface, how about pass unsigned int val instead of char *buf? > static void pcs_dt_free_map(struct pinctrl_dev *pctldev, > struct pinctrl_map *map, unsigned num_maps) > { > @@ -331,6 +348,9 @@ static const struct pinctrl_ops pcs_pinctrl_ops = { > .get_group_name = pinctrl_generic_get_group_name, > .get_group_pins = pinctrl_generic_get_group_pins, > .pin_dbg_show = pcs_pin_dbg_show, > +#if IS_ENABLED(CONFIG_DEVMEM) > + .pin_dbg_set = pcs_pin_dbg_set, > +#endif > .dt_node_to_map = pcs_dt_node_to_map, > .dt_free_map = pcs_dt_free_map, > }; It might be better to always have the .pin_dbg_set around to avoid the IS_ENABLED(CONFIG_DEVMEM). Does the new interface need something under Documentation too? Regards, Tony _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2021-05-18 6:07 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-05-17 20:00 [PATCH v2 0/2] am335x: set pinmux registers " Dario Binacchi 2021-05-17 20:00 ` [PATCH v2 2/2] pinctrl: single: set pinmux " Dario Binacchi 2021-05-18 6:05 ` Tony Lindgren [this message] 2021-05-18 8:57 ` Dario Binacchi 2021-05-21 9:25 ` Tony Lindgren 2021-05-19 11:31 ` [PATCH v2 0/2] am335x: set pinmux registers " Andy Shevchenko
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=YKNZIzyO5Q/XGLRs@atomide.com \ --to=tony@atomide.com \ --cc=dariobin@libero.it \ --cc=haojian.zhuang@linaro.org \ --cc=linus.walleij@linaro.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-gpio@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-omap@vger.kernel.org \ --subject='Re: [PATCH v2 2/2] pinctrl: single: set pinmux from pins debug file' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).