From nobody Mon Jun 8 09:51:03 2026 Received: from mail-dy1-f171.google.com (mail-dy1-f171.google.com [74.125.82.171]) (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 58CE823645D for ; Sat, 30 May 2026 02:44:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780109100; cv=none; b=MwwolozUqay5oAKFwUzdQpwieYVKVeWur3G0/OEzWJgqXRul4Yvl7tWKoRPr47+WW+KD6ug9DiiIZRM8X3iYeRKZPXAKUc68wMg2FLFKDZCnt1ybcmn62/4RH4H7sucQuJz0flkDpaQAbyVfLsFsmIXoEnQg4/7khyl5kGCDy0w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780109100; c=relaxed/simple; bh=AHINHljSByGGLXUp1/2uAbOxMBp4rHH0AU2ACYRdcyM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=KjT0pZaBzt9TylSJK+YFpVybF+0evDsuxrzU0br1uiIEQDewaVoTL9gDy5VW2grj9pHkZO6bRFYFBiIrWAtwVZ3oAyIeB10Lj6LMnLItZ5+f02VLpUyj5T59b9kGncROwPZWyNzOp3wCu/BRMw39Zwye+9JmzeWHBSUVhEpDAtc= 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=G8RvHt5P; arc=none smtp.client-ip=74.125.82.171 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="G8RvHt5P" Received: by mail-dy1-f171.google.com with SMTP id 5a478bee46e88-304f0039c02so2287980eec.1 for ; Fri, 29 May 2026 19:44:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wbinvd.org; s=wbinvd; t=1780109098; x=1780713898; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=mWfM7NnkS/S6p/sHnq2L0EX4aDz9vWaQZjSlzj4gK8Y=; b=G8RvHt5PCpBXBurSPsK9GkHiqJaae9tH3lcy8c2kP5SL7P2fTn7Tn1viVtLKxprsrP ViqStGuGXbWlyUF7olxyBFmLVRAilRl68tyZymUCCGhcqK6C76ydTWuxLXi6KsvH6w3p V4noxfhixSPuNv6uao2p2YllFcl5enavpgbMpRbI4jZ9dRQwRXgJRwSsnKbI/oEHjQ35 9HK102xMC+b0Orpw2vubeIPsqP9QcFFRImW+bSbOmeZIYiW5yOZh6rz4XmcgtyL6O0bN iACjiN6AdLnvmNkT7H5KVANXCC2LkILqxBhj0122kUxcO7SdwH/Y1TpO1jbOjyTrpM2m emQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780109098; x=1780713898; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mWfM7NnkS/S6p/sHnq2L0EX4aDz9vWaQZjSlzj4gK8Y=; b=n0uhpqDU942z6RHrFFm4cCM92qgHt8YbkcwIs3t6xSI78O4InSIG/ikttKvHT1RegK VpRbXf8RjdjEb4hmdHH28Wb8guVa/wC44AAAStzyoTDmqg917miJ/HLOvDA8RhLn1wKY Q2ugwuGFZ6MUHPBzDmkJ/Wgb4hTtxkZHNEpjhDM84DqZPDsNxOVhc0Z5JekA9GV+mKWG hmw1af3dpdLSHcfIuGrcGZsFpCYQnxP4Pzd1nHxlEdOgWdf+m6xIKjKLiycH+c0IonjC 1hL9MBMfGpC+ii8XMKUCQm44aNc6WlQNriflGSC7NYx7Ao78VbGKs50oggDTjza6O9TQ zzaw== X-Gm-Message-State: AOJu0YyZ0q2ayeucQUh7zZmum7bm/FITYLqq/j802alpfK7d3MP7dGl0 AMaYZIBVAzs45j0TUso1/K6ln5MwTdcy32QOT/sRZ2QBm7vMKH4KvAeRgjA93YXtN/QeX0C7HVB PFWd/ X-Gm-Gg: Acq92OE1XNOSV9aw04eNXrjIjvQgfgVSxHr910PmY2eec5ThK9YHhoNat+We/4Vl7el a7k2H37Bc1FEM1DRt8lRv8FMRshtfEGjnz20wK652ldjFAA5FWmqLuFPJFWjYKRmk7HTY7bRb3+ kgCCNhEY3tVooFlQ7mfLPAlsEPfI6m1CQAQwW+Cnc6Lui7s7L0K26Uyfayj7c4v1DhKcDr1DkFO m9QOyBPoQeeYeLcwYmvx/6wkkoS9UnxIbSGncFpQNAAZ0PRZ/Dv1UmaQupmJfMn5AR/3D/9VuV7 eiyiysFQHPjItrA7fGiGhDYAonLnuI1pkRGfvVNh3E36Veuz2cweFuubgtA4t1d0vxiSKbskv/4 AC0Klj9BxWOb6LiXOJljlGQ5rpSA81qrgTvJ09R70zp2g+hcL+bjYjAE084Mn9rXl0KQ1wQfLAB 9koSbxBz1Dt6ogdLQIXkhBGqa9qpZnn5wjzcGPqQHLisrNgjw= X-Received: by 2002:a05:7300:3708:b0:2ed:27a3:eae2 with SMTP id 5a478bee46e88-304fa527021mr1259865eec.15.1780109098299; Fri, 29 May 2026 19:44:58 -0700 (PDT) Received: from mozart.vkv.me ([2001:5a8:468b:d015:ed95:9469:51ff:4655]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-304ed5a0b7dsm2994565eec.22.2026.05.29.19.44.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2026 19:44:57 -0700 (PDT) From: Calvin Owens To: linux-kernel@vger.kernel.org Cc: Rodolfo Giometti , Greg Kroah-Hartman Subject: [PATCH] pps: clients: gpio: Remove dead capture_clear code Date: Fri, 29 May 2026 19:44:46 -0700 Message-ID: <7a71b8e74bce9582d3286d31e6c85ac77465e421.1780108620.git.calvin@wbinvd.org> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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=3D1 Signed-off-by: Calvin Owens Acked-by: Rodolfo Giometti --- drivers/pps/clients/pps-gpio.c | 36 +++------------------------------- 1 file changed, 3 insertions(+), 33 deletions(-) diff --git a/drivers/pps/clients/pps-gpio.c b/drivers/pps/clients/pps-gpio.c index 935da68610c7..b48db73e7ba6 100644 --- a/drivers/pps/clients/pps-gpio.c +++ b/drivers/pps/clients/pps-gpio.c @@ -32,7 +32,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 */ }; @@ -45,25 +44,13 @@ static irqreturn_t pps_gpio_irq_handler(int irq, void *= data) { const struct pps_gpio_device_data *info; struct pps_event_time ts; - int rising_edge; =20 /* Get the time stamp first */ pps_get_ts(&ts); =20 info =3D data; =20 - /* Small trick to bypass the check on edge's direction when capture_clear= is unset */ - rising_edge =3D 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, &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, &ts, PPS_CAPTURECLEAR, data); - else - dev_warn_ratelimited(&info->pps->dev, "IRQ did not trigger any PPS event= \n"); + pps_event(info->pps, &ts, PPS_CAPTUREASSERT, data); =20 return IRQ_HANDLED; } @@ -79,11 +66,6 @@ static void pps_gpio_echo(struct pps_device *pps, int ev= ent, 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; } =20 /* fire the timer */ @@ -145,15 +127,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 =3D data->assert_falling_edge ? - IRQF_TRIGGER_FALLING : IRQF_TRIGGER_RISING; - - if (data->capture_clear) { - flags |=3D ((flags & IRQF_TRIGGER_RISING) ? - IRQF_TRIGGER_FALLING : IRQF_TRIGGER_RISING); - } - - return flags; + return data->assert_falling_edge ? IRQF_TRIGGER_FALLING : + IRQF_TRIGGER_RISING; } =20 static int pps_gpio_probe(struct platform_device *pdev) @@ -186,9 +161,6 @@ static int pps_gpio_probe(struct platform_device *pdev) /* initialize PPS specific parts of the bookkeeping data structure. */ data->info.mode =3D PPS_CAPTUREASSERT | PPS_OFFSETASSERT | PPS_ECHOASSERT | PPS_CANWAIT | PPS_TSFMT_TSPEC; - if (data->capture_clear) - data->info.mode |=3D PPS_CAPTURECLEAR | PPS_OFFSETCLEAR | - PPS_ECHOCLEAR; data->info.owner =3D THIS_MODULE; snprintf(data->info.name, PPS_MAX_NAME_LEN - 1, "%s.%d", pdev->name, pdev->id); @@ -200,8 +172,6 @@ static int pps_gpio_probe(struct platform_device *pdev) =20 /* register PPS source */ pps_default_params =3D PPS_CAPTUREASSERT | PPS_OFFSETASSERT; - if (data->capture_clear) - pps_default_params |=3D PPS_CAPTURECLEAR | PPS_OFFSETCLEAR; data->pps =3D 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", --=20 2.47.3