Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1125762imm; Wed, 13 Jun 2018 13:52:36 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJzWhEE4wlHQQsVUgP0+88g3wwccVY8ds7KxnI9PgAqk9WK727EiKWYeCgEOkyMOMpZ5mVL X-Received: by 2002:a65:5cc8:: with SMTP id b8-v6mr5355912pgt.85.1528923156195; Wed, 13 Jun 2018 13:52:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528923156; cv=none; d=google.com; s=arc-20160816; b=XdlD9B51liQsMjqtf7Wn6RoCZ9+hY3RybU/D+wbYnq67uQVI+kevbbDgMKtQbXmyMZ knBHMosbAxpKe81nbG70+O3/6N70c9XbAuVzeCgc1UQz22o+VHBTLhKeJ0TDYfTCUaD6 hzDTI0nzHJ36R+2wLmi7SgnIhbvnCDtcMNAcSTYSIopsthsI8u23owjzvatmk6g5UwsB nF3U+63xmBJtvd7ZmSKNXpvExaJcNk0jHndNWUIBXMQHdOzblYJSOqGoj0WkiIWuT2hs rx+adsbDDXDQnNfmCyH8eI3mWCXp5rDktRqXOOQ7qgFEA4r1atCC84TKCmU3/ZBaf3xX fmiQ== 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:dkim-signature:arc-authentication-results; bh=8CYv9KMoie8jU3ijgM3hXVF1Csgj6p1tBskcVLgQ6Fw=; b=xCusBme//nFeCT6w0EyjFdJgEOmMZc465hs4leg7EO/QIkneMj0Lzb6zg/M04h6rV3 zQrYCQmSkqSiQSbNj1rInydkYHrM2KZYtkwCicEMX92g54CFM5et1r2+qfDhPjrykxYy +7m4mXE1r/bZaNLiHVSPDaA4aLa8m7Lot3b5kXdUd1ACwhvn6ZEZs3eq4cpqqHLNv+qE Ptc6z35KjPJ3a3fUdkAgkxf66h9Zv/QANRJ5e0Mcu7tyaZOazMqIiBB0y8CqPsrRLZti 1cWJ43WCJRyAjQ6O8EWPTfcR/XSDoz8YGoNOwtAFWRLmqO4bzMfjXH28nnVpx5aVmVZ7 1AGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=arh60sRR; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1-v6si3631508plo.516.2018.06.13.13.52.21; Wed, 13 Jun 2018 13:52:36 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=arh60sRR; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935786AbeFMUvw (ORCPT + 99 others); Wed, 13 Jun 2018 16:51:52 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:40687 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935761AbeFMUvt (ORCPT ); Wed, 13 Jun 2018 16:51:49 -0400 Received: by mail-pg0-f67.google.com with SMTP id l2-v6so1834208pgc.7; Wed, 13 Jun 2018 13:51:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=8CYv9KMoie8jU3ijgM3hXVF1Csgj6p1tBskcVLgQ6Fw=; b=arh60sRRJnOiEFko6UvzTMCXFNV2OeLy3B/8zwuowGTJw1TH03tppVKmkBblsWYe69 +RPIjcb5o9aIhkJuv+DrhkplCZ/CzA+BNDwEk1XCJ+A1i/Gxp599aCQtoi+XQPsO18tN N+LgQvA5Zt49MmTs1iKno4tvygEFA5IRcl7EYwamshYeE9r/04MqZeVsHyxDraIUL3FD 4SYnV82TwD+ifbQraBksRPvjb5OUiJyGLvyHU8g7f2YHIgc/5tmUBXbJytHD0HB1fSn0 yurwZHTtY79BTe2Avv4OZPFfy0VjAxpQq56KyT57WtUBmMku/QOvGyegXP4b0S0jmVBs JoWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=8CYv9KMoie8jU3ijgM3hXVF1Csgj6p1tBskcVLgQ6Fw=; b=KpV68rqCPeBtVcKrON8+GXiyXtSyIQxI8DM5sIKBfNHgubdRRxJygmOg3SqZRWJNcy l9/aOCmiGCcuYfNU48I6Z7BRI/r1vC9U7G7ROsfiafcwe8OD88Tg8hc9uZjw/sB45yxb LpQ/cASnkpVF+Az6QC0Aa0FH0kDL11gzRShMvXcDs3d3NPHbqh6DJ5B3Djh+62xsDlVb IV3kd0qnaNeL6nHz7rR24XEl7Q5XCnnE8p1t4S1VWCLa64gxgfatPcsgG0SEdmVUtdZ7 z+c3rm4tgr5BMHfYQsFHoSFvPGxyBVvSjhLU0q3QHYUuPssY+r+K4gSph0e0zavYujn5 n/eA== X-Gm-Message-State: APt69E3WEzrlSzxuMB/8KGFlS19/ax+XsOhKYz5i2q8jcq50WevZ4sql tVh00Rz03IIa+YWPSU83Vak= X-Received: by 2002:a63:6185:: with SMTP id v127-v6mr5203936pgb.301.1528923108422; Wed, 13 Jun 2018 13:51:48 -0700 (PDT) Received: from dtor-ws ([2620:0:1000:1511:8de6:27a8:ed13:2ef5]) by smtp.gmail.com with ESMTPSA id s134-v6sm4741030pgc.30.2018.06.13.13.51.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Jun 2018 13:51:47 -0700 (PDT) Date: Wed, 13 Jun 2018 13:51:44 -0700 From: Dmitry Torokhov To: Janusz Krzysztofik Cc: Tony Lindgren , Aaro Koskinen , "David S . Miller" , Mauro Carvalho Chehab , Greg Kroah-Hartman , Andrew Morton , Randy Dunlap , Liam Girdwood , Mark Brown , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org, linux-omap@vger.kernel.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 04/10] Input: ams_delta_serio: Replace power GPIO with regulator Message-ID: <20180613205144.GB62746@dtor-ws> References: <20180609140224.32606-1-jmkrzyszt@gmail.com> <20180609140224.32606-4-jmkrzyszt@gmail.com> <20180612221724.GB38773@dtor-ws> <2655614.ErW8VuCT6r@z50> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2655614.ErW8VuCT6r@z50> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 13, 2018 at 03:01:05AM +0200, Janusz Krzysztofik wrote: > On Wednesday, June 13, 2018 12:17:24 AM CEST Dmitry Torokhov wrote: > > On Sat, Jun 09, 2018 at 04:02:18PM +0200, Janusz Krzysztofik wrote: > > > ... > > > + priv->vcc = devm_regulator_get(&pdev->dev, "vcc"); > > > + if (IS_ERR(priv->vcc)) { > > > + err = PTR_ERR(priv->vcc); > > > + dev_err(&pdev->dev, "regulator request failed (%d)\n", err); > > > + /* Fail softly if the regulator is not available yet */ > > > + if (err == -ENODEV) > > > + err = -EPROBE_DEFER; > > > > Hmm, if regulator is not ready yet, devm_regulator_get() should be > > returning -EPROBE_DEFER already, we should not have to convert -ENODEV > > to -EPROBE_DEFER... > > Regulator is not ready because its initialization at subsys_initcall is > deferred by not ready GPIO pin, that in turn is caused by gpio-mmio driver, > unlike many other GPIO drivers, registered as late as at device_initcall. > > I agree devm_regulator_get() could return -EPROBE_DEFER in this case, but I > can see it does that only when of_get_regulator() indicates the regulator > should exist. In non-dt case there is apparently no way to justify if it > should unless its consumer supply table was already in place. For that, > registration of that table would have to be independent of successful > registration of the regulator itself while it's not. Maybe it should, but > that's a separate topic for a separate discussion, I think. > > > Is it because we have_full_constraints() returns false? You might need > > to add call to regulator_has_full_constraints() to your board file. > > If have_full_constraints() returned true before the regulator or its consumer > supply table is ready, devm_regulator_get() would happily return a dummy > regulator and our keyboard would never get its power. > > I'm afraid we have to live with that return code conversion as long as the > only user of this driver is not migrated to dt. OK, fair enough. Can you please add a comment to that effect? Thanks. -- Dmitry