public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Adrian Hunter <ext-adrian.hunter@nokia.com>
Cc: drzeus-mmc@drzeus.cx, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] MMC: Add Extended CSD as a device attribute
Date: Thu, 15 Jan 2009 16:05:27 -0800	[thread overview]
Message-ID: <20090115160527.4cdbe94b.akpm@linux-foundation.org> (raw)
In-Reply-To: <496E1187.60305@nokia.com>

On Wed, 14 Jan 2009 18:23:35 +0200
Adrian Hunter <ext-adrian.hunter@nokia.com> wrote:
>
> Subject: [PATCH] MMC: Add Extended CSD as a device attribute

Why?  There must be some *reason* for making this change.  Presumably
that reason is obvious to yourself and Pierre, but what about the rest
of us?

> 
> Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>

It would take only 30 seconds to write a changelog for this patch :(

>  drivers/mmc/core/mmc.c |   29 +++++++++++++++++++++++++++++
>  1 files changed, 29 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index 3f5b089..29291de 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -259,6 +259,34 @@ MMC_DEV_ATTR(name, "%s\n", card->cid.prod_name);
>  MMC_DEV_ATTR(oemid, "0x%04x\n", card->cid.oemid);
>  MMC_DEV_ATTR(serial, "0x%08x\n", card->cid.serial);
>  
> +static ssize_t mmc_ext_csd_show(struct device *dev, struct device_attribute *attr, char *buf)
> +{
> +	struct mmc_card *card = container_of(dev, struct mmc_card, dev);
> +	ssize_t n = 0;
> +	u8 *ext_csd;
> +	int err, i;
> +
> +	ext_csd = kmalloc(512, GFP_KERNEL);
> +	if (!ext_csd)
> +		return 0;
> +
> +	mmc_claim_host(card->host);
> +	err = mmc_send_ext_csd(card, ext_csd);
> +	mmc_release_host(card->host);
> +
> +	if (!err) {
> +		for (i = 511; i >= 0; i--)
> +			n += sprintf(buf + n, "%02x", (unsigned)ext_csd[i]);

The cast isn't actually needed.

> +		n += sprintf(buf + n, "\n");
> +	}
> +
> +	kfree(ext_csd);
> +
> +	return n;
> +}
> +
> +static DEVICE_ATTR(ext_csd, S_IRUGO, mmc_ext_csd_show, NULL);
> +
>  static struct attribute *mmc_std_attrs[] = {
>  	&dev_attr_cid.attr,
>  	&dev_attr_csd.attr,
> @@ -269,6 +297,7 @@ static struct attribute *mmc_std_attrs[] = {
>  	&dev_attr_name.attr,
>  	&dev_attr_oemid.attr,
>  	&dev_attr_serial.attr,
> +	&dev_attr_ext_csd.attr,
>  	NULL,
>  };


  reply	other threads:[~2009-01-16  0:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-14 16:23 [PATCH] MMC: Add Extended CSD as a device attribute Adrian Hunter
2009-01-16  0:05 ` Andrew Morton [this message]
2009-01-16 10:41   ` Adrian Hunter
2009-01-24 20:45     ` Pierre Ossman
2009-01-26  9:16       ` Adrian Hunter
2009-02-02 19:26         ` 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=20090115160527.4cdbe94b.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=drzeus-mmc@drzeus.cx \
    --cc=ext-adrian.hunter@nokia.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