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: 52303 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by patches.linaro.org (Postfix) with ESMTPS id 080B622DD6 for ; Tue, 11 Aug 2015 11:04:07 +0000 (UTC) Received: by labia3 with SMTP id ia3sf49345165lab.1 for ; Tue, 11 Aug 2015 04:04:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=Uunx+LuqRT8h0xpRXzY7YYGR6FwHQHeXw4dBS7b6Y3M=; b=ey0VaOCOTSCOqDtDsGKQ6zNQWA4ZZM1XhMetNwWTxbh7cd5o/ZFTOtEw1Qwancqfrl 17O5JKblJ9O1KpytY2Wh3bMp/kJWhoy2TnSWLojY9w1v5cl3o/iEx+IHsks6yX++wO9t 3marVVBS8Eh+B6Z8OMYEfLkn7nXxF71qqVZwEyvuZRfLGtYx4KbyV9q4vVbNLSsQU+VA ujbCWnc9zCOWL7SQ2WIiwSEtRZjM7ia/EyfJIj8SZMEPoG/QTzVrCmyfLtzPXsl2GzT1 trc8cQ/NXRLplQpluk/UE3ilZganpi0y/THgXr42/fU3CjwmGx13tNO3zOuSzmTWop1W auoQ== X-Gm-Message-State: ALoCoQnnpLsp/YkPf5oj5f7/2sYJ8Ns/i0uaC/lir3jL6qRFtfB79XMYNki8AgRO1kNDct8l/IBp X-Received: by 10.152.182.226 with SMTP id eh2mr7813512lac.0.1439291045934; Tue, 11 Aug 2015 04:04:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.51 with SMTP id t19ls635179lal.22.gmail; Tue, 11 Aug 2015 04:04:05 -0700 (PDT) X-Received: by 10.112.159.1 with SMTP id wy1mr26258584lbb.55.1439291045537; Tue, 11 Aug 2015 04:04:05 -0700 (PDT) Received: from mail-la0-f53.google.com (mail-la0-f53.google.com. [209.85.215.53]) by mx.google.com with ESMTPS id ku9si1081343lac.141.2015.08.11.04.04.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Aug 2015 04:04:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) client-ip=209.85.215.53; Received: by lahi9 with SMTP id i9so38368545lah.2 for ; Tue, 11 Aug 2015 04:04:05 -0700 (PDT) X-Received: by 10.152.120.135 with SMTP id lc7mr25273805lab.41.1439291044947; Tue, 11 Aug 2015 04:04:04 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp2449128lba; Tue, 11 Aug 2015 04:04:03 -0700 (PDT) X-Received: by 10.70.65.38 with SMTP id u6mr54342582pds.99.1439291037340; Tue, 11 Aug 2015 04:03:57 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e3si2876335pdf.91.2015.08.11.04.03.56; Tue, 11 Aug 2015 04:03:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964863AbbHKLDn (ORCPT + 6 others); Tue, 11 Aug 2015 07:03:43 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:36579 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964848AbbHKLDl (ORCPT ); Tue, 11 Aug 2015 07:03:41 -0400 Received: by wicja10 with SMTP id ja10so70541452wic.1 for ; Tue, 11 Aug 2015 04:03:40 -0700 (PDT) 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 Cc: Andrew Lunn , wxt@rock-chips.com, linux-api@vger.kernel.org, Rob Herring , sboyd@codeaurora.org, arnd@arndb.de, linux-arm-kernel@lists.infradead.org, khilman@kernel.org, s.hauer@pengutronix.de, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, mporter@konsulko.com, pantelis.antoniou@konsulko.com, devicetree@vger.kernel.org, Mark Brown , maitysanchayan@gmail.com, p.zabel@pengutronix.de, Srinivas Kandagatla 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> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: srinivas.kandagatla@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.53 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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);