From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD57EC433EF for ; Thu, 24 Mar 2022 09:40:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349305AbiCXJlb convert rfc822-to-8bit (ORCPT ); Thu, 24 Mar 2022 05:41:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349303AbiCXJlb (ORCPT ); Thu, 24 Mar 2022 05:41:31 -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 D9C5356408 for ; Thu, 24 Mar 2022 02:39:59 -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: devicetree@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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