Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5629149pxb; Tue, 16 Feb 2021 03:40:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJyAFZArDeiMXQwl7PdI/3K/7NN1iMofWJM/nWaK8zZDFYiIshuYICFraSNCor3EgDUMYfDN X-Received: by 2002:a05:6402:34d2:: with SMTP id w18mr21082833edc.102.1613475616311; Tue, 16 Feb 2021 03:40:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613475616; cv=none; d=google.com; s=arc-20160816; b=RDPeMAZxw2iVVF+JygTzm7jIg/gvinug9qqBEAJ6vO0mleurWA0egD40tPrW/CuApH nECbxMKIwdVSqeyGVdZA8wv5SBUOfnckgvcu/tpEt51jRDE4dgs9KmpBubtyvmoB/qyY YCFWVrXCprB49Ky1x2+ZB8Pp5qVfHScoFkRmYMqrHgfi6LMHQZZgnAfo3NjH6nq5UV+0 FKUWwcrmYpaB09W7Iau84A7cdhgp8NFuR5vTrMqnbwsb4/Q+YDDiFBiJiZxkCLcNioyu xpdifZgOdDhsm2wC1zqZF13Vtm1qix+Tz6yJKUJifQTLWspeioH8pT3k5oWTLFOuygAM nxsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:ironport-sdr:ironport-sdr; bh=M15GBw2CMKRy6UhQeY2LqEoXe/wDsYPj3MYWEQ0fs+Q=; b=S7owyf5Y0w4TJqCwCz1ax4FTLQhGthBSjKge2OJLnP7vOFL2VSsD1qTEy5YHvJLhyS NE1NBFoSY1cPt/RRdZzgODsTInQkGe+3onDA/TdWnZoiHBjaL4VtUPYDUOqOVf6AFm1T lmzC0AwtgAQ9CZ4kXshEge2gPlQct4S7ha+feAz4hOG5gZD+j3WTcsRcgiFw9vJjz9lS GOjdoloA29Q87UAbynaJSIOdja1f/D5WwoMCubpsRCcALdj1xwDllOvJeACUo1A4I0om FwXtONMg0XMvPRP8/1QMRfVG/n+OP8J8TSLyyG962Jf8lMEcSWxpEz3NWiOEAAZEfg0i bJLw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r10si6593767edm.496.2021.02.16.03.39.52; Tue, 16 Feb 2021 03:40:16 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230247AbhBPLi3 (ORCPT + 99 others); Tue, 16 Feb 2021 06:38:29 -0500 Received: from mga02.intel.com ([134.134.136.20]:9704 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230260AbhBPLhK (ORCPT ); Tue, 16 Feb 2021 06:37:10 -0500 IronPort-SDR: hHmJ6RjeisE0RuJGJBMCQA1kzYdJt0kCNNv6Fx2FRPa5D1FJvIg+bSgvNs6wDMo/lBuowrJULB p8ZRZicC3+vA== X-IronPort-AV: E=McAfee;i="6000,8403,9896"; a="169994422" X-IronPort-AV: E=Sophos;i="5.81,183,1610438400"; d="scan'208";a="169994422" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2021 03:32:53 -0800 IronPort-SDR: HFFJug/zogBZE9V6b9pfwVlZnqIZTKAZFij5Xiq6P/w1UsWT4l0QVusXE1bUammv8WWv+wIDEw BvYBbNAnb/Yg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,183,1610438400"; d="scan'208";a="493161365" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 16 Feb 2021 03:32:52 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 5E9F41F1; Tue, 16 Feb 2021 13:32:50 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-kernel@vger.kernel.org Cc: Rodolfo Giometti , Ryan Govostes Subject: [PATCH v1 1/7] pps: clients: gpio: Bail out on error when requesting GPIO echo line Date: Tue, 16 Feb 2021 13:31:48 +0200 Message-Id: <20210216113154.70852-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When requesting optional GPIO echo line, bail out on error, so user will know that something wrong with the existing property. Signed-off-by: Andy Shevchenko --- drivers/pps/clients/pps-gpio.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/pps/clients/pps-gpio.c b/drivers/pps/clients/pps-gpio.c index e0de1df2ede0..f89c31aa66f1 100644 --- a/drivers/pps/clients/pps-gpio.c +++ b/drivers/pps/clients/pps-gpio.c @@ -119,12 +119,12 @@ static int pps_gpio_setup(struct platform_device *pdev) data->echo_pin = devm_gpiod_get_optional(&pdev->dev, "echo", GPIOD_OUT_LOW); - if (data->echo_pin) { - if (IS_ERR(data->echo_pin)) { - dev_err(&pdev->dev, "failed to request ECHO GPIO\n"); - return PTR_ERR(data->echo_pin); - } + if (IS_ERR(data->echo_pin)) { + dev_err(&pdev->dev, "failed to request ECHO GPIO\n"); + return PTR_ERR(data->echo_pin); + } + if (data->echo_pin) { ret = of_property_read_u32(np, "echo-active-ms", &value); -- 2.30.0