From patchwork Tue Aug 11 11:03:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 6991571 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 62CE59F358 for ; Tue, 11 Aug 2015 11:05:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 99918205BE for ; Tue, 11 Aug 2015 11:05:57 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 88C8220430 for ; Tue, 11 Aug 2015 11:05:56 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZP7Lj-0002Xf-Ue; Tue, 11 Aug 2015 11:04:07 +0000 Received: from mail-wi0-f171.google.com ([209.85.212.171]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZP7Lf-0002OU-0C for linux-arm-kernel@lists.infradead.org; Tue, 11 Aug 2015 11:04:03 +0000 Received: by wicja10 with SMTP id ja10so70541444wic.1 for ; Tue, 11 Aug 2015 04:03:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Az473IwHvR1sGY0IjgnqJILm8YRZwyQ2ymGufPvS6gM=; b=epn/wnVXDOtZ33rgAejZxth+uT0Q0KaIzwn7NSP59NCKqlx1v2sTO0yBnB+mb7LY2D gAv55u7rwANLkMoRljCbefcIIQyOqMmE/vPAG+4EJEZVRUWSRluBaf9SvNNszwWwVR6a bzX9PTk8ryGZ9KCMHQBJL1sWUYhbFcwUwXLkiaLqiGwvkEriRQUhNLrl3juCZVtnryhu 1fPvpxu8EylaNPHXNhzZPsZWyJh1WOgVBxlZOn0+BYgZEMAJSwaIW2DoZT6JGO858EDH YI92pTARUZGiyv+RtagN1f/HL4xVloEpaSpuUpIBraIPF7mCBvmAv/A7+DnoOqPEsTwa ngqA== X-Gm-Message-State: ALoCoQlDkpkgMhGlMAYi+/UTiy5X5d1XB2JeIwvHapIXo9L9QeHf4n4m1UnKvR8g4b3py9l5FDdn X-Received: by 10.194.92.109 with SMTP id cl13mr54512626wjb.156.1439291020601; Tue, 11 Aug 2015 04:03:40 -0700 (PDT) Received: from localhost.localdomain (host-92-13-246-184.as43234.net. [92.13.246.184]) by smtp.gmail.com with ESMTPSA id cw8sm2437206wjb.49.2015.08.11.04.03.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Aug 2015 04:03:40 -0700 (PDT) From: Srinivas Kandagatla To: Greg Kroah-Hartman Subject: [PATCH RFC 2/3] nvmem: set the size for the nvmem binary file. Date: Tue, 11 Aug 2015 12:03:36 +0100 Message-Id: <1439291016-18333-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439290931-18232-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1439290931-18232-1-git-send-email-srinivas.kandagatla@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150811_040403_218398_0AB2540B X-CRM114-Status: GOOD ( 13.23 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Lunn , arnd@arndb.de, khilman@kernel.org, devicetree@vger.kernel.org, linux-api@vger.kernel.org, s.hauer@pengutronix.de, sboyd@codeaurora.org, linux-kernel@vger.kernel.org, maitysanchayan@gmail.com, pantelis.antoniou@konsulko.com, Rob Herring , Srinivas Kandagatla , Mark Brown , p.zabel@pengutronix.de, linux-arm-msm@vger.kernel.org, mporter@konsulko.com, linux-arm-kernel@lists.infradead.org, wxt@rock-chips.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch sets the actual size of binary file to the nvmem size. Previously this was not possible as the core was using the static global data structures for attributes. Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 103f6aa..414ed23 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -312,6 +312,7 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) config->read_only; nvmem->bin = bin_attr_template; nvmem->bin.attr.mode = nvmem->read_only ? : (S_IRUSR | S_IWUSR); + nvmem->bin.size = nvmem->size; device_initialize(&nvmem->dev); dev_dbg(&nvmem->dev, "Registering nvmem device %s\n", config->name);