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=-0.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 8FA5CC433B4 for ; Mon, 26 Apr 2021 14:06:48 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E0DEE61029 for ; Mon, 26 Apr 2021 14:06:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E0DEE61029 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0YNsktfQeACz1fhCyRwbfOiK/ohj+qousVVODbVee/k=; b=PVLS1p/4+hUBmLflO/YOtmFnD 3A8Z3IfJvAWj7s41imzFhi0u9SJ15/qQhEvLlkRzXZGnxzUOw86v/6qSryCPsKlzzedMWiNZjUATd Fp47R+T2Qez208BqlLqEq6/aCXS+uVCnN40b35jJyyL005Sg9eQ6UBU8CJXCdZgizt8+VkwFPKNAM wCy7Pw3VLBz+yCq0J/3la8XxTjH7pP8qIr2TGoTeOnMN+XjUhnomW2oT7uV+mjYqzCpw6Zwylstl/ qYqt/f1cdFpBc8BS4dKCdMkyJazq17V1a26PBWBGIu51lhUprrB5B4D0kJw4E4uZNO8DXC+tC17jO 6fSWBR0XA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lb1rI-007ml0-Cf; Mon, 26 Apr 2021 14:05:08 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lb1rF-007mkh-0t for linux-arm-kernel@desiato.infradead.org; Mon, 26 Apr 2021 14:05:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=diIQNj+fq7cLP/VfK5jIgYyt6WpLRDuOebeyCDenI/4=; b=3WL1Kvsj0aNtF6axCamYjAZ53p MJgs09ZGjNp9J/asHUMR4QTJOpbligFGr8RgEKEldV6GOPxRwdblrH23bSQW/e6PBc9uAsNNkDHIV ElcK4GUEN1BJVmZQ+O/d8IDY7symLZVvZLU3yLh7r0w+D1Y8sVyq1aUrHjlita8Xn3w5kewWovM9v JFAzujNjJdRpvzF1KwiWloKfqGu4wihd486qHI0QXn2i2F+tA4xpx4Yo8z/iY0hVSp1EqIohe5nYQ qmSjl+b+Ct5CdPKgVqe3Z+NSknSsE5Y97tkpGhHOtwDrGF4eRjZo43VG4z0xvS/DU64wziOtzlblZ B5cSIrmg==; Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lb1rB-00G03i-Iv for linux-arm-kernel@lists.infradead.org; Mon, 26 Apr 2021 14:05:03 +0000 Received: by mail-pg1-x52c.google.com with SMTP id j7so30698774pgi.3 for ; Mon, 26 Apr 2021 07:05:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=diIQNj+fq7cLP/VfK5jIgYyt6WpLRDuOebeyCDenI/4=; b=j4D+l4O368V00hvwUHS/SV9UgjCy/89yTiaGqTMxlvnq4FbiOW2JjtBj8ZXjfPrTOc a8fvCzu4eoP39BwrscaLwhnu8QZqLLcaCgNo4iOAapzbCdsgmYRmcaBQNxcd3AoqkUYB ASD5FxspAH89tKDXM05E5tHT6cr6ivXYtR9lI5ayBKNKt+puF2081DHG/PM3LKLe5vzd LGAa8bf7ofvszcUMmLB+yGjov8wMVWjFgExDKQuU8z0jFri6xDXZVq9bW4RcGmEAx8uH ta4ygoLjlD+2HpgA2NO3RIfWlgau2JG0hL8gIXPrYjL4fy74Ng1THS70mbtLFYNVpwXZ FScw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=diIQNj+fq7cLP/VfK5jIgYyt6WpLRDuOebeyCDenI/4=; b=grazjSSA5i24skpHWC1cUv5C+UtGcPB3BJIxbFc+DugvlDuYjcXRrPNvipieWiwRAy HS+Kr2/+Fq43XvyYFgYqIO1IIU79H0bnnzU8mKUlqwqnYHfwWWVhNl8/mtpdSu/p8ZzW Y++xi0uWLZ3OqBD/NrhkXKXc6ZGZEjH55kAixwHJHUCR1HHX5Wu7E/fW3lANI+vciA/a vBg8kwfKn4lPSlEcVc1labSt2SzTVa1Ohfeu9POUOnZ9vfUrheDy05CblfeJ6Ci71y1w VqBG15gU2cUBmuGQ62iUdx0+rpNh8Ki+IJ1J0+zCaKsJlZDET9+P0GBINaD8pMejVcWK rPdQ== X-Gm-Message-State: AOAM533Yj86lQYOj0jxAgTWfz9sN9fCMhOozkPgCiZzMlqpX2kAAwZRc N/EEqwyPDqRknJUAEyZvIYDBEg75jqrPbOQRYIs= X-Google-Smtp-Source: ABdhPJxgrQtMKpD4UrsflSNc2WpMuQpgSZBw6j3yc6QFCtWuFYbpSjUJdmOdKxSiY0QC0WVmrYu2AdRC+7PIf6KDJpQ= X-Received: by 2002:a65:5a4d:: with SMTP id z13mr17064008pgs.4.1619445899049; Mon, 26 Apr 2021 07:04:59 -0700 (PDT) MIME-Version: 1.0 References: <1619080202-31924-1-git-send-email-lakshmi.sai.krishna.potthuri@xilinx.com> <1619080202-31924-4-git-send-email-lakshmi.sai.krishna.potthuri@xilinx.com> In-Reply-To: From: Andy Shevchenko Date: Mon, 26 Apr 2021 17:04:42 +0300 Message-ID: Subject: Re: [PATCH v6 3/3] pinctrl: Add Xilinx ZynqMP pinctrl driver support To: Sai Krishna Potthuri Cc: Linus Walleij , Rob Herring , Michal Simek , Greg Kroah-Hartman , linux-arm Mailing List , Linux Kernel Mailing List , devicetree , "open list:GPIO SUBSYSTEM" , git , "saikrishna12468@gmail.com" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210426_070501_648910_770E2D51 X-CRM114-Status: GOOD ( 34.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Apr 26, 2021 at 4:20 PM Sai Krishna Potthuri wrote: > > From: Andy Shevchenko > > Sent: Friday, April 23, 2021 9:24 PM > > On Thu, Apr 22, 2021 at 11:31 AM Sai Krishna Potthuri > > wrote: ... > > > +config PINCTRL_ZYNQMP > > > + tristate "Pinctrl driver for Xilinx ZynqMP" > > > + depends on ZYNQMP_FIRMWARE > > > + select PINMUX > > > + select GENERIC_PINCONF > > > + default ZYNQMP_FIRMWARE > > > + help > > > + This selects the pinctrl driver for Xilinx ZynqMP platform. > > > + This driver will query the pin information from the firmware > > > + and allow configuring the pins. > > > + Configuration can include the mux function to select on those > > > + pin(s)/group(s), and various pin configuration parameters > > > + such as pull-up, slew rate, etc. > > > > Missed module name. > Is this (module name) a configuration option in Kconfig? It's a text in a free form that sheds light on how the module will be named in case the user will choose "m". ... > > > + * Copyright (C) 2020 Xilinx, Inc. > > > > 2021? > Couple of versions for this patch series sent in 2020, hence maintaining > the same. > Is it like we maintain the year when this patch series is applied, which is > 2021? 2020, 2021 sounds okay as well. ... > > > + if (pin >= zynqmp_desc.npins) > > > + return -EOPNOTSUPP; > > > > Is it possible? > This is a safe check. I.o.w. dead code, right? > Pin information will get from dt files/Xilinx firmware (query pin information > for a group)/user application and there are chances of getting wrong pin. I'm not sure I understand this. How comes that pin control core will ask for a pin higher than npins? ... > > > + ret = zynqmp_pm_pinctrl_get_config(pin, param, &arg); > > > + if (arg != PM_PINCTRL_BIAS_PULL_UP) > > > + return -EINVAL; > > > > Error code being shadowed. Instead check it here properly. > Are you mentioning the case where ret is also a non-zero? > If yes, then I will update this check to > if (!ret && arg != PM_PINCTRL_BIAS_PULL_UP) > return -EINVAL; No, this is wrong in the same way. > ret non-zero case, we are handling at the end of switch case. I meant that you need to pass the real return code to the (upper) caller. Ditto for all other cases (mentioned and not mentioned) ... > > > + ret = -EOPNOTSUPP; > > > > Isn't it ENOTSUP for all cases here? > Giving 'Operation Not Supported (EOPNOTSUPP)' error, when > driver gets a request for unsupported pin or configuration. > Can you please elaborate your question if I didn't answer properly. The pin control subsystem along with the GPIO library are using -ENOTSUPP error code for internal operations. EOPNOTSUPP is the one that should be returned to user space. Is it the case here? ... > > > +}; > > > > > + > > > > Ditto. > I see some drivers are maintaining the extra line in above two cases. > We shouldn't maintain extra line after struct declaration? What's the point to add more blank lines where they won't add any value? > > > +module_platform_driver(zynqmp_pinctrl_driver); -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel