From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Boyd Subject: Re: [PATCH 2/2] nvmem: core: Allow getting nvmem cell with a NULL cell id Date: Mon, 9 Jan 2017 11:53:41 -0800 Message-ID: <20170109195341.GQ17126@codeaurora.org> References: <1483693823-8858-1-git-send-email-vivek.gautam@codeaurora.org> <1483693823-8858-2-git-send-email-vivek.gautam@codeaurora.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]:34130 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751703AbdAITxn (ORCPT ); Mon, 9 Jan 2017 14:53:43 -0500 Content-Disposition: inline In-Reply-To: <1483693823-8858-2-git-send-email-vivek.gautam@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org List-Id: linux-arm-msm@vger.kernel.org To: Vivek Gautam Cc: srinivas.kandagatla@linaro.org, maxime.ripard@free-electrons.com, linux-arm-msm@vger.kernel.org On 01/06, Vivek Gautam wrote: > 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 Except the typo below: > diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c > index 294cdef96277..d243dc6ad1a4 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 acoompanying s/acoompanying/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 -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project