From patchwork Sun Jan 22 23:02:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 92171 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp981974qgi; Sun, 22 Jan 2017 15:03:12 -0800 (PST) X-Received: by 10.84.193.36 with SMTP id e33mr38871517pld.4.1485126192855; Sun, 22 Jan 2017 15:03:12 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si13669812pfg.293.2017.01.22.15.03.12; Sun, 22 Jan 2017 15:03:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750822AbdAVXDF (ORCPT + 25 others); Sun, 22 Jan 2017 18:03:05 -0500 Received: from mail-wm0-f50.google.com ([74.125.82.50]:37599 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750704AbdAVXDC (ORCPT ); Sun, 22 Jan 2017 18:03:02 -0500 Received: by mail-wm0-f50.google.com with SMTP id c206so128244297wme.0 for ; Sun, 22 Jan 2017 15:03:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iaCJSZkGJf0T8wvnF1hUzM/SvrrQ4dJtotKtm6GHQX4=; b=L/9EPH/4FLYHOtuwOxwVpXCBrWJ2dfy23Va9RWejhWcxiRkVjbcUuySZDOzYuij1Jo +Dg6nAG12sud5NcTHuTKVo03h/DRHTVpASHnDmX76T3xK4NMpY8A02U7ZWhTHcovEWHO oL4oBTxNUOZ2TQoGj5yZTr1Kb6VijDbScSE0E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iaCJSZkGJf0T8wvnF1hUzM/SvrrQ4dJtotKtm6GHQX4=; b=ZZ9tUSO5fvf53TPhnHrijBj9lsoT3W8A+MoSb7WZss4MdDYSwWh1PtGmC3CrsvxXPy YnWUnlrTRXExXnPw9BvxeF9M61N/imM0GCEaRSD/3MJJOFjDLSLnPOSNQV8/zboDvc1B 7liyQR/6+L4Mzc6vNHEB3fvvlp9/AKwDcWgtiZmb2rJ1E48Dq2ExAiqRfYaYg74CC8fB 3BKOfAneoCNVBoppZvMud7PCXlUUWVThbT+BlX7twBuq3IFXTUFN4NrScrMRM2Jy3TUu INok5i+LrUaUtDf0nQQnZlHQ42+UM9vNUbivr+xg2h9sDR7ftC1hSvviEXyNvFxuxosd QCow== X-Gm-Message-State: AIkVDXJLlJrRwbe1osc6B2xz7TeIlqU0dpAGru+ccZ1C+5AWrmPXOITeq7MP4mmPStCXsTbJ X-Received: by 10.223.162.211 with SMTP id t19mr20876733wra.57.1485126181225; Sun, 22 Jan 2017 15:03:01 -0800 (PST) Received: from localhost.localdomain (host-2-98-105-38.as13285.net. [2.98.105.38]) by smtp.gmail.com with ESMTPSA id l74sm18084857wmg.2.2017.01.22.15.03.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 22 Jan 2017 15:03:00 -0800 (PST) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: maxime.ripard@free-electrons.com, linux-kernel@vger.kernel.org, Bai Ping , Srinivas Kandagatla Subject: [PATCH 1/5] nvmem: octop: Add support for imx6ul Date: Sun, 22 Jan 2017 23:02:36 +0000 Message-Id: <1485126160-3892-3-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485126160-3892-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1485126160-3892-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bai Ping i.MX6UL is an new SOC of i.MX6 family. Enable ocotp driver support for this SOC. Signed-off-by: Bai Ping Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/imx-ocotp.c | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c index 8e7b120..b8ca1e6 100644 --- a/drivers/nvmem/imx-ocotp.c +++ b/drivers/nvmem/imx-ocotp.c @@ -73,6 +73,7 @@ static const struct of_device_id imx_ocotp_dt_ids[] = { { .compatible = "fsl,imx6q-ocotp", (void *)128 }, { .compatible = "fsl,imx6sl-ocotp", (void *)64 }, { .compatible = "fsl,imx6sx-ocotp", (void *)128 }, + { .compatible = "fsl,imx6ul-ocotp", (void *)128 }, { }, }; MODULE_DEVICE_TABLE(of, imx_ocotp_dt_ids); From patchwork Sun Jan 22 23:02:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 92172 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp981978qgi; Sun, 22 Jan 2017 15:03:13 -0800 (PST) X-Received: by 10.84.150.129 with SMTP id h1mr38895583plh.9.1485126193200; Sun, 22 Jan 2017 15:03:13 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si13669812pfg.293.2017.01.22.15.03.12; Sun, 22 Jan 2017 15:03:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750839AbdAVXDK (ORCPT + 25 others); Sun, 22 Jan 2017 18:03:10 -0500 Received: from mail-wm0-f48.google.com ([74.125.82.48]:35842 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750704AbdAVXDI (ORCPT ); Sun, 22 Jan 2017 18:03:08 -0500 Received: by mail-wm0-f48.google.com with SMTP id c85so108670337wmi.1 for ; Sun, 22 Jan 2017 15:03:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iuRv8D/nPzQzyZU8zGwQ4OcK05XXB72b33epQOhlKDw=; b=Cfjomo+9KTN/0TZD3FQju8pdBgeQ17UyNWptJCa52hLM35MkUEBYpq7e1WyO1kQCsg ESl6+4QSQvzLYBihZvtZNN2qUkd1B8CHGocXoKhmLgmanAO2nWZkn7f1+nrz2krlwFbR P+3Rco5eT2e6HIeknvCLTCXMun8P4EhPxICys= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iuRv8D/nPzQzyZU8zGwQ4OcK05XXB72b33epQOhlKDw=; b=aIrJwz7P5PUpIyWpQVH6sFgLb8kS5zjeuwDOKewlq9k2+2NMnQD6+ygODnKxI538b2 FKquRr7Q9vDIeTSI1UdxYZ+ONXkqXswBs+UPr2ZnsHP1zXjmEHxQWCll0oTsvwmmbkLx X/304fH5k5lH93W9UZ9ZG/ljkCHgUqFF5ieBjOVBR78K2CijFG/VTGdqnXGsKaj51JUK 7NPhzOZC4S2u+7miJtDrRxSOiK8h7J5jrj6ThTBQHmaEnQgNKZhpPCkKc8ieNo11ZvSu 9cFNLPM9MSaKlviznhrBZJ3oG4PvxdPJBCdET1PFJ3RVjFbWUYFYcpxCE+TQkt/WhHxx VsMg== X-Gm-Message-State: AIkVDXLH0eqCByClYXdn4Q51EJfxQQKjbVcvmyctLUn7dBDFG/ubp/fjyOJ63T7f/NDRdgdW X-Received: by 10.223.139.213 with SMTP id w21mr21111483wra.108.1485126182265; Sun, 22 Jan 2017 15:03:02 -0800 (PST) Received: from localhost.localdomain (host-2-98-105-38.as13285.net. [2.98.105.38]) by smtp.gmail.com with ESMTPSA id l74sm18084857wmg.2.2017.01.22.15.03.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 22 Jan 2017 15:03:01 -0800 (PST) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: maxime.ripard@free-electrons.com, linux-kernel@vger.kernel.org, Bai Ping , Srinivas Kandagatla Subject: [PATCH 2/5] devicetree: bindings: nvmem: Add compatible string for imx6ul Date: Sun, 22 Jan 2017 23:02:37 +0000 Message-Id: <1485126160-3892-4-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485126160-3892-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1485126160-3892-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bai Ping Add new compatible string for i.MX6UL SOC. Signed-off-by: Bai Ping Acked-by: Rob Herring Signed-off-by: Srinivas Kandagatla --- Documentation/devicetree/bindings/nvmem/imx-ocotp.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/Documentation/devicetree/bindings/nvmem/imx-ocotp.txt b/Documentation/devicetree/bindings/nvmem/imx-ocotp.txt index 383d588..966a72e 100644 --- a/Documentation/devicetree/bindings/nvmem/imx-ocotp.txt +++ b/Documentation/devicetree/bindings/nvmem/imx-ocotp.txt @@ -1,13 +1,15 @@ Freescale i.MX6 On-Chip OTP Controller (OCOTP) device tree bindings This binding represents the on-chip eFuse OTP controller found on -i.MX6Q/D, i.MX6DL/S, i.MX6SL, and i.MX6SX SoCs. +i.MX6Q/D, i.MX6DL/S, i.MX6SL, i.MX6SX and i.MX6UL SoCs. Required properties: - compatible: should be one of "fsl,imx6q-ocotp" (i.MX6Q/D/DL/S), "fsl,imx6sl-ocotp" (i.MX6SL), or - "fsl,imx6sx-ocotp" (i.MX6SX), followed by "syscon". + "fsl,imx6sx-ocotp" (i.MX6SX), + "fsl,imx6ul-ocotp" (i.MX6UL), + followed by "syscon". - reg: Should contain the register base and length. - clocks: Should contain a phandle pointing to the gated peripheral clock. From patchwork Sun Jan 22 23:02:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 92175 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp982292qgi; Sun, 22 Jan 2017 15:04:20 -0800 (PST) X-Received: by 10.84.133.163 with SMTP id f32mr23043701plf.64.1485126260873; Sun, 22 Jan 2017 15:04:20 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f2si13668676pga.244.2017.01.22.15.04.20; Sun, 22 Jan 2017 15:04:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750940AbdAVXDx (ORCPT + 25 others); Sun, 22 Jan 2017 18:03:53 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:35728 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750805AbdAVXDF (ORCPT ); Sun, 22 Jan 2017 18:03:05 -0500 Received: by mail-wm0-f52.google.com with SMTP id r126so108990136wmr.0 for ; Sun, 22 Jan 2017 15:03:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=i8KSbPy0oCPwMRpna9w4DnpfFP6B2jVUEKLuwGguWjk=; b=ZilYumegA3+Ks/cYbFxIhmx3WbFQyzpUSPjAuaOsP77hFhD1HVYfGEBCXwrEzcBDNQ RZP8KHKvGp+zgipWgVqBvTnWQJukwwUAyJziDTO4DeLemXqVoow+r7TmhDzmNh1A5yP3 3v9tWUl/G01FdIBPZcy62x/ZBbkulMwL1Xa/Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=i8KSbPy0oCPwMRpna9w4DnpfFP6B2jVUEKLuwGguWjk=; b=g1H1dCJA6n9xstFH5t8sH2t3KK0j135iVWQD0/P2xeuvKjCdBH4hMKBUPRaMKx5rRG wlYVFKUjmMEprf3fJJRbcE9LR8FXcyBWOMFlPz7Wa5k97xh73nAscDk6vvbH77d55BT0 YOKDzTbdKqPBF+AJu2gcJgeEmympvKqzJAYnIymfY8TLX4g4nNqFHrwJO9Fn7eT2plnr T+IZzS1aSE1pCEt0lshM5fyN0mIT0qxPpgRB9+owzuGFjkgPa8HaYxlh9MLx5Rmo0QjJ B0AsRtRmT9p1NiRfBjExEECBYsQiQ0RdEyD5c5OqSh0zgPG1AauLjriPhaXvSRDriFJX edug== X-Gm-Message-State: AIkVDXJ3NVoqwHUbyilAU9ro6LK+6bfXm7+za7rI3RdeaCWOFJ57O3vAEp+QprSsIW30mSHM X-Received: by 10.223.164.151 with SMTP id g23mr21337229wrb.86.1485126183603; Sun, 22 Jan 2017 15:03:03 -0800 (PST) Received: from localhost.localdomain (host-2-98-105-38.as13285.net. [2.98.105.38]) by smtp.gmail.com with ESMTPSA id l74sm18084857wmg.2.2017.01.22.15.03.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 22 Jan 2017 15:03:03 -0800 (PST) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: maxime.ripard@free-electrons.com, linux-kernel@vger.kernel.org, Vivek Gautam , Srinivas Kandagatla Subject: [PATCH 3/5] nvmem: core: Allow ignoring length when reading a cell Date: Sun, 22 Jan 2017 23:02:38 +0000 Message-Id: <1485126160-3892-5-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485126160-3892-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1485126160-3892-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vivek Gautam nvmem_cell_read() API fills in the argument 'len' with the number of bytes read from the cell. Many users don't care about this length value. So allow users to pass a NULL pointer to this len field. Signed-off-by: Vivek Gautam Reviewed-by: Stephen Boyd Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.7.4 diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 398ea7f..78aa06a 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -970,7 +970,8 @@ static int __nvmem_cell_read(struct nvmem_device *nvmem, if (cell->bit_offset || cell->nbits) nvmem_shift_read_buffer_in_place(cell, buf); - *len = cell->bytes; + if (len) + *len = cell->bytes; return 0; } @@ -979,7 +980,8 @@ static int __nvmem_cell_read(struct nvmem_device *nvmem, * nvmem_cell_read() - Read a given nvmem cell * * @cell: nvmem cell to be read. - * @len: pointer to length of cell which will be populated on successful read. + * @len: pointer to length of cell which will be populated on successful read; + * can be NULL. * * Return: ERR_PTR() on error or a valid pointer to a buffer on success. The * buffer should be freed by the consumer with a kfree(). From patchwork Sun Jan 22 23:02:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 92174 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp982057qgi; Sun, 22 Jan 2017 15:03:33 -0800 (PST) X-Received: by 10.84.143.165 with SMTP id 34mr17824905plz.2.1485126213336; Sun, 22 Jan 2017 15:03:33 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h6si13711519plk.94.2017.01.22.15.03.33; Sun, 22 Jan 2017 15:03:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750882AbdAVXDS (ORCPT + 25 others); Sun, 22 Jan 2017 18:03:18 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:35857 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750859AbdAVXDQ (ORCPT ); Sun, 22 Jan 2017 18:03:16 -0500 Received: by mail-wm0-f45.google.com with SMTP id c85so108671183wmi.1 for ; Sun, 22 Jan 2017 15:03:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=k0sFL874tOXuB5xFn29/mC1wfpTNNGUXT4ueUHiL6CQ=; b=Ys+hBcXz4S3tivAOBNQ7Sxk2zgicoZw1opsfk5wFannS4n1ixoFPtNmOQnHkFmwhwC 1ze2UkBc8GAA6y2aA3veSi1pHmX8BBUMeIU6fb6wgSO9kGidU0o6KTNr5uY7jO6cHbr4 uJN5+uQTL+HvW70e0QACG0GFsTIf3hLHGB9y8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=k0sFL874tOXuB5xFn29/mC1wfpTNNGUXT4ueUHiL6CQ=; b=HLFz3pDMG31IntvAjRwWXmFWRt+tCHxIhckIvJoGDHlDAMMCk/BkQ5b74FZNucnQJz X5cBMurUCraFN3a07uZnTr1vLCGSY7uDTTcpmq2jMdo2g9uX6m2CMBW9kM5Zaq/UnGoi +K1q7GliKdvGWTFlN1VDNbLMkoInQuC5RDWaRNOw7Wp+SunzfartE+vzZYcCrV/BZjwG pCIxt5wbD+KWqeVrfiW/38CGqL/cxFCgTlnZiN8BOIDSSHslZ4cRuDKfmfGsskDYD5yP OE2apJmTTliovHFD9HwsALQC3Go4igPoHGwYxbbTGMsim2GuQhAc4b1Y3l5L3m7NbU4l pNrg== X-Gm-Message-State: AIkVDXLw/fSHcAetoVLjbn83Tzr8oWMWlyc6lIlPx1JKeB1o/c+zsB2VIPFJ8jjwonQHqV+H X-Received: by 10.223.166.80 with SMTP id k74mr20710646wrc.171.1485126184679; Sun, 22 Jan 2017 15:03:04 -0800 (PST) Received: from localhost.localdomain (host-2-98-105-38.as13285.net. [2.98.105.38]) by smtp.gmail.com with ESMTPSA id l74sm18084857wmg.2.2017.01.22.15.03.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 22 Jan 2017 15:03:03 -0800 (PST) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: maxime.ripard@free-electrons.com, linux-kernel@vger.kernel.org, Vivek Gautam , Srinivas Kandagatla Subject: [PATCH 4/5] nvmem: core: Correct a bunch of function documentations Date: Sun, 22 Jan 2017 23:02:39 +0000 Message-Id: <1485126160-3892-6-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485126160-3892-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1485126160-3892-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vivek Gautam Correct the documentation for arguments to a number of functions. Signed-off-by: Vivek Gautam Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) -- 2.7.4 diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 78aa06a..9c05921 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -608,7 +608,7 @@ static struct nvmem_device *nvmem_find(const char *name) /** * of_nvmem_device_get() - Get nvmem device from a given id * - * @dev node: Device tree node that uses the nvmem device + * @np: Device tree node that uses the nvmem device. * @id: nvmem name from nvmem-names property. * * Return: ERR_PTR() on error or a valid pointer to a struct nvmem_device @@ -634,8 +634,8 @@ EXPORT_SYMBOL_GPL(of_nvmem_device_get); /** * nvmem_device_get() - Get nvmem device from a given id * - * @dev : Device that uses the nvmem device - * @id: nvmem name from nvmem-names property. + * @dev: Device that uses the nvmem device. + * @dev_name: name of the requested nvmem device. * * Return: ERR_PTR() on error or a valid pointer to a struct nvmem_device * on success. @@ -674,6 +674,7 @@ static void devm_nvmem_device_release(struct device *dev, void *res) /** * devm_nvmem_device_put() - put alredy got nvmem device * + * @dev: Device that uses the nvmem device. * @nvmem: pointer to nvmem device allocated by devm_nvmem_cell_get(), * that needs to be released. */ @@ -702,8 +703,8 @@ EXPORT_SYMBOL_GPL(nvmem_device_put); /** * devm_nvmem_device_get() - Get nvmem cell of device form a given id * - * @dev node: Device tree node that uses the nvmem cell - * @id: nvmem name in nvmems property. + * @dev: Device that requests the nvmem device. + * @id: name id for the requested nvmem device. * * Return: ERR_PTR() on error or a valid pointer to a struct nvmem_cell * on success. The nvmem_cell will be freed by the automatically once the @@ -745,8 +746,8 @@ static struct nvmem_cell *nvmem_cell_get_from_list(const char *cell_id) /** * of_nvmem_cell_get() - Get a nvmem cell from given device node and cell id * - * @dev node: Device tree node that uses the nvmem cell - * @id: nvmem cell name from nvmem-cell-names property. + * @np: Device tree node that uses the nvmem cell. + * @name: nvmem cell name from nvmem-cell-names property. * * Return: Will be an ERR_PTR() on error or a valid pointer * to a struct nvmem_cell. The nvmem_cell will be freed by the @@ -830,8 +831,8 @@ EXPORT_SYMBOL_GPL(of_nvmem_cell_get); /** * nvmem_cell_get() - Get nvmem cell of device form a given cell name * - * @dev node: Device tree node that uses the nvmem cell - * @id: nvmem cell name to get. + * @dev: Device that requests the nvmem cell. + * @cell_id: nvmem cell name to get. * * Return: Will be an ERR_PTR() on error or a valid pointer * to a struct nvmem_cell. The nvmem_cell will be freed by the @@ -859,8 +860,8 @@ static void devm_nvmem_cell_release(struct device *dev, void *res) /** * devm_nvmem_cell_get() - Get nvmem cell of device form a given id * - * @dev node: Device tree node that uses the nvmem cell - * @id: nvmem id in nvmem-names property. + * @dev: Device that requests the nvmem cell. + * @id: nvmem cell name id to get. * * Return: Will be an ERR_PTR() on error or a valid pointer * to a struct nvmem_cell. The nvmem_cell will be freed by the @@ -900,7 +901,8 @@ static int devm_nvmem_cell_match(struct device *dev, void *res, void *data) * devm_nvmem_cell_put() - Release previously allocated nvmem cell * from devm_nvmem_cell_get. * - * @cell: Previously allocated nvmem cell by devm_nvmem_cell_get() + * @dev: Device that requests the nvmem cell. + * @cell: Previously allocated nvmem cell by devm_nvmem_cell_get(). */ void devm_nvmem_cell_put(struct device *dev, struct nvmem_cell *cell) { @@ -916,7 +918,7 @@ EXPORT_SYMBOL(devm_nvmem_cell_put); /** * nvmem_cell_put() - Release previously allocated nvmem cell. * - * @cell: Previously allocated nvmem cell by nvmem_cell_get() + * @cell: Previously allocated nvmem cell by nvmem_cell_get(). */ void nvmem_cell_put(struct nvmem_cell *cell) { @@ -1128,7 +1130,7 @@ EXPORT_SYMBOL_GPL(nvmem_device_cell_read); * nvmem_device_cell_write() - Write cell to a given nvmem device * * @nvmem: nvmem device to be written to. - * @info: nvmem cell info to be written + * @info: nvmem cell info to be written. * @buf: buffer to be written to cell. * * Return: length of bytes written or negative error code on failure. From patchwork Sun Jan 22 23:02:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 92173 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp982056qgi; Sun, 22 Jan 2017 15:03:33 -0800 (PST) X-Received: by 10.99.227.5 with SMTP id f5mr6939434pgh.102.1485126213001; Sun, 22 Jan 2017 15:03:33 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h6si13711519plk.94.2017.01.22.15.03.32; Sun, 22 Jan 2017 15:03:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750857AbdAVXDN (ORCPT + 25 others); Sun, 22 Jan 2017 18:03:13 -0500 Received: from mail-wm0-f51.google.com ([74.125.82.51]:35861 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750704AbdAVXDL (ORCPT ); Sun, 22 Jan 2017 18:03:11 -0500 Received: by mail-wm0-f51.google.com with SMTP id c85so108671458wmi.1 for ; Sun, 22 Jan 2017 15:03:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iJHnvZlZOqm7UnR9AlPdwJ9T7y/33+YOMj002juo0OM=; b=KfEE+aA2P8jQQHEbCtI8s7abwVTe7AFb4THfPLvHljc/fZYQ78vEHRvZFkX3baZ8Wu d3Jb6HsFssCWoTTQdKn/9ND22tO8717nZh79hIUXwlTBbpszW6AXqeq6oEKVojdLFLrn eOcYC9UoKjh2s0aZDX5/MzCOjl3OpsFhF3MHw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iJHnvZlZOqm7UnR9AlPdwJ9T7y/33+YOMj002juo0OM=; b=uX1dXYwjJsanblksl+45hSbJMDH4PBpsqjEA7QhR5YTIeIcIR/LIlUXHvpdy3wDGve 8V5MF3HOzNHtEv4VlnTh1wx1wMgO+qvryB5G9x2tP9c7d/wzd290uZ2pyGWPYX5TOb0/ jW/CZbL6ZS9a2ArzCMLlQAfgM4KhJQP2bltclgx6UTFwezKR5jXt7HA8ZfFiaCvT65VR af0FiuGJiakLOzRjQhF6xoshn8wTRdBRF7Quwu5kiO6K51wGjSrb4uwG23rffTgt5RfE Jw0k5bLcSvMSVwIS/6BU575Ams8FpuWfNKY8k6SaJfLYGYv+vlwHT1RHSRUt+OpXIZ2H +3ZA== X-Gm-Message-State: AIkVDXJZ9Vab6PT6GXl16MGiLm7RYxWiYUwbdlUetFM4UYoPEGJJgK7yI2AYKZkB6u5sQHDx X-Received: by 10.223.168.111 with SMTP id l102mr20528087wrc.150.1485126185549; Sun, 22 Jan 2017 15:03:05 -0800 (PST) Received: from localhost.localdomain (host-2-98-105-38.as13285.net. [2.98.105.38]) by smtp.gmail.com with ESMTPSA id l74sm18084857wmg.2.2017.01.22.15.03.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 22 Jan 2017 15:03:05 -0800 (PST) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: maxime.ripard@free-electrons.com, linux-kernel@vger.kernel.org, Vivek Gautam , Srinivas Kandagatla Subject: [PATCH 5/5] nvmem: core: Allow getting nvmem cell with a NULL cell id Date: Sun, 22 Jan 2017 23:02:40 +0000 Message-Id: <1485126160-3892-7-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485126160-3892-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1485126160-3892-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vivek Gautam The nvmem cell with a NULL cell name/id should be the one with no accompanying 'nvmem-cell-names' property, and thus will be the cell at index 0 in the device tree. So, we default to index 0 and update the cell index only when nvmem cell name id exists. Suggested-by: Stephen Boyd Signed-off-by: Vivek Gautam Reviewed-by: Stephen Boyd Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) -- 2.7.4 diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 9c05921..408b521 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -747,7 +747,9 @@ static struct nvmem_cell *nvmem_cell_get_from_list(const char *cell_id) * of_nvmem_cell_get() - Get a nvmem cell from given device node and cell id * * @np: Device tree node that uses the nvmem cell. - * @name: nvmem cell name from nvmem-cell-names property. + * @name: nvmem cell name from nvmem-cell-names property, or NULL + * for the cell at index 0 (the lone cell with no accompanying + * nvmem-cell-names property). * * Return: Will be an ERR_PTR() on error or a valid pointer * to a struct nvmem_cell. The nvmem_cell will be freed by the @@ -760,9 +762,12 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np, struct nvmem_cell *cell; struct nvmem_device *nvmem; const __be32 *addr; - int rval, len, index; + int rval, len; + int index = 0; - index = of_property_match_string(np, "nvmem-cell-names", name); + /* if cell name exists, find index to the name */ + if (name) + index = of_property_match_string(np, "nvmem-cell-names", name); cell_np = of_parse_phandle(np, "nvmem-cells", index); if (!cell_np)