Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5629698pxb; Tue, 16 Feb 2021 03:41:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwFmtJ56NtkS0ZjBSrLIeeCe7fBYT6APuGiLWEJlFcYwGuxiWSLUTPlApDWF5z4ZoBeeqZl X-Received: by 2002:a17:906:90da:: with SMTP id v26mr16724227ejw.228.1613475688732; Tue, 16 Feb 2021 03:41:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613475688; cv=none; d=google.com; s=arc-20160816; b=ERjX4ZzchmecPXWj/E03UC8LCGPY2DzkiBqk0xKBl33yoagKmKGjlA7CTkx5FqBWAD kvgoC8MslBziAO7hbmFQqY7TDdUZlgXuZQJz2vOwcVL1RXfbHKOoEgf88Orz8hEsOL1g fDnwwn4E3vaTnUAs2097fIw5rQIG+q1WhZA+ty8WdRMLueQRiwrj41cPIvBrN2e9aWIS Lw41+nGy/hBpcAnBRx6J7udIyiyxqjWCoy/rjOUQzTPRIBsEKfF89WCPgutPcaS9wpr8 MWOukKBocggSGx0GvZX2VJPIDI+0pIFN7oOXhlVeXxXVW5tDfSLiw3ux5KHL8pyaiAQX Ce5Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=14SGpzFmREfGN9QFFme90+gyDUdf1uTPQQeiuM6Nce4=; b=Uc/mA1ASQXlAEbJgGCLUKlqf0Ur5J0vSCKT5nmVzJLvZn2GuK6w4aMXSL1b+JR5xNZ i/yMq1ZbriL0cLV2lBK5pfDjqegDrHi4Hkp1YyNo6G3jYE/n6CehLr6bKthUE5No/FnX +u+8qsMobxV5Drof9tgs6gTa2E1cx78jZ6rZfCYO0ak/25idEedBYCm2Iqi9Q8enTgea 0aPrZNhjdVCkOHFOJylNpEeb3G7KT/KqOEbciyHvHUAwTLGTTuMvZ6f1ieEP0YJbGeqv 0QNhO4NS62C5wwUX65HjKfQSSh1ljqcG3qZhYPUEeCWkIrIfXTT7A5LwjSWvsNkBmI8b +thw== 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 t15si15554905edc.372.2021.02.16.03.41.06; Tue, 16 Feb 2021 03:41:28 -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 S230240AbhBPLh4 (ORCPT + 99 others); Tue, 16 Feb 2021 06:37:56 -0500 Received: from mga04.intel.com ([192.55.52.120]:47562 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230131AbhBPLg7 (ORCPT ); Tue, 16 Feb 2021 06:36:59 -0500 IronPort-SDR: CfD9P6anjMsIcntD2s4r8U5AzJWO4AEQzNZknK493gUFgvCOwGsnUdMoUKeTEW52yKlSCZaScz 2Jaf/FWHDeMw== X-IronPort-AV: E=McAfee;i="6000,8403,9896"; a="180301355" X-IronPort-AV: E=Sophos;i="5.81,183,1610438400"; d="scan'208";a="180301355" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2021 03:32:52 -0800 IronPort-SDR: U/ToGnTKz/FAToqhTmTNsa7nXGWKxJwdObta39HiZqe9JM58DyGh91nC1jjBHhzMym7ibrNHeC yRkl8sBYhcyA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,183,1610438400"; d="scan'208";a="364084818" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 16 Feb 2021 03:32:51 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 9004935E; 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 5/7] pps: clients: gpio: Make use of device properties Date: Tue, 16 Feb 2021 13:31:52 +0200 Message-Id: <20210216113154.70852-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210216113154.70852-1-andriy.shevchenko@linux.intel.com> References: <20210216113154.70852-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Device property API allows to gather device resources from different sources, such as ACPI. Convert the drivers to unleash the power of device property API. Signed-off-by: Andy Shevchenko --- drivers/pps/clients/pps-gpio.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/pps/clients/pps-gpio.c b/drivers/pps/clients/pps-gpio.c index 291240dce79e..c6db3a3b257b 100644 --- a/drivers/pps/clients/pps-gpio.c +++ b/drivers/pps/clients/pps-gpio.c @@ -12,14 +12,14 @@ #include #include #include +#include #include #include #include #include #include #include -#include -#include +#include #include #include @@ -102,7 +102,6 @@ static void pps_gpio_echo_timer_callback(struct timer_list *t) static int pps_gpio_setup(struct platform_device *pdev) { struct pps_gpio_device_data *data = platform_get_drvdata(pdev); - struct device_node *np = pdev->dev.of_node; int ret; u32 value; @@ -121,26 +120,24 @@ static int pps_gpio_setup(struct platform_device *pdev) "failed to request ECHO GPIO\n"); if (data->echo_pin) { - ret = of_property_read_u32(np, - "echo-active-ms", - &value); + ret = device_property_read_u32(&pdev->dev, "echo-active-ms", &value); if (ret) { dev_err(&pdev->dev, - "failed to get echo-active-ms from OF\n"); + "failed to get echo-active-ms from FW\n"); return ret; } data->echo_active_ms = value; /* sanity check on echo_active_ms */ if (!data->echo_active_ms || data->echo_active_ms > 999) { dev_err(&pdev->dev, - "echo-active-ms: %u - bad value from OF\n", + "echo-active-ms: %u - bad value from FW\n", data->echo_active_ms); return -EINVAL; } } - if (of_property_read_bool(np, "assert-falling-edge")) - data->assert_falling_edge = true; + data->assert_falling_edge = + device_property_read_bool(&pdev->dev, "assert-falling-edge"); return 0; } -- 2.30.0