Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4801872ybv; Mon, 17 Feb 2020 06:16:13 -0800 (PST) X-Google-Smtp-Source: APXvYqxhBKPoVbSMVhLlzP9xykYMPAxx24s+GD1fM13pLwLeJ6UzBXGDgFHDGvbnloH5CwjiFk6N X-Received: by 2002:aca:5083:: with SMTP id e125mr10211457oib.96.1581948973071; Mon, 17 Feb 2020 06:16:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581948973; cv=none; d=google.com; s=arc-20160816; b=JfTkAllwWHV0xkTlN6BlPq+Eu6iGiAjvJNJoIhXeSoo++2sDHkAlp21ehFRx5csvIe I/BhcCp6LDL9cKHncVCILQo/vK3z0G+QCnD/SC5RyEnpZF5VLckObQbVafw2h4g+TuXI 8F3Qjv01x6MgbwxZG9fxvmtfB/ZKJysSRzSgX2Xuchdv3ZaHnK2t6oIbau4sQan/1ivs HTeLGrvGN3mNCD1Skjvu4UrdVpuGWZOW5zsiyuN6CjY1uhwp+yz3gLms9gF8tePJuX1X bUWZe7viMtmzPT+L4FZ5nnfsh/KDaI6oy/t1klKb3yaYXVqvdvYskahA0UxSAmEQjUmv NjUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=gtMTPVIhIXUeH0xdkSwv3qku1/SwM+IetmGopOl+iV8=; b=E+mxVs6F8ZPbU/lZSs8gmjXDqEysKu72ZFoREf8AaJPQdm1QW8iqiz6yZfT3P1EdSN sgIin0tyXmpdu2BXo3/tMGt1peaoHz5DPStVxtFnJE6g0wtohskf2MkFuS9PDSaAHm8v cV95h9UpfCzxnXmuurK22mwJW9Xz2+kG9Sz6k/PekOetxSvBuZ/YS2dT+ZfIAPEM+mR9 3cdR4EA4Dw+674//J4+m/zY64qSO1KDvR2G5i1iqQF5T1mG62uLVl0Rygvv8IRnj4uap KBrsqqVM3QW+vNzjP1Ud0BOMOXXNW9RkfqeGQHqeqqPvlkCZrY8Jm9flgcg+krUV24oA zvBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@goldelico.com header.s=strato-dkim-0002 header.b=l9FBQzos; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x2si265136otk.29.2020.02.17.06.15.59; Mon, 17 Feb 2020 06:16:12 -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=fail header.i=@goldelico.com header.s=strato-dkim-0002 header.b=l9FBQzos; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728531AbgBQN6V (ORCPT + 99 others); Mon, 17 Feb 2020 08:58:21 -0500 Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.53]:12455 "EHLO mo4-p01-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726528AbgBQN6U (ORCPT ); Mon, 17 Feb 2020 08:58:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1581947898; s=strato-dkim-0002; d=goldelico.com; h=To:References:Message-Id:Cc:Date:In-Reply-To:From:Subject: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=gtMTPVIhIXUeH0xdkSwv3qku1/SwM+IetmGopOl+iV8=; b=l9FBQzosiiQ2IMm95p+UXyhqg17xAjy7up+qcJswNgEi/w4wH1/b20lBkq3beQPOnQ +aqnv8weFB2Q4DISUYCBehYkIhiqj0ZuyiDLsmDACcEZOedw+4BvabVFf2ObfVJPvkM1 O8XEv1Xnc6PjlWrH3vMJztLzu2AuReydamCF5mXnQGjCSpIOXPnUsep4Gq/8XFcfN/ye uGqpYI1QQAP7L9oFd58KZTBME28KKi0pqqmQKDCs+huUMUqcFx4r+I2MKwhbHsv2z4ut 4ayh2JnAorfSArO19nEXOkfKP5QG16ZY1meVwzmSz7j9E2WwyP+RXqbvgOD5Ze6Hrsfe x1xQ== X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMgPgp8VKxflSZ1P34KBj5Qpw97WFDVCaXA0OXQ==" X-RZG-CLASS-ID: mo00 Received: from imac.fritz.box by smtp.strato.de (RZmta 46.1.12 DYNA|AUTH) with ESMTPSA id U06217w1HDwFNp5 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Mon, 17 Feb 2020 14:58:15 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: [PATCH v3] extcon: palmas: hide error messages if gpio returns -EPROBE_DEFER From: "H. Nikolaus Schaller" In-Reply-To: Date: Mon, 17 Feb 2020 14:58:14 +0100 Cc: linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org, kernel@pyra-handheld.com, linux-omap@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: References: To: MyungJoo Ham , Chanwoo Choi X-Mailer: Apple Mail (2.3124) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Am 17.02.2020 um 14:38 schrieb H. Nikolaus Schaller = : >=20 > If the gpios are probed after this driver (e.g. if they > come from an i2c expander) there is no need to print an > error message. >=20 > Signed-off-by: H. Nikolaus Schaller > --- > drivers/extcon/extcon-palmas.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/extcon/extcon-palmas.c = b/drivers/extcon/extcon-palmas.c > index edc5016f46f1..cea58d0cb457 100644 > --- a/drivers/extcon/extcon-palmas.c > +++ b/drivers/extcon/extcon-palmas.c > @@ -205,14 +205,18 @@ static int palmas_usb_probe(struct = platform_device *pdev) >=20 > palmas_usb->id_gpiod =3D devm_gpiod_get_optional(&pdev->dev, = "id", > GPIOD_IN); > - if (IS_ERR(palmas_usb->id_gpiod)) { > + if (PTR_ERR(palmas_usb->id_gpiod) =3D=3D -EPROBE_DEFER) { > + return -EPROBE_DEFER; > + } else if (IS_ERR(palmas_usb->id_gpiod)) { Hm. While looking again at that: why do we need the "{" and "} else "? It should be sufficient to have > palmas_usb->id_gpiod =3D devm_gpiod_get_optional(&pdev->dev, = "id", > GPIOD_IN); > + if (PTR_ERR(palmas_usb->id_gpiod) =3D=3D -EPROBE_DEFER) > + return -EPROBE_DEFER; > if (IS_ERR(palmas_usb->id_gpiod)) { What do you think is better coding style here? BR, Nikolaus Schaller=