lkml.org 
[lkml]   [2008]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] mmc_block: use generic helper to print capacities
    From: Pierre Ossman <drzeus@drzeus.cx>

    Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>

    ---

    diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
    index 62a4c91..dad8edb 100644
    --- a/drivers/mmc/card/block.c
    +++ b/drivers/mmc/card/block.c
    @@ -29,6 +29,7 @@
    #include <linux/blkdev.h>
    #include <linux/mutex.h>
    #include <linux/scatterlist.h>
    +#include <linux/string_helpers.h>

    #include <linux/mmc/card.h>
    #include <linux/mmc/host.h>
    @@ -496,6 +497,8 @@ static int mmc_blk_probe(struct mmc_card *card)
    struct mmc_blk_data *md;
    int err;

    + char cap_str[10];
    +
    /*
    * Check that the card supports the command class(es) we need.
    */
    @@ -510,10 +513,11 @@ static int mmc_blk_probe(struct mmc_card *card)
    if (err)
    goto out;

    - printk(KERN_INFO "%s: %s %s %lluKiB %s\n",
    + string_get_size(get_capacity(md->disk) << 9, STRING_UNITS_2,
    + cap_str, sizeof(cap_str));
    + printk(KERN_INFO "%s: %s %s %s %s\n",
    md->disk->disk_name, mmc_card_id(card), mmc_card_name(card),
    - (unsigned long long)(get_capacity(md->disk) >> 1),
    - md->read_only ? "(ro)" : "");
    + cap_str, md->read_only ? "(ro)" : "");

    mmc_set_drvdata(card, md);
    add_disk(md->disk);

    --
    -- 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.
    [unhandled content-type:application/pgp-signature]
    \
     
     \ /
      Last update: 2008-08-31 20:57    [W:0.023 / U:30.684 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site