Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp942058imm; Fri, 13 Jul 2018 08:50:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpecuSnHnHJSF82VzMcTq3lwvLgeMGyZwNleNCKUSS0q6j32uq1XI6/VQpHYf++gG9g7TQxO X-Received: by 2002:a63:2506:: with SMTP id l6-v6mr4819263pgl.237.1531497029252; Fri, 13 Jul 2018 08:50:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531497029; cv=none; d=google.com; s=arc-20160816; b=V3JR41ZQMszao6QmK6t+8WKBYRVDXsQPu4Z29dhlCzT8vE7yE4IMpfAB5BlNpWbq0O 7vl3ipzkllibpmkq8RHZve37fWXro+YqVZDkj1cQ8cvihx9cgQYDcoEQUKF9bm5C+yPF FvAdCmIY0XGretwRsW4tRHrTm3ns/HabdCxhAxvx2PrVyolWolpG9hRVOHfdBFnQH48K vH73DYT21vCbfvXIFLcASAT2BKkKricj8VfDNGcbaLAFF/7naWoQOiZ4g28G+Pms0OMO QNwjUMhWyepKmiVQC6y4eWaB6tM61VUHFAcXWuec7oj82uVC7lPeslGFN9bPshdEpujx jprA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=4aORM2Hd7gvIjDvfUWIhDORD4dLICqGyr033oikXe/8=; b=w0eNO8qlBm9FvkB8nDp1I0Q4I8NjjKdpbET2IjZAxjlibVrjE73wUzM9lAmKDImlO2 28RJtRXrGsMFDyMz0RjG391jYEdK7ui9qmurRNVy/VvtBldwLxRKf82HaNFJv3xWeNmE Di0j1bdBVERuc0it8IbOEaizwV+GgKq3QlBmNcB0DZKr7fFMOoykpxnsSyv64EYqldtd ctGPRUCb6qJ9MF/p0NoK25LDpObUW7PbVIDckolSoZElSZRx0SxxriHE1v+t48p+AQEK HbaJKyIzhNJ62YhEywXKpWscoEoISvDFSiu2DlbRBnaZY/89/hja4Rc6muAvB/IvqO5I /J/w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bf10-v6si4949460plb.69.2018.07.13.08.50.13; Fri, 13 Jul 2018 08:50:29 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730167AbeGMQEM (ORCPT + 99 others); Fri, 13 Jul 2018 12:04:12 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:34589 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729763AbeGMQEM (ORCPT ); Fri, 13 Jul 2018 12:04:12 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1fe0JV-0005uJ-2y; Fri, 13 Jul 2018 17:48:57 +0200 Received: from mfe by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1fe0JS-0002ZM-Cf; Fri, 13 Jul 2018 17:48:54 +0200 Date: Fri, 13 Jul 2018 17:48:54 +0200 From: Marco Felsch To: Mark Brown Cc: lgirdwood@gmail.com, m.purski@samsung.com, p.paillet@st.com, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH] regulator: core: fix _regulator_do_disable return value Message-ID: <20180713154854.qmnraejcdq6gqn3x@pengutronix.de> References: <20180713125624.13783-1-m.felsch@pengutronix.de> <20180713130715.GC16228@sirena.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180713130715.GC16228@sirena.org.uk> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 17:36:14 up 204 days, 4:14, 54 users, load average: 0.01, 0.03, 0.00 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mark, tanks for the feedback. On 18-07-13 14:07, Mark Brown wrote: > On Fri, Jul 13, 2018 at 02:56:24PM +0200, Marco Felsch wrote: > > > Currently _regulator_do_disable returns 0 if either the ena_pin nor the > > ops.disbale() isn't present. This assumes that the call was successful > > but it wasn't because disbaling isn't supported at all. > > > The last case of the if-chain should return -EINVAL, because disabling > > isn't supported by the driver as it is done already by > > _regulator_do_enable. > > This is fine - consumers shouldn't expect that a disable will cause > anything to actually get powered off, constraints or other consumers > might mean that the disable doesn't actually happen. It's just the same > as a consumer with an always on flag. Okay, I understand that the behaviour should be like the always-on contrain. But now the behaviour of the core is like my v1 of "Re-Enable support to disable switch regulators". It's like a 'simulated off', which wasn't a good solution for you. The difference is, that the 'simulated off' is now made in the core. Regards, Marco