Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752501AbbEFLmS (ORCPT ); Wed, 6 May 2015 07:42:18 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:62403 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751814AbbEFLkY (ORCPT ); Wed, 6 May 2015 07:40:24 -0400 From: Vladimir Zapolskiy To: Arnd Bergmann , Greg Kroah-Hartman , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Philipp Zabel CC: Subject: [PATCH v2 5/9] misc: sram: report correct SRAM pool size Date: Wed, 6 May 2015 14:40:04 +0300 Message-ID: <1430912408-1239-7-git-send-email-vladimir_zapolskiy@mentor.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1430912408-1239-1-git-send-email-vladimir_zapolskiy@mentor.com> References: <1430912408-1239-1-git-send-email-vladimir_zapolskiy@mentor.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [137.202.0.76] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1067 Lines: 35 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 --- Changes since v1: - rebased on top of v2 3/9 misc: sram: use phys_addr_t instead of u32 for physical address --- drivers/misc/sram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/sram.c b/drivers/misc/sram.c index 201cc28..75e6245 100644 --- a/drivers/misc/sram.c +++ b/drivers/misc/sram.c @@ -197,7 +197,7 @@ static int sram_probe(struct platform_device *pdev) platform_set_drvdata(pdev, sram); dev_dbg(&pdev->dev, "SRAM pool: %zu KiB @ 0x%p\n", - size / 1024, virt_base); + gen_pool_size(sram->pool) / 1024, virt_base); return 0; -- 1.7.10.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/