From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751967AbdBGAVY (ORCPT ); Mon, 6 Feb 2017 19:21:24 -0500 Received: from mail-pf0-f172.google.com ([209.85.192.172]:35507 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751164AbdBGAVX (ORCPT ); Mon, 6 Feb 2017 19:21:23 -0500 Date: Mon, 6 Feb 2017 16:21:18 -0800 From: Bjorn Andersson To: Dmitry Torokhov Cc: Mark Brown , Liam Girdwood , linux-kernel@vger.kernel.org, Bjorn Andersson Subject: Re: [PATCH 4/4] regulator: core: make bulk API support optional supplies Message-ID: <20170207002118.GD27837@minitux> References: <20170203231619.8013-1-dmitry.torokhov@gmail.com> <20170203231619.8013-4-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170203231619.8013-4-dmitry.torokhov@gmail.com> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 03 Feb 15:16 PST 2017, Dmitry Torokhov wrote: > Make it possible to use the bulk API with optional supplies, by allowing > the consumer to marking supplies as optional in the regulator_bulk_data. > > Based on earlier patch by Bjorn Andersson > Hi Dmitry, Rather than fixing my broken patch, I reverted it after talking to Mark. This as I realized that I got things backwards. When a given component has an "optional" supply this can mean two things: 1) The component has a supply pin that is connected, but the kernel has no information about what it's connected to (in essence a "broken" DT). In this case regulator_get() will return a dummy regulator. 2) The component has a supply pin that might or not might be connected and depending on this the component needs to be configured differently. In this case you use regulator_get_optional() which will return an error in the event that no supply is specified. With this in mind, supporting optional supplies in the bulk operations makes less sense. (And after further review my case was a clear #1) Regards, Bjorn