linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dong Aisheng <aisheng.dong@freescale.com>
To: Stephen Warren <swarren@nvidia.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
	Linus Walleij <linus.walleij@stericsson.com>,
	<B29396@freescale.com>, <s.hauer@pengutronix.de>,
	<dongas86@gmail.com>, <shawn.guo@linaro.org>,
	<thomas.abraham@linaro.org>, <tony@atomide.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3] pinctrl: Move pinctrl-maps debugfs file to top-level
Date: Fri, 24 Feb 2012 11:47:26 +0800	[thread overview]
Message-ID: <20120224034725.GC25789@shlinux2.ap.freescale.net> (raw)
In-Reply-To: <1330041880-12406-3-git-send-email-swarren@nvidia.com>

On Thu, Feb 23, 2012 at 05:04:40PM -0700, Stephen Warren wrote:
> The debugfs file pinctrl-maps is a system-wide file, not specific to any
> pin controller, so place it in the top-level directory.
> 
Reasonable to me.

> Also, move the code implementing the file to keep the order of all the
> functions matching the order they're created in pinctrl_init_*debugfs().
> The only non-obvious change here is no private data is passed to
> debugfs_create_file() or single_open().
Looks correct.

Acked-by: Dong Aisheng <dong.aisheng@linaro.org>

