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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F407C433E9 for ; Wed, 10 Mar 2021 11:26:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D325664FD7 for ; Wed, 10 Mar 2021 11:26:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232611AbhCJLYr (ORCPT ); Wed, 10 Mar 2021 06:24:47 -0500 Received: from mx1.opensynergy.com ([217.66.60.4]:61541 "EHLO mx1.opensynergy.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231203AbhCJLYR (ORCPT ); Wed, 10 Mar 2021 06:24:17 -0500 X-Greylist: delayed 494 seconds by postgrey-1.27 at vger.kernel.org; Wed, 10 Mar 2021 06:24:16 EST Received: from SR-MAILGATE-02.opensynergy.com (localhost.localdomain [127.0.0.1]) by mx1.opensynergy.com (Proxmox) with ESMTP id 91C4DA1820; Wed, 10 Mar 2021 12:16:01 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=opensynergy.com; h=cc:cc:content-transfer-encoding:content-type:content-type :date:from:from:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=srmailgate02; bh=upyph0mD533C Y6YiXd33LgOwWoBbDT7ww7/3l9ldIhw=; b=x6trUXuix8nRLTknbDNPF3W/LMep gCDJf98BJpEqs9OFdJlwaFV+bSgWizAAQMeazcNTEeV9I4srSzxXvp2czrBegjgX ezUD5iP61WhOu7pfD98sMW4ulQjEI1XGZZ1iHLpDPDyHBI5bta4vpwJXyEd7B08z 982T+XILi7A5YN7iALhBhF9/rI2CNnC25P1nMNULqeb2Xk+eSAMgRDjEoOpMBLTJ YRu3r3CdFBbeDW1pl34z0U10PRCPVTEQjDQZWmOzZyWWxbI+eFWrmVtOsXkTGhPe e/eFNPTiBvwmT998KWWr2R2t5slRuDLy5A9i3SwyLzhmh17+bsVuITcAjA== To: Jyoti Bhayana , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Mauro Carvalho Chehab , "David S. Miller" , Rob Herring , Lukas Bulwahn CC: , , , , , , , , , kernel test robot , Jonathan Cameron References: <20210309231259.78050-1-jbhayana@google.com> <20210309231259.78050-2-jbhayana@google.com> From: Peter Hilber Subject: Re: [PATCH v7 1/1] iio/scmi: Adding support for IIO SCMI Based Sensors Message-ID: <0b9483ca-6f61-cc13-34e6-7f8c31c4c626@opensynergy.com> Date: Wed, 10 Mar 2021 12:15:58 +0100 MIME-Version: 1.0 In-Reply-To: <20210309231259.78050-2-jbhayana@google.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SR-MAIL-01.open-synergy.com (10.26.10.21) To SR-MAIL-02.open-synergy.com (10.26.10.22) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10.03.21 00:12, Jyoti Bhayana wrote: > This change provides ARM SCMI Protocol based IIO device. > This driver provides support for Accelerometer and Gyroscope using > SCMI Sensor Protocol extensions added in the SCMIv3.0 ARM specification > [snip] > + > +static int scmi_iio_get_chan_modifier(const char *name, > + enum iio_modifier *modifier) > +{ > + char *pch, mod; > + > + if (!name) > + return -EINVAL; > + > + pch = strrchr(name, '_'); > + if (!pch) > + return -EINVAL; > + > + mod = *(pch + 1); > + switch (mod) { > + case 'X': > + *modifier = IIO_MOD_X; > + return 0; > + case 'Y': > + *modifier = IIO_MOD_Y; > + return 0; > + case 'Z': > + *modifier = IIO_MOD_Z; > + return 0; > + default: > + return -EINVAL; > + } > +} > + Hi Jyoti, could you still change the above code to also accept lower case 'x', 'y', 'z'? Supporting lower case as well would establish compatibility with the lower case naming conventions used for IIO channels. By this change, channels could be forwarded without name changes (as long as they fit into the name field). I'm sorry to notice this only now. Best regards, Peter