Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753045AbdFMKY4 (ORCPT ); Tue, 13 Jun 2017 06:24:56 -0400 Received: from mail-qt0-f179.google.com ([209.85.216.179]:34208 "EHLO mail-qt0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752083AbdFMKYy (ORCPT ); Tue, 13 Jun 2017 06:24:54 -0400 MIME-Version: 1.0 In-Reply-To: <1497319166-17287-3-git-send-email-peter.chen@nxp.com> References: <1497319166-17287-1-git-send-email-peter.chen@nxp.com> <1497319166-17287-3-git-send-email-peter.chen@nxp.com> From: Ulf Hansson Date: Tue, 13 Jun 2017 12:24:42 +0200 Message-ID: Subject: Re: [PATCH v15 2/7] power: add power sequence library To: Peter Chen Cc: Greg Kroah-Hartman , Alan Stern , Mark Brown , Sebastian Reichel , Rob Herring , Shawn Guo , "Rafael J. Wysocki" , Dmitry Eremin-Solenikov , Heiko Stuebner , "linux-arm-kernel@lists.infradead.org" , Philipp Zabel , "devicetree@vger.kernel.org" , Pawel Moll , Mark Rutland , Linux USB List , Arnd Bergmann , Sascha Hauer , "Maciej S. Szmigiero" , troy.kisky@boundarydevices.com, Fabio Estevam , oscar@naiandei.net, Stephen Boyd , "linux-pm@vger.kernel.org" , Joshua Clayton , "linux-kernel@vger.kernel.org" , mka@chromium.org, Vaibhav Hiremath , Gary Bisson , hverkuil@xs4all.nl, Krzysztof Kozlowski , frank.li@nxp.com, jun.li@nxp.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1081 Lines: 40 [...] > + > +/** > + * of_pwrseq_on - Carry out power sequence on for device node > + * > + * @np: the device node would like to power on > + * > + * Carry out a single device power on. If multiple devices > + * need to be handled, use of_pwrseq_on_list() instead. > + * > + * Return a pointer to the power sequence instance on success, > + * or an error code otherwise. > + */ > +struct pwrseq *of_pwrseq_on(struct device_node *np) > +{ > + struct pwrseq *pwrseq; > + int ret; > + > + pwrseq = pwrseq_find_available_instance(np); > + if (!pwrseq) > + return ERR_PTR(-ENOENT); In case the pwrseq instance hasn't been registered yet, then there is no way to deal with -EPROBE_DEFER properly here. I haven't been following the discussions in-depth during all iterations, so perhaps you have already discussed why doing it like this. Anyway, that means all pwrseq instances needs to be registered an early boot level, to be safe. To me, that seems like poor design choice. [...] Otherwise I think this looks okay to me. Kind regards Uffe