From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96AD67082D for ; Mon, 6 Jul 2026 17:19:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783358363; cv=none; b=fFWBysFyZOydpv6HOZ8ciT8JmmQNl1ZCkLB7C6ue1U/Mo5LUksFsUueR9ZfdLDNAKn9BYJJ+KiJz3diuq0yrqZOuYQxe66S8w3slphAs/nKnNBeMnnuLe4QyM4FNTMk4c+iCoFirvo+Kk3foD6UJLlIFJXwHRIdEBy4hQp+PppU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783358363; c=relaxed/simple; bh=Ae2w43W7AN0SJYamDWMsk30l9G4D/vjcMsl+xhtfOUg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hCXVsBsj3jQG1pMcsnNuk8Ni+HH8I25CKwzebxhk63vf8Xq1Fk6dNYLDWNB0IB+EyJ5F59n8v1PungRcw2/38Nrqv2XoE+caFPp8oRidX/wqCkRkJH/WV1aSagYdz+Iv0P2o4ax8WMpXj/cutnFOLtaih5axJgVWEFCyfT6MAs0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wbinvd.org; spf=pass smtp.mailfrom=wbinvd.org; dkim=pass (2048-bit key) header.d=wbinvd.org header.i=@wbinvd.org header.b=X/RUzukD; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=wbinvd.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wbinvd.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wbinvd.org header.i=@wbinvd.org header.b="X/RUzukD" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-2cace91f112so27772905ad.0 for ; Mon, 06 Jul 2026 10:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wbinvd.org; s=wbinvd; t=1783358361; x=1783963161; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lsSKQXbBTtwAleOIF1mvk7oOSXILrlftaBJiy8lglIQ=; b=X/RUzukDjnYOsd8OGxjP0yEoJYtXeCEP2QeP6fatLAZ0kyVOxgW8z90tVmO94hzhAy r56hIZBybYo3FGusRMq6OrfgV7vaLkeEdqSlUpkiFroOFW4moXoIyqj1HxldZaESps6C 8vzDG077ghjwWe63eM9iNfwnA1uBJPchWHmSD+KRly/sNis1bPirEKGZsaWW7/0lMaoB IZmtSdscbzumMQ902ZVaCn9FlRrkLwqwXEtiEm2Bxt2ZByoRa0YGf8O2XsOdkE826waX Ouo5hV6WgpQ6nOuZ7lF4GsGYo3v/EGlh1CC7sYwER6QRt6LUUkhw20hHedxqceRk7iOF 4k1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783358361; x=1783963161; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lsSKQXbBTtwAleOIF1mvk7oOSXILrlftaBJiy8lglIQ=; b=Z6lFARVlKy5dF3tmAzIv3uUiT888kX+zLKPGDJaG3PK96Cg7gNcG1fML/JhpApfggD RXX/oJhoIlUOMKQpx0zOMkbQAyq2FjGsPLYhxp6dBQyQRmkcGB/8vNiwCdlE0lzwbBvb 5eUkr0BzBFnQnU3aa2xQCFbzqr2/qsCya6egApPLSI3NlMTLFr/OGutG4UOOd9p+Av6Y ldkI5v8R/maW0rbXvv/IJLtYX8KxoD7aRETiIM27rR4+gdnJanGYkv/H6A/Xya2UprOu 0tnJRVzL6zwu0u3TJXa5Jn6jD7h+OBEOUVVSNMySszPvhJD3VyteQBY7kBM/obEH4oRa 9jcQ== X-Gm-Message-State: AOJu0YzM0PJ9TGQcwQBxiO4fW9QRBCBkWE3+thleac44ZZ0/HcUHkZ68 GJM436U8+2RbschpgQ7XPVuvhyJZgb3nT5hGOzph12T8e71ZIh6EFs82DHOHUZUnezYZcJadBOM 8SSOLL5I= X-Gm-Gg: AfdE7cmRZDGhh8pq/u5OZlNar5LBgnSU1Zqia71lMc6BuSQVGkJmLeLvPmvxQHM1igk d5oyU8YdfYF1BggbN973kEhirQtJoufrpFGd83106s6DsbtHLmknk0mjJwtAHeQer4knECopURC 5jFSTqjioYJZuORFj+JIrOqNLfHmvjTFJGe5GPTTGOLYN2SAC53yhwND7S/F9bV8t2QZT7sHyhs 8HkMe5eeBWGj3AYT4xpsWd8rGIYUJ9iBbs6EsatF8k0N3p8DkSF8sKB8JtbvLv3orKDCTiO8Agr Jeg7HAiyjbcF4XuiJFKJkNcA0Ors3hFitzNvNMgOhSdA4jOFl0vQ4qGbfwzVwEn7aodhJk99Y9e vb1+e6bMhZ6s0VXqQNI4Fx/vOCO/Dsoc4nyT5ZMn6EM0DVNNB6BKRsd56jBfYema/bM20vs1k2s Jk4TaEAvTEp7kwVM4= X-Received: by 2002:a17:903:15c7:b0:2cc:9763:e607 with SMTP id d9443c01a7336-2ccbed27817mr15945395ad.27.1783358360698; Mon, 06 Jul 2026 10:19:20 -0700 (PDT) Received: from mozart.vkv.me ([2001:5a8:468b:d015:bfb7:5881:65ca:8ca0]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13b3c85d4fesm51137355c88.11.2026.07.06.10.19.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 10:19:20 -0700 (PDT) From: Calvin Owens To: linux-kernel@vger.kernel.org Cc: Rodolfo Giometti , Andrew Morton Subject: [PATCH v2 next] pps-gpio: Remove dead capture_clear code Date: Mon, 6 Jul 2026 10:19:07 -0700 Message-ID: X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260705131834.777ac0d0ac5137a27a1ec0b1@linux-foundation.org> References: <20260705131834.777ac0d0ac5137a27a1ec0b1@linux-foundation.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The capture_clear field is never set, and all code conditional on it being set has been unreachable since the platform data logic was removed from pps-gpio in ee89646619ba ("pps: clients: gpio: Get rid of legacy platform data"). I think the only logical thing to do here is to remove it all, since no in-tree code ever actually used it in the first place, and it has been completely dead code for over five years (since v5.13). Sashiko asked some questions about the gpiod_get_value() call which caused me to look deeper and figure this out, but it did not actually notice capture_clear is never set. Fixes: ee89646619ba ("pps: clients: gpio: Get rid of legacy platform data") Closes: https://sashiko.dev/#/patchset/cover.1779733602.git.calvin%40wbinvd.org?part=1 Acked-by: Rodolfo Giometti Signed-off-by: Calvin Owens --- Changes in v2: * Rebased onto next-20260706 for Andrew v1: https://lore.kernel.org/lkml/7a71b8e74bce9582d3286d31e6c85ac77465e421.1780108620.git.calvin@wbinvd.org/ drivers/pps/clients/pps-gpio.c | 37 ++++------------------------------ 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/drivers/pps/clients/pps-gpio.c b/drivers/pps/clients/pps-gpio.c index 7d87481280b21..73ec2c7335e51 100644 --- a/drivers/pps/clients/pps-gpio.c +++ b/drivers/pps/clients/pps-gpio.c @@ -31,7 +31,6 @@ struct pps_gpio_device_data { struct gpio_desc *echo_pin; struct timer_list echo_timer; /* timer to reset echo active state */ bool assert_falling_edge; - bool capture_clear; unsigned int echo_active_ms; /* PPS echo active duration */ unsigned long echo_timeout; /* timer timeout value in jiffies */ struct pps_event_time ts; /* timestamp captured in hardirq */ @@ -61,19 +60,8 @@ static irqreturn_t pps_gpio_irq_hardirq(int irq, void *data) static irqreturn_t pps_gpio_irq_thread(int irq, void *data) { struct pps_gpio_device_data *info = data; - int rising_edge; - - rising_edge = info->capture_clear ? - gpiod_get_value(info->gpio_pin) : !info->assert_falling_edge; - if ((rising_edge && !info->assert_falling_edge) || - (!rising_edge && info->assert_falling_edge)) - pps_event(info->pps, &info->ts, PPS_CAPTUREASSERT, data); - else if (info->capture_clear && - ((rising_edge && info->assert_falling_edge) || - (!rising_edge && !info->assert_falling_edge))) - pps_event(info->pps, &info->ts, PPS_CAPTURECLEAR, data); - else - dev_warn_ratelimited(&info->pps->dev, "IRQ did not trigger any PPS event\n"); + + pps_event(info->pps, &info->ts, PPS_CAPTUREASSERT, data); return IRQ_HANDLED; } @@ -89,11 +77,6 @@ static void pps_gpio_echo(struct pps_device *pps, int event, void *data) if (pps->params.mode & PPS_ECHOASSERT) gpiod_set_value(info->echo_pin, 1); break; - - case PPS_CAPTURECLEAR: - if (pps->params.mode & PPS_ECHOCLEAR) - gpiod_set_value(info->echo_pin, 1); - break; } /* fire the timer */ @@ -155,15 +138,8 @@ static int pps_gpio_setup(struct device *dev) static unsigned long get_irqf_trigger_flags(const struct pps_gpio_device_data *data) { - unsigned long flags = data->assert_falling_edge ? - IRQF_TRIGGER_FALLING : IRQF_TRIGGER_RISING; - - if (data->capture_clear) { - flags |= ((flags & IRQF_TRIGGER_RISING) ? - IRQF_TRIGGER_FALLING : IRQF_TRIGGER_RISING); - } - - return flags; + return data->assert_falling_edge ? IRQF_TRIGGER_FALLING : + IRQF_TRIGGER_RISING; } static int pps_gpio_probe(struct platform_device *pdev) @@ -196,9 +172,6 @@ static int pps_gpio_probe(struct platform_device *pdev) /* initialize PPS specific parts of the bookkeeping data structure. */ data->info.mode = PPS_CAPTUREASSERT | PPS_OFFSETASSERT | PPS_ECHOASSERT | PPS_CANWAIT | PPS_TSFMT_TSPEC; - if (data->capture_clear) - data->info.mode |= PPS_CAPTURECLEAR | PPS_OFFSETCLEAR | - PPS_ECHOCLEAR; data->info.owner = THIS_MODULE; snprintf(data->info.name, PPS_MAX_NAME_LEN - 1, "%s.%d", pdev->name, pdev->id); @@ -210,8 +183,6 @@ static int pps_gpio_probe(struct platform_device *pdev) /* register PPS source */ pps_default_params = PPS_CAPTUREASSERT | PPS_OFFSETASSERT; - if (data->capture_clear) - pps_default_params |= PPS_CAPTURECLEAR | PPS_OFFSETCLEAR; data->pps = pps_register_source(&data->info, pps_default_params); if (IS_ERR(data->pps)) { dev_err(dev, "failed to register IRQ %d as PPS source\n", -- 2.47.3