Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933269AbeAKVbD (ORCPT + 1 other); Thu, 11 Jan 2018 16:31:03 -0500 Received: from galahad.ideasonboard.com ([185.26.127.97]:51479 "EHLO galahad.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932603AbeAKVbB (ORCPT ); Thu, 11 Jan 2018 16:31:01 -0500 From: Laurent Pinchart To: Jani Nikula Cc: Maxime Ripard , Daniel Vetter , Sean Paul , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Mark Brown Subject: Re: [PATCH] drm/panel: lvds: Handle the optional regulator case properly Date: Thu, 11 Jan 2018 23:30:59 +0200 Message-ID: <4247973.Y2IEusv7l3@avalon> Organization: Ideas on Board Oy In-Reply-To: <87zi5kii00.fsf@intel.com> References: <20180110155941.16109-1-maxime.ripard@free-electrons.com> <1944741.zEkzsdPTSS@avalon> <87zi5kii00.fsf@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Hi Jani, On Thursday, 11 January 2018 16:31:59 EET Jani Nikula wrote: > On Thu, 11 Jan 2018, Laurent Pinchart wrote: > > My preference, however, would be for devm_regulator_get_optional() to > > return NULL when no regulator is present. The current implementation > > returns -ENODEV in multiple cases, making it impossible to properly > > discriminate between having no regulator and not being able to get the > > regulator due to an error. > > Just a word of warning, IS_ERR(NULL) is false, and your proposed change > would apparently require quite a churn all over the kernel. That's correct, but I still think that would make the API clearer. I don't want to block this patch until we make such a change, but it's a good opportunity to discuss it. I'd like to know what Mark's opinion is. -- Regards, Laurent Pinchart