Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp198982pxj; Thu, 17 Jun 2021 00:19:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxxsIDMAA1Jee41MDecJO8JE+SZkRwMh7GsoZ2EEW2rVDuWyN1hq1/JFwqqB/wZqwcavWQ X-Received: by 2002:a02:8816:: with SMTP id r22mr3219577jai.135.1623914375326; Thu, 17 Jun 2021 00:19:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623914375; cv=none; d=google.com; s=arc-20160816; b=IJBmXsQw3za5mCWRHqud/J49AP1VroZ+ldQeaGpwGzFhQBgPr4qSrYIZ7gfCeF4ebz kAL7JHu8ydJTbz70QRBRCA2E+m9kHVc6zWrhHTJYZgFfy1/C2BjNnSzpAYpZizo4l8sl VmAScOj5F/V5LLMfmu0YCl5sSWNLLr2lAmb4ylqtXNVvEwVozMyIGqhb5wqF7ZqHP10Z 29ZxQRBduJ/EaFhp2Y31UFgexxw+8WYCOcdouqHvkZ5N/BxGHCEZNF8xpQ4yuProFYpK +tCbNYnFjJmkUsigTPprtLpvxmms/27YeQeJ33o6Ro/7L92qY+QhzWInjgJ2V7lueWZH +e5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=urMPTkRkijNnq1YTyn7+SteYdXmaIXj2TQZnikbLXEs=; b=CVkLutn6k3iA12X7n6JKpwM9S5zXOS+740CuvbaMOTZGE+N5ie22n1Bj3s/c1ok5F8 MNNfZ69FOxpmELv0htNzJirqDjPmlLl4mHp2Ols/zDYnZATMmFNd3xNPDqICevCtTmAW rPK2MneVv8LU6cGkTaZ5xIsbDk7+wTJY/FftmLS3BpHGKeQXcNZafp/ESWlErirAOiRp WcqyBeoXCtFOkd3J1sLTKGDZfR/aNwiT93dF2lHIakJH70d0t/MHuzRV2nr3Yhxc9Bq0 gnFdfZ+KaRzb8QQmRdUlWnYVyUyV+jklUrUGsi68hBPcxZI/dR4tRZVBfunRxgxYLAK3 gOrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QqObbYwh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t22si5158281ioh.104.2021.06.17.00.19.23; Thu, 17 Jun 2021 00:19:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=QqObbYwh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230082AbhFQHU6 (ORCPT + 99 others); Thu, 17 Jun 2021 03:20:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229673AbhFQHU5 (ORCPT ); Thu, 17 Jun 2021 03:20:57 -0400 Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 323FBC06175F; Thu, 17 Jun 2021 00:18:50 -0700 (PDT) Received: by mail-pg1-x535.google.com with SMTP id e22so4193699pgv.10; Thu, 17 Jun 2021 00:18:50 -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=urMPTkRkijNnq1YTyn7+SteYdXmaIXj2TQZnikbLXEs=; b=QqObbYwhOZtqYEGImDxe+JckngZqWKDW5ifZeQZHpAT2cUvDYK9vPjzhVmpB/kqK52 2X3S9uCa7ue7j8/8gfXNgSPHy1sxELuEscsFso3LNqZzVFY0+NDKXrrHjOSxMf+r2exn QbJNxB60BtXOkBCpuHrrI8uct9Dllx7DkRCqcMBPaKaCp35J67z/suX2RPxAK2gJh756 GWaULDDll06gMPHK98NYmCIyZoveoTay00oiUrhIoASXFYKPNWcOF2ULvow+OO+c+Uki yaNCUAPaNywRt4FccsYisu7PauB8M2yLH1c1bIeeLIsUODO13oioO66Gvc02yJA6WWVp 3kBQ== 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=urMPTkRkijNnq1YTyn7+SteYdXmaIXj2TQZnikbLXEs=; b=LCCdy+qyzYQmp8Bx262P7IfjfsbzWi+b/7+FWazlgeE0g57UXCuwiPXQVixCJyH5/F t78h3fO40FvijMNx29IJfX1aVDSenARCFQwVJ7S4fRjtJZljlj6aKFTfK7JQrVq/TPth JIIn3iQSRbEsXOZiidXPZF+QeDTZZvzZx7Gl5ZVZseZvrljJz0uXdE7GA3nkPDtS6rrd sP259EiAFllpgFknk/OhBjSeV3tgsJcenfZ65qzmaVGeVHejbp044AHxz2Vaip18G0Gh tWQj8sFWCm3bvgRlutPBaYox6Qy/m6d4eyuEl/bIIKY5IwlVz1X5NoQX/p/yG8Aqlal5 t0hw== X-Gm-Message-State: AOAM531693jck7bzN7EDgAqQPmdQc05urFl/hI454B39uCK6WtqSyeha kX+POVubucBDs8cB5pu1E0U4PsRr0kpViD28IWw= X-Received: by 2002:a63:b00d:: with SMTP id h13mr3732496pgf.74.1623914329647; Thu, 17 Jun 2021 00:18:49 -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: Thu, 17 Jun 2021 10:18:33 +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" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 17, 2021 at 9:37 AM Sai Krishna Potthuri wrote: > Ping! Do not top-post. Do not ping for the sake of pings. > > From: Sai Krishna Potthuri > > Sent: Tuesday, May 11, 2021 6:08 PM > > > From: Sai Krishna Potthuri > > > Sent: Wednesday, April 28, 2021 11:04 AM > > > > From: Andy Shevchenko > > > > Sent: Monday, April 26, 2021 7:35 PM ... > > > > > > > + 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. > > > Here we are checking for valid argument and not the return value of the > > API. > > > If the read value(argument) is not valid and return value of the API > > > is zero (SUCCESS) then framework expects driver to be returned with > > > '-EINVAL' and it is a legal error code in this case. > > Do you agree on this? > > I am ready with the other changes, will send out the patch to address your > > comments. If you are ready, drop a new version (note, ~1w is a good time to send a new version if no one answered the doubts in your previous one, which means "silent agreement"). -- With Best Regards, Andy Shevchenko