瀏覽代碼

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 <vladimir_zapolskiy@mentor.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Vladimir Zapolskiy 10 年之前
父節點
當前提交
4914f1c717
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      drivers/misc/sram.c

+ 2 - 1
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;