Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4769606ybv; Mon, 17 Feb 2020 05:39:26 -0800 (PST) X-Google-Smtp-Source: APXvYqwT3GAWB/BRSgfB/0nfaTwJ7pUuDW6VDTMXGGwr72EljaBImtsVylvneuM8u//KZJqM7IJb X-Received: by 2002:a05:6808:289:: with SMTP id z9mr9545344oic.48.1581946766518; Mon, 17 Feb 2020 05:39:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581946766; cv=none; d=google.com; s=arc-20160816; b=0c87lwUN74ZmasW8RPqrepU7fbl9HuKTBMdt+BWgvNhThk7hByMgBJ6lpoqdTL5gUS PzxwSFRydPZhUujRPasQRLuG/3Y2ru577dWgooyJeNC8sG1LEWezag729fnAjbXdbkXG 5d7WcA0rUhGbAIynqoR2cc0b6ZQk+a2TiZLmqVgKFUkJsc5gOipizzC/1Td2JVBlwywu ttHxWw6AJ7RrUX9WcBTUrg/swO46TyQC/FQvC3sDHms3sMRN3TkZSUAdihnXS3TwINyM KbuUrh5/ZEgOr0JoKYqVtwJWWS6ngWbyXVikwAJNwAReEzb/U7oBoCuV+tIwBgGf/W46 1jJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=cBUUlAZ6i+U9PJhnWDfCJgK6bPL4IpEvunrE61nzboc=; b=uS+LkJgNdqzlWIw9cF/q1sI9b+rZ6hZInOs2ZmIvEdXgJjp/7XEuqjJCbNfWtULug/ acIkUJKgzaCQpAjPbtyqH3DEUimw0zfnkko6UWNyr0gfevRBt/COq/cg0VHZ0StjB8id DoZOZS7QqqoZXENV/UYm6i7iApBRz14q+CWzjArWsHimUHp/u5SXxQmZGsLZD2MfdVka Mv8Z3La1v4p3sp0oso0tr75c2WNhgrrbWfUxuxYT3Ac0heDn84B0swyxHuTBTfTppfkO qanOC374bE+Lp+k/TX9iic14XYHo5tceRvpMChrRJYnwqg2nsNhfjrDvTQF5Ty7Wf6sX YVXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@goldelico.com header.s=strato-dkim-0002 header.b=IonV6P7g; 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 m26si189912otk.305.2020.02.17.05.39.13; Mon, 17 Feb 2020 05:39:26 -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=IonV6P7g; 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 S1727931AbgBQNi1 (ORCPT + 99 others); Mon, 17 Feb 2020 08:38:27 -0500 Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.52]:23670 "EHLO mo4-p01-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726779AbgBQNi0 (ORCPT ); Mon, 17 Feb 2020 08:38:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1581946704; s=strato-dkim-0002; d=goldelico.com; h=Message-Id:Date:Subject:Cc:To:From:X-RZG-CLASS-ID:X-RZG-AUTH:From: Subject:Sender; bh=cBUUlAZ6i+U9PJhnWDfCJgK6bPL4IpEvunrE61nzboc=; b=IonV6P7gZndFOVguOLjAdcZH4YnjBM8dzfr+KxzwFf/3krjV7jMTzdJuBoJHsmEmc+ AKAw6nCg5LHNv8CgWbLsAaHgT6Rtr8S/ympNl50OUSDMJEfSDH41ggQgt0ucz0i8QaUm HFCo5ZBnZel0LEuKo75VuZ//LEgOm0OAfy/yVfmH+7qVrDQGqomQNbwi+pcDHWj4423Z ZHP2jwD/NRBgTtzIuPsrOCSKN5KPbTWF0/8O6qslGzmdO8XNbSq09NvqodGMPsufA4mC EsiKGwwIpCMCsb9OQ1v53aOcWt7qut6RvDdHLVs3oVhmZHCF+U6nnelMAizaG4sfGPMz JrZQ== X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMhflhwDubTJ9o1mfYzBGHXL8GTnsvhg=" X-RZG-CLASS-ID: mo00 Received: from iMac.fritz.box by smtp.strato.de (RZmta 46.1.12 DYNA|AUTH) with ESMTPSA id U06217w1HDcGNXg (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Mon, 17 Feb 2020 14:38:16 +0100 (CET) From: "H. Nikolaus Schaller" To: MyungJoo Ham , Chanwoo Choi Cc: linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org, kernel@pyra-handheld.com, linux-omap@vger.kernel.org, "H. Nikolaus Schaller" Subject: [PATCH v3] extcon: palmas: hide error messages if gpio returns -EPROBE_DEFER Date: Mon, 17 Feb 2020 14:38:15 +0100 Message-Id: X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: H. Nikolaus Schaller --- drivers/extcon/extcon-palmas.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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) palmas_usb->id_gpiod = devm_gpiod_get_optional(&pdev->dev, "id", GPIOD_IN); - if (IS_ERR(palmas_usb->id_gpiod)) { + if (PTR_ERR(palmas_usb->id_gpiod) == -EPROBE_DEFER) { + return -EPROBE_DEFER; + } else if (IS_ERR(palmas_usb->id_gpiod)) { dev_err(&pdev->dev, "failed to get id gpio\n"); return PTR_ERR(palmas_usb->id_gpiod); } palmas_usb->vbus_gpiod = devm_gpiod_get_optional(&pdev->dev, "vbus", GPIOD_IN); - if (IS_ERR(palmas_usb->vbus_gpiod)) { + if (PTR_ERR(palmas_usb->vbus_gpiod) == -EPROBE_DEFER) { + return -EPROBE_DEFER; + } else if (IS_ERR(palmas_usb->vbus_gpiod)) { dev_err(&pdev->dev, "failed to get vbus gpio\n"); return PTR_ERR(palmas_usb->vbus_gpiod); } -- 2.23.0