]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
misc: sram: report correct SRAM pool size
authorVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Mon, 1 Jun 2015 12:29:57 +0000 (15:29 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Jun 2015 00:03:56 +0000 (17:03 -0700)
Since some space in SRAM may be reserved, report the left free space
in the allocated memory pool instead of total physical size of the
SRAM device.

Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/sram.c

index baada4761b35c93a08f25e89e16edf72f42f461d..dd66d5f72ee9383f040dbc2886d6ddd56a5bd5bc 100644 (file)
@@ -190,7 +190,8 @@ static int sram_probe(struct platform_device *pdev)
 
        platform_set_drvdata(pdev, sram);
 
-       dev_dbg(&pdev->dev, "SRAM pool: %ld KiB @ 0x%p\n", size / 1024, virt_base);
+       dev_dbg(&pdev->dev, "SRAM pool: %zu KiB @ 0x%p\n",
+               gen_pool_size(sram->pool) / 1024, virt_base);
 
        return 0;