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 339F7C43334 for ; Fri, 3 Jun 2022 12:39:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229883AbiFCMjq (ORCPT ); Fri, 3 Jun 2022 08:39:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244381AbiFCMjo (ORCPT ); Fri, 3 Jun 2022 08:39:44 -0400 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B88B3A712 for ; Fri, 3 Jun 2022 05:39:43 -0700 (PDT) Received: by mail-wr1-x42d.google.com with SMTP id q7so10257451wrg.5 for ; Fri, 03 Jun 2022 05:39:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:subject:from:to:cc:date:in-reply-to:references :content-transfer-encoding:user-agent:mime-version; bh=RG9EULX6AXWSuj88ad7zTUODZ3cXTtnOgya4os1rkQ4=; b=LdJyE7vorMelh+W1IGGKFj2M9ThM1A/OdqrbR9y7rm06xSdDUhA2o9HXKNgRC7YwLe C9EboN/EHYBXYrCNofFZG4ULlL35gbqAt+FlVKlo3cgOFyqG/8gTddVRQOrjvET6qDMN gOCKlbAQiP6JPlXyr1NWEkL91nWRigN13Hf4foDEfxGcrm/xDShuIkDW680S+LexuSgT 4DLICe9VfZJGGEISZ99Nt9pzZkRptX0+U2yLpJJme4w9ibxDmNoUM4AKZGl+dohPWrSS EuinpYorB0Atg/uL92yO8zD0a/y5foHwerrQf3566XIciBcYvk4F2uaru6I/tOhpGPwn SlOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:content-transfer-encoding:user-agent:mime-version; bh=RG9EULX6AXWSuj88ad7zTUODZ3cXTtnOgya4os1rkQ4=; b=2dNb+tq7tD4+6CJOGZBl1YM8OcQlS91CXjxq1ynAur+mB/YdP5MJP1fIX2mdPpjhYS kOETG7ueSaJBcMMHGbDoYs/egsBNssxpoDM9HKI347BW15JOv2+4vqJTlZemn7yK8NxI vAgFQqeh0ImfNLdbRRUAaq3RNljB7QRjoiCLyP9kCuBXtF8kb1u5CqkyzcCwxBw4REaT tVWVCzQolHpqLDO/y3D5TEkxlJATupro2dZk/UPT5CfmqaVNsJbvL8kHgr6dZ8Gn4KxA O616V+GQGZyTt+4cvSsthbcaD//0ey7RSScvw9rnb+H78DmBQDjU3dfZ1RtYvMMCq2Fe Xl+A== X-Gm-Message-State: AOAM5339axKS1vdaGm/A5n+8gCGVa1LYmtypV+igwPEPqW4kekufSB4P fiCk0Cho/x33No8teEb+oSk= X-Google-Smtp-Source: ABdhPJwu+B07nGtbx3J4+846qqmStUY4f3uFz3/LfO9ja+jhAS19kPSKRwPJHtqphxNr7BJsVvRVRQ== X-Received: by 2002:adf:f68f:0:b0:210:2ef7:e801 with SMTP id v15-20020adff68f000000b002102ef7e801mr8077150wrp.318.1654259982169; Fri, 03 Jun 2022 05:39:42 -0700 (PDT) Received: from p200300f6ef0219008f4342cbe8c8c65c.dip0.t-ipconnect.de (p200300f6ef0219008f4342cbe8c8c65c.dip0.t-ipconnect.de. [2003:f6:ef02:1900:8f43:42cb:e8c8:c65c]) by smtp.gmail.com with ESMTPSA id c186-20020a1c35c3000000b0039bc95cf4b2sm8415929wma.11.2022.06.03.05.39.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 05:39:41 -0700 (PDT) Message-ID: <572ffbcb2512d458c8e8de822336d45845545a98.camel@gmail.com> Subject: Re: [RFC PATCH 4/6] iio: inkern: split of_iio_channel_get_by_name() From: Nuno =?ISO-8859-1?Q?S=E1?= To: Andy Shevchenko , Nuno =?ISO-8859-1?Q?S=E1?= Cc: linux-iio , Matthias Brugger , Tomer Maimon , Fabrice Gasnier , Lorenzo Bianconi , Michael Hennerich , NXP Linux Team , Benson Leung , Lars-Peter Clausen , Pengutronix Kernel Team , Claudiu Beznea , Tali Perry , Alexandre Belloni , Nicolas Ferre , Sascha Hauer , Jonathan Cameron , Wan Jiabing , Linus Walleij , Alexandre Torgue , Dmitry Baryshkov , Gwendal Grignou , Amit Kucheria , Andy Gross , Bjorn Andersson , Cai Huoqing , Saravanan Sekar , Avi Fishman , Nancy Yuen , Guenter Roeck , Maxime Coquelin , Eugen Hristev , Lad Prabhakar , Olivier Moysan , Patrick Venture , Haibo Chen , Fabio Estevam , Benjamin Fair , Thara Gopinath , Paul Cercueil , Shawn Guo Date: Fri, 03 Jun 2022 14:40:34 +0200 In-Reply-To: References: <20220602140400.213449-1-nuno.sa@analog.com> <20220602140400.213449-5-nuno.sa@analog.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org On Fri, 2022-06-03 at 13:37 +0200, Andy Shevchenko wrote: > On Thu, Jun 2, 2022 at 4:04 PM Nuno S=C3=A1 wrote: > >=20 > > This change splits of_iio_channel_get_by_name() so that it > > decouples > > looking for channels in the current node from looking in it's > > parents > > nodes. This will be helpful when moving to fwnode properties where > > we > > need to release the handles when looking for channels in parent's > > nodes. >=20 > ... >=20 > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * For named iio channels, f= irst look up the name in the > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * "io-channel-names" proper= ty.=C2=A0 If it cannot be found, the > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * index will be an error co= de, and of_iio_channel_get() > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * will fail. > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */ > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (name) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 index =3D of_property_match_string(np, "io-channel- > > names", name); > > + > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 chan =3D of_iio_channel_get(np, i= ndex); > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (!IS_ERR(chan) || PTR_ERR(chan= ) =3D=3D -EPROBE_DEFER) { > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 *parent_lookup =3D false; > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } else if (name && index >=3D 0) = { >=20 > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0 pr_err("ERROR: could not get IIO channel > > %pOF:%s(%i)\n", > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 np, name ? name := "", index); >=20 > It's one TAB less now, means you may compress more on one line, > including replacing > name ? name : "" --> name ?: "" >=20 I can taking the 100col limit... AFAIR, Jonathan wants to stick to the old limit unless readability is severely impacted by it which I don't think it' the case here. That said, I'm more than fine in using the new limit as long as Jonathan agrees with it. >=20 - Nuno S=C3=A1