mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pierre Ossman <drzeus-mmc@drzeus.cx>
To: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Cc: linux-kernel@vger.kernel.org, Haavard Skinnemoen <hskinnemoen@atmel.com>
Subject: Re: [PATCH 2/3] mmc: Export ios settings for a host through debugfs
Date: Sat, 28 Jun 2008 15:34:03 +0200	[thread overview]
Message-ID: <20080628153403.0870e96c@mjolnir.drzeus.cx> (raw)
In-Reply-To: <1214478589-21291-2-git-send-email-haavard.skinnemoen@atmel.com>

On Thu, 26 Jun 2008 13:09:48 +0200
Haavard Skinnemoen <haavard.skinnemoen@atmel.com> wrote:

> From: Haavard Skinnemoen <hskinnemoen@atmel.com>
> 
> Export all the fields in struct mmc_ios under /sys/kernel/debug/<host>/ios
> 
> Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
> ---
>  drivers/mmc/core/host.c  |   55 ++++++++++++++++++++++++++++++++++++++++++++++
>  include/linux/mmc/host.h |   13 +++++++++++
>  2 files changed, 68 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
> index 93da502..2977f26 100644
> --- a/drivers/mmc/core/host.c
> +++ b/drivers/mmc/core/host.c
> @@ -25,6 +25,54 @@
>  #ifdef CONFIG_MMC_DEBUG_FS
>  #include <linux/debugfs.h>
>  
> +static void mmc_remove_ios_debugfs(struct mmc_ios *ios)
> +{
> +	if (ios->dbg_root) {

You can save a bit of indentation if you do:

	if (!ios->dbg_root)
		return;

> +static int mmc_add_ios_debugfs(struct mmc_ios *ios, struct dentry *parent)
> +{
> +	struct dentry *dir;
> +
> +	dir = debugfs_create_dir("ios", parent);
> +	if (!dir)
> +		return -EBUSY;	/* or whatever */

Is it undefined what a NULL return means here? I would have expected an
ERRPTR or ENOMEM.

> +#ifdef CONFIG_MMC_DEBUG_FS
> +	struct dentry		*dbg_root;
> +	struct dentry		*dbg_clock;
> +	struct dentry		*dbg_vdd;
> +	struct dentry		*dbg_bus_mode;
> +	struct dentry		*dbg_chip_select;
> +	struct dentry		*dbg_power_mode;
> +	struct dentry		*dbg_bus_width;
> +	struct dentry		*dbg_timing;
> +#endif

Can't we use debugfs' own bookkeeping to keep track of them? Saves us a
lot of noise in these structures.

-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  rdesktop, core developer          http://www.rdesktop.org

  WARNING: This correspondence is being monitored by the
  Swedish government. Make sure your server uses encryption
  for SMTP traffic and consider using PGP for end-to-end
  encryption.

  parent reply	other threads:[~2008-06-28 13:34 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-26 11:09 [PATCH 1/3] mmc: Export internal host state " Haavard Skinnemoen
2008-06-26 11:09 ` [PATCH 2/3] mmc: Export ios settings for a host " Haavard Skinnemoen
2008-06-26 11:09   ` [PATCH 3/3] mmc: Add per-card debugfs support Haavard Skinnemoen
2008-06-28 13:37     ` Pierre Ossman
2008-06-28 13:48       ` Haavard Skinnemoen
2008-06-28 14:01         ` Pierre Ossman
2008-06-28 14:15           ` Haavard Skinnemoen
2008-06-28 15:22             ` Pierre Ossman
2008-06-28 15:36               ` Haavard Skinnemoen
2008-06-28 16:11                 ` Pierre Ossman
2008-06-28 13:34   ` Pierre Ossman [this message]
2008-06-28 13:47     ` [PATCH 2/3] mmc: Export ios settings for a host through debugfs Haavard Skinnemoen
2008-06-28 13:59       ` Pierre Ossman
2008-06-28 14:07         ` Haavard Skinnemoen
2008-06-28 15:33           ` Greg KH
2008-06-28 16:08             ` Haavard Skinnemoen
2008-06-28 16:37               ` Haavard Skinnemoen
2008-06-28 16:43                 ` Greg KH
2008-06-28 17:02                   ` Haavard Skinnemoen
2008-06-28 13:28 ` [PATCH 1/3] mmc: Export internal host state " Pierre Ossman
2008-06-28 13:37   ` Haavard Skinnemoen
2008-06-28 13:40     ` Pierre Ossman
2008-06-28 13:49       ` Haavard Skinnemoen
2008-06-28 14:23       ` Haavard Skinnemoen
2008-06-28 14:41         ` Haavard Skinnemoen
2008-06-28 15:17           ` Pierre Ossman

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=20080628153403.0870e96c@mjolnir.drzeus.cx \
    --to=drzeus-mmc@drzeus.cx \
    --cc=haavard.skinnemoen@atmel.com \
    --cc=hskinnemoen@atmel.com \
    --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

Powered by JetHome