public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Warren <swarren@wwwdotorg.org>
To: Dong Aisheng <b29396@freescale.com>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linus.walleij@stericsson.com
Subject: Re: [PATCH 1/1] pinctrl: add some error checking for user interfaces
Date: Mon, 09 Apr 2012 09:03:06 -0600	[thread overview]
Message-ID: <4F82FA2A.3090604@wwwdotorg.org> (raw)
In-Reply-To: <1333967409-8168-1-git-send-email-b29396@freescale.com>

On 04/09/2012 04:30 AM, Dong Aisheng wrote:
> From: Dong Aisheng <dong.aisheng@linaro.org>
> 
> This patch can avoid kernel oops in case the mux or config
> function is not supported by driver.
> 
> Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
> ---
>  drivers/pinctrl/pinconf.c |    4 ++++
>  drivers/pinctrl/pinmux.c  |   15 +++++++++++++--
>  2 files changed, 17 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pinctrl/pinconf.c b/drivers/pinctrl/pinconf.c
> index eb3a14f..384dcc1 100644
> --- a/drivers/pinctrl/pinconf.c
> +++ b/drivers/pinctrl/pinconf.c
> @@ -448,8 +448,12 @@ static void pinconf_dump_pin(struct pinctrl_dev *pctldev,
>  static int pinconf_pins_show(struct seq_file *s, void *what)
>  {
>  	struct pinctrl_dev *pctldev = s->private;
> +	const struct pinconf_ops *ops = pctldev->desc->confops;
>  	unsigned i, pin;
>  
> +	if (!ops || !ops->pin_config_get)
> +		return 0;

I don't think this is necessary; it looks like this function (and those
it calls) always checks ops where they're used.

> diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c
> index 8849830..ade661d 100644
> --- a/drivers/pinctrl/pinmux.c
> +++ b/drivers/pinctrl/pinmux.c
> @@ -323,6 +323,11 @@ int pinmux_map_to_setting(struct pinctrl_map const *map,
>  	const unsigned *pins;
>  	unsigned num_pins;
>  
> +	if (!pmxops) {
> +		dev_err(pctldev->dev, "dose not support mux functron\n");

s/dose/does/
s/functron/function/


  reply	other threads:[~2012-04-09 15:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-09 10:30 [PATCH 1/1] pinctrl: add some error checking for user interfaces Dong Aisheng
2012-04-09 15:03 ` Stephen Warren [this message]
2012-04-10  3:49   ` Dong Aisheng
2012-04-10  3:44     ` Stephen Warren

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=4F82FA2A.3090604@wwwdotorg.org \
    --to=swarren@wwwdotorg.org \
    --cc=b29396@freescale.com \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox