Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1736375imu; Thu, 17 Jan 2019 02:22:17 -0800 (PST) X-Google-Smtp-Source: ALg8bN5Y59oxvZR/yG/ZrdJynErUOfrgkBIx3kEZi7I3gz5rcY6dJT3pS1t1hkWffhw80qKr/9zj X-Received: by 2002:a63:4e15:: with SMTP id c21mr12977412pgb.50.1547720537645; Thu, 17 Jan 2019 02:22:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547720537; cv=none; d=google.com; s=arc-20160816; b=nqXHuvIJrtH57L3BE0JhVAI1fbLM6eRAhKN8xWtRdRJvrDB4IRASlZrWo2mzEe87MS hjVUvwHWx1uQNs6VKw5oBtfjFXdZgpfHrD6w01JLy39rbcbJ2fAvITyIIuoFg8U1Hw21 eTNV5JxJ42ZanbE8yn3q3lXZZPnXVx7MAH8cH3TILMZ2WBFycSCCX1JSazyVuuq2qTKs 9Xaf76LJKZZDhVEWpMABM3P1UdEVVOKoKeQh2hLsQCu2cYYgH9WbxxSppPkZE3VZ5v0n hzmjZpJxfEz8B6i7SraLhZsmCrjXfweyBGnB+O9FXZla7k4FiFbR3MBIyoYnRoCfXOof hmKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=G4MDW0RhZARgx5TiYSSJYdn+7lJiem1DGlMxsyBST44=; b=QKPNdJ5d97DQsAiXfo/ONf8fU+XaWBxmef4xV6jkfC/4wBwqY8KldW0CNDVxkHfJMN FIKmABEI1A4nO0GmVfA7pc7mDfdZ9Aqdhn5xrq8r0iE2nkjXyiH73tLLoAVsZoRNIuoo AfK6p2LrsXFEXh0m7qvsW6/Vj0+Mdbs+upUkF0tC23xi2QvnFlC9a5gatqkqEAz6ms/n 5g7WvHhbGbZJ65ZIbjn9rU8bc1++wKzm45vzvVTJOGUq4N4mGu6pZw6GhAEMxVERrYnl y37xlRtdFpCFBWD3MV7qFpZ+dSkEJkF3TVD+A6NeQZj/gHSb+/u2hypw3Yk5JvDpxsgF UzJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KY8yntzK; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 19si1225382pgp.186.2019.01.17.02.22.01; Thu, 17 Jan 2019 02:22:17 -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 header.s=google header.b=KY8yntzK; 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 S1727797AbfAQKUR (ORCPT + 99 others); Thu, 17 Jan 2019 05:20:17 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:32859 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725990AbfAQKUR (ORCPT ); Thu, 17 Jan 2019 05:20:17 -0500 Received: by mail-wm1-f65.google.com with SMTP id r24so676655wmh.0 for ; Thu, 17 Jan 2019 02:20:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=G4MDW0RhZARgx5TiYSSJYdn+7lJiem1DGlMxsyBST44=; b=KY8yntzKs5LMdURpDgncQhl5t2V9jls9aME2503Wh4PGEGyQDnJr8OUDHhRviH9DLl bSJfGDmZJrjSQdvQY9Honu2u0vMcNuNrfLoUYejxg/Bb8nGBgqIzx8T9IFlOq1AEi+Um amXD/0p1snd/4F+KvWGGzLtTLSQzFOijKbRfU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=G4MDW0RhZARgx5TiYSSJYdn+7lJiem1DGlMxsyBST44=; b=pClYgSq+oMD5kjGY3tSTQ5enX7e9I1EvxJ1oHm7+p25hG8YqEZ8vPNRjh39gOjCxOc J47oIntYGOyJ5Y2rJXvA7uxtCZYXnajSqm7uQnXu14M9Q8EoVfYphgeiUItLQj9stV+w 8e895oIKPcVFqpZ23UBtLR/a8Iaxza1t8Pb8nYClvDEoVgZ1YNojCqybzs8l9TtgRIGU 8TAZnyAhSO9sLwvtj77r7NlYwo4RRvIrUyaRqtSf075CwgzXbBzGVuinG+p3GHXCO5qR KdSC400WmTg2+Vqw4hF55OU++ekDLreJgLG+oqEGknxEfcctubnKkYVTYIh4yKXsktVc HL1Q== X-Gm-Message-State: AJcUukd4RrYXwOQDMLTU5oybol0qBQYeXjiEjl67NNws96mJsBv4jVJP 3Y8xuhZ1mESV2/Lpn2cGhi3o/Yyjpfw= X-Received: by 2002:a1c:2b01:: with SMTP id r1mr10906918wmr.7.1547720414634; Thu, 17 Jan 2019 02:20:14 -0800 (PST) Received: from [192.168.86.34] (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.googlemail.com with ESMTPSA id y34sm225764748wrd.68.2019.01.17.02.20.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Jan 2019 02:20:13 -0800 (PST) Subject: Re: [PATCH 3/8] nvmem: Add nvmem_cell_get_optional and devm_nvmem_cell_get_optional To: Alban Cc: linux-kernel@vger.kernel.org References: <20190106192820.12558-1-albeu@free.fr> <20190106192820.12558-4-albeu@free.fr> <20190116192658.7df211e8@tack> From: Srinivas Kandagatla Message-ID: <5ea0d73e-5a71-708e-4c45-bb8d27137e45@linaro.org> Date: Thu, 17 Jan 2019 10:20:11 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190116192658.7df211e8@tack> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/01/2019 18:26, Alban wrote: >> What is the real use-case here, it does not make sense to me to add this >> additional call just to return NULL when cell is not found! > It also return NULL when nvmem is not compiled in. I quiet like such > convenience functions as they make the driver code much simpler and > the intent explicit. It replace: > > data->cell = devm_nvmem_cell_get(dev, "my-cell"); > if (IS_ERR(data->cell) { > if (PTR_ERR(data->cell) == -ENOENT || > PTR_ERR(data->cell) == -EOPNOTSUPP) > data->cell = NULL; > else > return PTR_ERR(data->cell); > } > > with: > > data->cell = dev_nvmem_cell_get_optional(dev, "my-cell"); > if (IS_ERR(cell)) > return PTR_ERR(data->cell); > > It's your call if you find that useful or not. I don't think this should belong to nvmem core in anyway! Its more of consumer specific logic! I have already applied all of the patches in this series except this one! thanks, srini