Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2139131pxb; Fri, 25 Mar 2022 11:47:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/h8Oz2Z2TLrGDg83PjdFwKXEQKqKGEHA+uVKPvqjDi9iHB1DaoMaxzGzyXKM7NLRT+Tb9 X-Received: by 2002:a63:2022:0:b0:349:beed:bfd8 with SMTP id g34-20020a632022000000b00349beedbfd8mr726877pgg.175.1648234037263; Fri, 25 Mar 2022 11:47:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648234037; cv=none; d=google.com; s=arc-20160816; b=MzHl1njWCuZ8dVN87+YaQGwAY05mUQ+4QBkeffD6XaIDgHmclsD68WRjJa9dIDkoWv /6qg/8hoADRNf4uxFomZdPLlEK74FDFmMnmi5rB1UEUrmUpjn7KD35BFaoYl47XVLDKV UN+jNqSBSRxHua7g1vCpf2mewboQItpG7JVgfFGAgUoofK0KsV5r9cOZgS9q+ZUtAElJ 5071iT+QkTAFIunrGdop55RRWP7JHsMFdbQm9chR0P75XQ3wQky+4PhpWOBjqVVpQ6mi DPzA0wBUPUJ7nEt1SUplCpHCVI+ejUQtySUEWp6KLtoKD7PJt4VbouEC0X+lcOicj3+R oSCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=ZTmHg2OO0sch7v8ozuDoQqnOloJi/VzR7mgoa68h9mA=; b=YcFJG1O1MTpTJIfcZRdAa/jQ+sFUt8ppKJbnMmlt3aQun1Zj8cRUjLTZ+IneMmmFJO hhf0znIS9TChiOMMnGVDXcpNkGJ87EdfyXZurlE8knM1ksGBuTdYa8lUc08k8ANXfnz0 hbqHWFOuy1UxkPxbsg4V8daYTZgLrGnZTDFfyxG+8mfcube0haic+yyi1X+r8K2qG6Sp N91NV8q7nCw7WbwuzvWE8amvyXatOb0lBx/4V53d2uK8X5LAsaMlujMx7TS+lrYlJDUw zS4TmbP3gpYPW+zbFBxLdgaYrr77m2MsYPjPTnWrbcabMZ5IWouFN3QT8SOJqBs1HX70 /xJA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id w31-20020a17090a6ba200b001c718f093c8si6397156pjj.123.2022.03.25.11.47.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 11:47:17 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6E7261C4B35; Fri, 25 Mar 2022 11:05:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349297AbiCXJl3 convert rfc822-to-8bit (ORCPT + 99 others); Thu, 24 Mar 2022 05:41:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235708AbiCXJl2 (ORCPT ); Thu, 24 Mar 2022 05:41:28 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FD765520C for ; Thu, 24 Mar 2022 02:39:57 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXJwa-0005UZ-UH; Thu, 24 Mar 2022 10:39:48 +0100 Received: from [2a0a:edc0:0:900:1d::4e] (helo=lupine) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1nXJwX-002fNY-31; Thu, 24 Mar 2022 10:39:47 +0100 Received: from pza by lupine with local (Exim 4.94.2) (envelope-from ) id 1nXJwZ-00038f-6M; Thu, 24 Mar 2022 10:39:47 +0100 Message-ID: <3cfc4346d314dbb297841a9caf4e68661013016c.camel@pengutronix.de> Subject: Re: [PATCH 2/2] reset: add support for fwnode From: Philipp Zabel To: =?ISO-8859-1?Q?Cl=E9ment_L=E9ger?= Cc: Rob Herring , Frank Rowand , Thomas Petazzoni , Alexandre Belloni , Allan Nielsen , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Date: Thu, 24 Mar 2022 10:39:47 +0100 In-Reply-To: <20220324101929.00f51f01@fixe.home> References: <20220323095022.453708-1-clement.leger@bootlin.com> <20220323095022.453708-3-clement.leger@bootlin.com> <20220323172121.220a26e9@fixe.home> <20220324101929.00f51f01@fixe.home> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: p.zabel@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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Clément, On Do, 2022-03-24 at 10:19 +0100, Clément Léger wrote: > Le Wed, 23 Mar 2022 17:21:21 +0100, > Clément Léger a écrit : > > > > >         if (id) { > > > > -               index = of_property_match_string(node, > > > > -                                                "reset-names", > > > > id); > > > > +               index = fwnode_property_match_string(fwnode, > > > > "reset-names", id); > > > >                 if (index == -EILSEQ) > > > >                         return ERR_PTR(index);    > > > > > > I don't think this is good enough any more. At least -ENOMEM is added > > > as a possible error return code by this change.  > > > > Yes indeed, errors are clearly not correctly handled anymore. At least > > -EILSEQ won't be triggered. > > > > > By the way, even after looking at this more carefully, I'm not sure to > understand why there is a special handling for -EILSEQ ? From what I > understand, EILSEQ is returned in case the device tree is malformed > (string longer than returned property length) but why is it handled > differently in this case ? of_property_match_string() can return four error codes: -EINVAL (no reset-names property in node) -EILSEQ (real error) -ENODATA (id is not found in reset-names) -ENOSYS (CONFIG_OF is not set) -EINVAL, -ENODATA and -ENOSYS map to -ENOENT (no reset control corresponding to id found), or no error if it is optional. regards Philipp