mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: Re: [PATCH 15/15] mci: Be more verbose on what device is associated to which disk
Date: Thu, 9 Feb 2012 14:32:44 +0100	[thread overview]
Message-ID: <20120209133244.GY3852@pengutronix.de> (raw)
In-Reply-To: <1328788438-19717-16-git-send-email-s.hauer@pengutronix.de>

On Thu, Feb 09, 2012 at 12:53:58PM +0100, Sascha Hauer wrote:
> This is quite useful when multiple SD cards are present so spare
> some bytes to print this information.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  drivers/mci/mci-core.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
> index c39faf3..17a6656 100644
> --- a/drivers/mci/mci-core.c
> +++ b/drivers/mci/mci-core.c
> @@ -1300,6 +1300,8 @@ static int mci_card_probe(struct mci *mci)
>  		goto on_error;
>  	}
>  
> +	dev_info(mci->mci_dev, "registered disk%d\n", rc);


This doesn't work. With this we will print the return value of
blockdevice_register().

Here is an updated patch.

Sascha

8<------------------------------------

mci: Be more verbose on what device is associated to which  disk

This is quite useful when multiple SD cards are present so spare
some bytes to print this information.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/mci/mci-core.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/mci/mci-core.c b/drivers/mci/mci-core.c
index c39faf3..c6e8669 100644
--- a/drivers/mci/mci-core.c
+++ b/drivers/mci/mci-core.c
@@ -1241,7 +1241,7 @@ static struct block_device_ops mci_ops = {
 static int mci_card_probe(struct mci *mci)
 {
 	struct mci_host *host = mci->host;
-	int rc;
+	int rc, disknum;
 
 	/* start with a host interface reset */
 	rc = (host->init)(host, mci->mci_dev);
@@ -1288,9 +1288,9 @@ static int mci_card_probe(struct mci *mci)
 	mci->blk.dev = mci->mci_dev;
 	mci->blk.ops = &mci_ops;
 
-	rc = cdev_find_free_index("disk");
+	disknum = cdev_find_free_index("disk");
 
-	mci->blk.cdev.name = asprintf("disk%d", rc);
+	mci->blk.cdev.name = asprintf("disk%d", disknum);
 	mci->blk.blockbits = SECTOR_SHIFT;
 	mci->blk.num_blocks = mci_calc_blk_cnt(mci->capacity, mci->blk.blockbits);
 
@@ -1300,6 +1300,8 @@ static int mci_card_probe(struct mci *mci)
 		goto on_error;
 	}
 
+	dev_info(mci->mci_dev, "registered disk%d\n", disknum);
+
 	/* create partitions on demand */
 	rc = parse_partition_table(&mci->blk);
 	if (rc != 0) {
@@ -1382,6 +1384,8 @@ static int mci_probe(struct device_d *mci_dev)
 	mci->mci_dev = mci_dev;
 	mci->host = mci_dev->platform_data;
 
+	dev_info(mci->host->hw_dev, "registered as %s\n", dev_name(mci_dev));
+
 #ifdef CONFIG_MCI_STARTUP
 	/* if enabled, probe the attached card immediately */
 	rc = mci_card_probe(mci);
-- 
1.7.9

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2012-02-09 13:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-09 11:53 [PATCH] mmc/sd patches Sascha Hauer
2012-02-09 11:53 ` [PATCH 01/15] mci: Add complete definitions for the card type Sascha Hauer
2012-02-09 11:53 ` [PATCH 02/15] mci: use card type definitions Sascha Hauer
2012-02-09 11:53 ` [PATCH 03/15] mci: fix high capacity detection Sascha Hauer
2012-02-09 11:53 ` [PATCH 04/15] mci mxs: do not use external define for internal use Sascha Hauer
2012-02-09 11:53 ` [PATCH 05/15] mci core: replace discrete ios values with struct ios Sascha Hauer
2012-02-09 11:53 ` [PATCH 06/15] mci s3c: Do not mess with struct mci_host Sascha Hauer
2012-02-09 11:53 ` [PATCH 07/15] mci s3c: allocate host struct dynamically Sascha Hauer
2012-02-09 11:53 ` [PATCH 08/15] mci s3c: pass around the right pointer Sascha Hauer
2012-02-09 11:53 ` [PATCH 09/15] mci: remove unused device argument from set_ios Sascha Hauer
2012-02-09 11:53 ` [PATCH 10/15] mci core: fix mixup of max write/read block len Sascha Hauer
2012-02-09 11:53 ` [PATCH 11/15] mci: Use struct mci for internal argument passing Sascha Hauer
2012-02-09 11:53 ` [PATCH 12/15] mci: replace pr_debug with dev_dbg Sascha Hauer
2012-02-09 11:53 ` [PATCH 13/15] mci: factor out mci/sd specific startup functions Sascha Hauer
2012-02-09 11:53 ` [PATCH 14/15] mci: cdev_find_free_index won't fail, no need to check Sascha Hauer
2012-02-09 11:53 ` [PATCH 15/15] mci: Be more verbose on what device is associated to which disk Sascha Hauer
2012-02-09 13:32   ` Sascha Hauer [this message]

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=20120209133244.GY3852@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.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