Regards
Dong Aisheng
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
>  drivers/pinctrl/core.c |   70 ++++++++++++++++++++++++------------------------
>  1 files changed, 35 insertions(+), 35 deletions(-)
> 
> diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c
> index 633b97e..376cede 100644
> --- a/drivers/pinctrl/core.c
> +++ b/drivers/pinctrl/core.c
> @@ -889,28 +889,6 @@ static int pinctrl_gpioranges_show(struct seq_file *s, void *what)
>  	return 0;
>  }
>  
> -static int pinctrl_maps_show(struct seq_file *s, void *what)
> -{
> -	struct pinctrl_maps *maps_node;
> -	int i;
> -	struct pinctrl_map const *map;
> -
> -	seq_puts(s, "Pinctrl maps:\n");
> -
> -	mutex_lock(&pinctrl_maps_mutex);
> -	for_each_maps(maps_node, i, map) {
> -		seq_printf(s, "%s:\n", map->name);
> -		seq_printf(s, "  device: %s\n", map->dev_name);
> -		seq_printf(s, "  controlling device %s\n", map->ctrl_dev_name);
> -		seq_printf(s, "  function: %s\n", map->function);
> -		seq_printf(s, "  group: %s\n", map->group ? map->group :
> -			   "(default)");
> -	}
> -	mutex_unlock(&pinctrl_maps_mutex);
> -
> -	return 0;
> -}
> -
>  static int pinmux_hogs_show(struct seq_file *s, void *what)
>  {
>  	struct pinctrl_dev *pctldev = s->private;
> @@ -947,6 +925,28 @@ static int pinctrl_devices_show(struct seq_file *s, void *what)
>  	return 0;
>  }
>  
> +static int pinctrl_maps_show(struct seq_file *s, void *what)
> +{
> +	struct pinctrl_maps *maps_node;
> +	int i;
> +	struct pinctrl_map const *map;
> +
> +	seq_puts(s, "Pinctrl maps:\n");
> +
> +	mutex_lock(&pinctrl_maps_mutex);
> +	for_each_maps(maps_node, i, map) {
> +		seq_printf(s, "%s:\n", map->name);
> +		seq_printf(s, "  device: %s\n", map->dev_name);
> +		seq_printf(s, "  controlling device %s\n", map->ctrl_dev_name);
> +		seq_printf(s, "  function: %s\n", map->function);
> +		seq_printf(s, "  group: %s\n", map->group ? map->group :
> +			   "(default)");
> +	}
> +	mutex_unlock(&pinctrl_maps_mutex);
> +
> +	return 0;
> +}
> +
>  static int pinctrl_show(struct seq_file *s, void *what)
>  {
>  	struct pinctrl *p;
> @@ -988,11 +988,6 @@ static int pinctrl_gpioranges_open(struct inode *inode, struct file *file)
>  	return single_open(file, pinctrl_gpioranges_show, inode->i_private);
>  }
>  
> -static int pinctrl_maps_open(struct inode *inode, struct file *file)
> -{
> -	return single_open(file, pinctrl_maps_show, inode->i_private);
> -}
> -
>  static int pinmux_hogs_open(struct inode *inode, struct file *file)
>  {
>  	return single_open(file, pinmux_hogs_show, inode->i_private);
> @@ -1003,6 +998,11 @@ static int pinctrl_devices_open(struct inode *inode, struct file *file)
>  	return single_open(file, pinctrl_devices_show, NULL);
>  }
>  
> +static int pinctrl_maps_open(struct inode *inode, struct file *file)
> +{
> +	return single_open(file, pinctrl_maps_show, NULL);
> +}
> +
>  static int pinctrl_open(struct inode *inode, struct file *file)
>  {
>  	return single_open(file, pinctrl_show, NULL);
> @@ -1029,22 +1029,22 @@ static const struct file_operations pinctrl_gpioranges_ops = {
>  	.release	= single_release,
>  };
>  
> -static const struct file_operations pinctrl_maps_ops = {
> -	.open		= pinctrl_maps_open,
> +static const struct file_operations pinmux_hogs_ops = {
> +	.open		= pinmux_hogs_open,
>  	.read		= seq_read,
>  	.llseek		= seq_lseek,
>  	.release	= single_release,
>  };
>  
> -static const struct file_operations pinmux_hogs_ops = {
> -	.open		= pinmux_hogs_open,
> +static const struct file_operations pinctrl_devices_ops = {
> +	.open		= pinctrl_devices_open,
>  	.read		= seq_read,
>  	.llseek		= seq_lseek,
>  	.release	= single_release,
>  };
>  
> -static const struct file_operations pinctrl_devices_ops = {
> -	.open		= pinctrl_devices_open,
> +static const struct file_operations pinctrl_maps_ops = {
> +	.open		= pinctrl_maps_open,
>  	.read		= seq_read,
>  	.llseek		= seq_lseek,
>  	.release	= single_release,
> @@ -1078,8 +1078,6 @@ static void pinctrl_init_device_debugfs(struct pinctrl_dev *pctldev)
>  			    device_root, pctldev, &pinctrl_groups_ops);
>  	debugfs_create_file("gpio-ranges", S_IFREG | S_IRUGO,
>  			    device_root, pctldev, &pinctrl_gpioranges_ops);
> -	debugfs_create_file("pinctrl-maps", S_IFREG | S_IRUGO,
> -			    device_root, pctldev, &pinctrl_maps_ops);
>  	debugfs_create_file("pinmux-hogs", S_IFREG | S_IRUGO,
>  			    device_root, pctldev, &pinmux_hogs_ops);
>  	pinmux_init_device_debugfs(device_root, pctldev);
> @@ -1102,6 +1100,8 @@ static void pinctrl_init_debugfs(void)
>  
>  	debugfs_create_file("pinctrl-devices", S_IFREG | S_IRUGO,
>  			    debugfs_root, NULL, &pinctrl_devices_ops);
> +	debugfs_create_file("pinctrl-maps", S_IFREG | S_IRUGO,
> +			    debugfs_root, NULL, &pinctrl_maps_ops);
>  	debugfs_create_file("pinctrl-handles", S_IFREG | S_IRUGO,
>  			    debugfs_root, NULL, &pinctrl_ops);
>  }
> -- 
> 1.7.0.4
> 
> 


  reply	other threads:[~2012-02-24  3:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-24  0:04 [PATCH 1/3] pinctrl: Introduce PINCTRL_STATE_DEFAULT define, and use it Stephen Warren
2012-02-24  0:04 ` [PATCH 2/3] pinctrl: Re-order struct pinctrl_map Stephen Warren
2012-02-24  3:31   ` Dong Aisheng
2012-02-24  6:14   ` Linus Walleij
2012-02-24  0:04 ` [PATCH 3/3] pinctrl: Move pinctrl-maps debugfs file to top-level Stephen Warren
2012-02-24  3:47   ` Dong Aisheng [this message]
2012-02-24  6:18   ` Linus Walleij
2012-02-24  3:24 ` [PATCH 1/3] pinctrl: Introduce PINCTRL_STATE_DEFAULT define, and use it Dong Aisheng
2012-02-24  5:26   ` Stephen Warren
2012-02-24  7:09     ` Dong Aisheng
2012-02-24 17:32       ` Stephen Warren
2012-02-25  4:16         ` Dong Aisheng
2012-02-24  6:09 ` Linus Walleij
2012-02-24 17:09   ` Stephen Warren
2012-02-24 19:20     ` 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=20120224034725.GC25789@shlinux2.ap.freescale.net \
    --to=aisheng.dong@freescale.com \
    --cc=B29396@freescale.com \
    --cc=dongas86@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawn.guo@linaro.org \
    --cc=swarren@nvidia.com \
    --cc=thomas.abraham@linaro.org \
    --cc=tony@atomide.com \
    /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;
as well as URLs for NNTP newsgroup(s).