From: Vladimir Zapolskiy Date: Mon, 1 Jun 2015 12:29:57 +0000 (+0300) Subject: misc: sram: report correct SRAM pool size X-Git-Tag: firefly_0821_release~176^2~1547^2~6 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4914f1c7179f056b69b0e2bddc3f5daadb70609d;p=firefly-linux-kernel-4.4.55.git misc: sram: report correct SRAM pool size 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c index baada4761b35..dd66d5f72ee9 100644 --- a/drivers/misc/sram.c +++ b/drivers/misc/sram.c @@ -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;