Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2818473imu; Sun, 23 Dec 2018 08:28:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN5zYEqAvNHGbvaTGxHSnK99TfHyFyN9WnsPKLJPoMXz2VUg/x0SABEeSmA0UI46AG1gdtrt X-Received: by 2002:a63:7154:: with SMTP id b20mr9563699pgn.342.1545582518376; Sun, 23 Dec 2018 08:28:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545582518; cv=none; d=google.com; s=arc-20160816; b=cXKsaoEQ+e1vEDAv+vZlgtdj9lwVArMlYHC8yK6ALU5p1mk34UEn/aoUp1A7SxcYrG MBbwlETm5TlckdxXSzf5IG5O5Di+visU630/t+olZBL7p/mZhk2vK5/8mrhWHod7cPZi zB4XEiRRoytE8Q6TkywgaPL8yUq9nhT64vmmIvmonMpwGEgra3RA7xdtHfmSYT4sKXLs Uh7VSl1TedEe89CSPcMdwavuPGQZ4wmxoBJC9mEaQV6xY0jw6Yk/zA2T2HbbhL5LXe8C KL6bemKZZxacbRuOxfkAQDBkJjB2K0V7kjpzG+KFp0llLvTH4x0n6yafSygNZDnpuyrT MSWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=/KO6Go5nwDVX+Tr2t3+2ME6iMcZZeBpoVPG5qLv7e44=; b=RCemI4eR0XtXBDuLtA6P59MRR7JEe6iac9Aqgb0jFnUPrDmg3tylfdmCnOchH19BPF 6BGiBlzGSWtgWZ9yyrhCsVchKZKAcbQuT5Q8imq7g3fkCXfXM3qLZZ5xGdgPCQbbimBB VCHaG7y6NUBPk4yhKIYQB7hcFyT6AD23KrzM4tsIrsKB8BLs/02pKMWG2n3B1OD15PWM 9xWtV60ekQuzWDjmfvLWs2Ovph5ltaqDjLLkDlRLv5O2yBhXosV8SrmfrL6R35LdlOaC decJsmMBu72ryAObr44yq4JZNKCTJFWe8PtqD4Ug7ls7YktNUEPF/WRjf00FfNaTxaex mDrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="IjnT/BUS"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bj2si24809014plb.27.2018.12.23.08.28.22; Sun, 23 Dec 2018 08:28:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="IjnT/BUS"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387659AbeLVSuL (ORCPT + 99 others); Sat, 22 Dec 2018 13:50:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:35164 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728086AbeLVSuL (ORCPT ); Sat, 22 Dec 2018 13:50:11 -0500 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5E6DE2196E; Sat, 22 Dec 2018 18:50:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1545504610; bh=EXOANm6tkF2VD+tusHpxMKU/XXyEeaq1YvVk9+PsR00=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=IjnT/BUShlBgikHhMQLg+sH3RlMO7frzPfTSNuVzGbVipnr7dpDk/V10vH0qch2PQ MOiDwz3V2GQRoVnvrsAiKuxC4hT4V+2wKxKtWg+qe+zWNE+FeizauxJAeD5jaxQurk yZz70wuj6FQKifDcloWEGLkGXzWmLz1lgO9n+Qhw= Received: by mail-wr1-f45.google.com with SMTP id t27so8307543wra.6; Sat, 22 Dec 2018 10:50:10 -0800 (PST) X-Gm-Message-State: AJcUukcfrR2bOjqBnQPQVJ1+s/juQ8fa8VnKUglGmH/Z3fNu+7A8Dk4F EP0AxltONd3InDV5c3jlMn0KtTOgiY0dWlTDxS8= X-Received: by 2002:a5d:66c1:: with SMTP id k1mr6691953wrw.132.1545504608825; Sat, 22 Dec 2018 10:50:08 -0800 (PST) MIME-Version: 1.0 References: <1545100282-15756-1-git-send-email-chuanjia.liu@mediatek.com> In-Reply-To: <1545100282-15756-1-git-send-email-chuanjia.liu@mediatek.com> From: Sean Wang Date: Sat, 22 Dec 2018 10:50:01 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] pinctrl:mediatek:add judgment conditions To: chuanjia.liu@mediatek.com Cc: Linus Walleij , Matthias Brugger , linux-mediatek@lists.infradead.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, zhiyong.tao@mediatek.com, eddie.huang@mediatek.com, hailong.fan@mediatek.com, youlin.pei@mediatek.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 17, 2018 at 6:32 PM wrote: > I thought the subject still is much general, it should be further improved with something like "add EINT support to virtual GPIOs" and should say more about what virtual GPIOs means by MTKers in the patch description because "virtual" is a usual term used throughout the kernel and that would easily cause others to fail to interpret correctly. > From: Chuanjia Liu > > This patch avoid return err when virtual gpio set SMT. > > Signed-off-by: Chuanjia Liu > --- > change note: > v2 : 1. delete virtual gpio number > 2. add judgment conditions > --- > drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c > index 4a9e0d4c2bbc..a576e417744a 100644 > --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c > +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common-v2.c > @@ -290,7 +290,11 @@ static int mtk_xt_set_gpio_as_eint(void *data, unsigned long eint_n) > return err; > > err = mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_SMT, MTK_ENABLE); > - if (err) > + > + /* SMT doesn't support virtual GPIO, add err != -ENOTSUPP is used for > + * avoid return err when virtual gpio set SMT. > + */ I'd prefer to the comments as the below /* SMT is supposed to be supported by every real GPIO and doesn't support virtual GPIOs, so the extra condition err != -ENOTSUPP is just for adding EINT support to these virtual GPIOs. It should add an extra flag in the pin descriptor when more pins with distinctive characteristic come out. */ > + if (err && err != -ENOTSUPP) > return err; > > return 0; > -- > 2.19.1 >