Skip to content

Commit

Permalink
misc: sram: report correct SRAM pool size
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Vladimir Zapolskiy authored and Greg Kroah-Hartman committed Jun 13, 2015
1 parent d687b1f commit 4914f1c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/misc/sram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 4914f1c

Please sign in to comment.