From nobody Mon Feb 9 23:39:58 2026 Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (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 2EF2F2135DF for ; Fri, 10 Jan 2025 17:40:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736530817; cv=none; b=QOxpyhQr7lZr67EZ0QlRBF+w3AkvicLEStcf3UU5vncZL7nLTDLSLlv3Aal+5NB6ShRSTaCNQ9L9z2uFSW8mwgzcaaYBAXfLhmbhE5sVvFg64A3thSIgjrbyaMSGu0jKlG8VAGbLa4x+PC8UHJJUpARHQGzumdYsAMGRGYvZvr0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736530817; c=relaxed/simple; bh=M6Fcbwc3PbjlPukv9xod6YdOA5v1mZleHYkzNCORguw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=a3VLdihYz070cPNKpYP8zWpFRQvDfK71eTvU19wTSBlnSs9zkNnzf7YAHZ8bjZDNUqBuZ+abBccI/Me+drQqYmu9CyubHVaXH0q2Z0fOYMkAx7HR8LciGu7cW9qAydkw9cmGYRhGmY2x1u7h7DRh0whkMgYkJiTveHvRE7BhyUw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=p1lzPf6P; arc=none smtp.client-ip=209.85.167.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="p1lzPf6P" Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-3eb98ad8caaso934765b6e.0 for ; Fri, 10 Jan 2025 09:40:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1736530814; x=1737135614; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Tx4/GBkv0m6R1EJU0MqLGBWVuvonzJEQkiaHtLTW0dg=; b=p1lzPf6PvPs3kp1Mfz3AgD8b1npFunJJh+QSkCfDo2t8k+f79mHxhS779Vdz1EQIwN dGclDkoxwoM7JP6J4YiB6RgPKk5+UD7o+KtLnTGTE9cXx0ImB5TI5dWEmEhPNLGKgCrF urXin2U7+0/Vq1P6VZ6rTfyYN3bUiA/1792lVdrNy68k4Cy08B0kr9SFbL/ANzf9rqOH F6lmgm8GVIZpnd2RImmiOibepYaxsFjRwQgykc9zhguSQXWSdoOFo8OVgsFvUg1XsTFg aq1/Dq/tYSj9905Ni5PDZfDPPJ+blQwN8SyJE8DCuRLH0FD9FsCghjC3bTVXq1zoLvri Rd/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736530814; x=1737135614; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Tx4/GBkv0m6R1EJU0MqLGBWVuvonzJEQkiaHtLTW0dg=; b=g9TdMyPnAzDEi5KPAuRFEmirE2omH4dec+5QrB+t/RroLVsxCw94I99bOVsMJ5882j DOCrwgiGiGyxxI59uBPgi581AWkeqC/PCf5vP3fATa1kjX+e154xjtlHGXJQ6h1tOhYp /OxppegjdtZ3R5v55D3gwSOgHMlVsWBCX5kUH1GmcYk0RbbP0V6r4Dh9JHEL/Kdd8dsy w0LWCDKnorgNY+Zyry9F38tpOgOeBQSPRl+8GzuHy+FchCXVJpVTcg1Jofm9TN7XuDQ7 K5M3B0zzhhVPqu0Mi1WkcHpU4sEMf6LhG2ApJT1ZmuUfkWzNENslD9lKy2MGExP8ymVb EUAA== X-Forwarded-Encrypted: i=1; AJvYcCUbt93ljlr5BPrTxSX3NMt7fYzYd1Co/o7b6DB8/YvDMe3KXVh6jXufciuYHHhCi3IKPUOlO7PdV3Plakk=@vger.kernel.org X-Gm-Message-State: AOJu0YwP1t0f8p7GDHUoD0MVTak8yKcYV7BvKTmaZsSqQQrXkbEDWDne TuEVHV57+dw2Lt7D8u/VzH/L72yH3Q7DCQ8xS8LzEs8WKGHO+T/ubc3O9zbQ9ZWKWvYEJg+3GfE w X-Gm-Gg: ASbGncuS9cQhar4yDP8bEYsRWb7MMgiMCifSb8aRqx78oaAyGadvNfp0G3onMkW4Vj7 05/GvQPWdNBjA2Ypo8fLGXW44HkDQwbGMPFLUuDceqD/G8raIwhbvRCDwMlyoSbJXVij3SVVLhT lzD3KyXEcd1YLeMqGsAZ8AZwOCSu7qapyK7HU6GNa7QMuvV+alAzhG6cWBfus/9OLlo0qIjSY55 7/GgzvbhD827YVFeCFNZLOL7DwOPjjMxo/LqRyQlNFF+wVro6z8RGaB4gLjn+iYb5GTorUmcv9H iOF8JnAniqTc X-Google-Smtp-Source: AGHT+IGvG4TqQXVJRPgtlOTlk4Q/5oV1YPrJZ7HZfl8Z5jkIIndaLv71DjeZBDGuGgWv0oHh93TVYA== X-Received: by 2002:a05:6808:3024:b0:3eb:42d0:f3c with SMTP id 5614622812f47-3ef2eba742fmr6484284b6e.3.1736530814261; Fri, 10 Jan 2025 09:40:14 -0800 (PST) Received: from [127.0.1.1] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3f03769a8f8sm842165b6e.26.2025.01.10.09.40.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2025 09:40:12 -0800 (PST) From: David Lechner Date: Fri, 10 Jan 2025 11:40:06 -0600 Subject: [PATCH v3 1/2] iio: adc: ad7173: remove special handling for irq number Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250110-iio-adc-ad7313-fix-non-const-info-struct-v3-1-41e1c9cdd1a7@baylibre.com> References: <20250110-iio-adc-ad7313-fix-non-const-info-struct-v3-0-41e1c9cdd1a7@baylibre.com> In-Reply-To: <20250110-iio-adc-ad7313-fix-non-const-info-struct-v3-0-41e1c9cdd1a7@baylibre.com> To: Jonathan Cameron , Dumitru Ceclan Cc: Michael Hennerich , Nuno Sa , Michael Walle , Andy Shevchenko , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Guillaume Ranquet , David Lechner X-Mailer: b4 0.14.2 Remove the int irq_line field in struct ad_sigma_delta_info and all code that referenced it. This struct is intended to be used as static const data. Currently, the only user that doesn't uses the static const struct directly, namely the ad7173 driver is making a copy of this struct to be able to modify the irq_line field. However, this field is written and never used due to the fact that ad_sd_init() which reads the field is called before ad7173_fw_parse_device_config() which writes it. The runtime behavior does not change since ad_sd_init() was already (unintentionally) being called with irq_line =3D 0. But, even though this could be considered a bug, the behavior was still correct. The SPI subsystem always uses the first interrupt in the interrupts array from the devicetree and the devicetree bindings for this family of chips specify that the RDY interrupt is always the first interrupt. Therefore, we don't actually need the special call to fwnode_irq_get_byname(), so it is removed in this patch instead of moving it to the correct place. Tested-by: Guillaume Ranquet Signed-off-by: David Lechner --- v3 changes: * Removed spurious change that was causing compiler error. * Rebased on iio/testing and resolved some merge conflicts. v2 changes: * Fixed chip name is subject line * Uwe's comment made me realize that the special case was actually never being used because of the ordering bug and could safely be removed rather than trying to preserve it. --- drivers/iio/adc/ad7173.c | 6 ------ drivers/iio/adc/ad_sigma_delta.c | 5 +---- include/linux/iio/adc/ad_sigma_delta.h | 2 -- 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/drivers/iio/adc/ad7173.c b/drivers/iio/adc/ad7173.c index 6c4ed10ae580d66287857252ce9a69cfaa45db0b..b92aca39d117a315d6b55951fba= 7c3b51787555a 100644 --- a/drivers/iio/adc/ad7173.c +++ b/drivers/iio/adc/ad7173.c @@ -1515,12 +1515,6 @@ static int ad7173_fw_parse_device_config(struct iio_= dev *indio_dev) return ret; } =20 - ret =3D fwnode_irq_get_byname(dev_fwnode(dev), "rdy"); - if (ret < 0) - return dev_err_probe(dev, ret, "Interrupt 'rdy' is required\n"); - - st->sigma_delta_info.irq_line =3D ret; - return ad7173_fw_parse_channel_config(indio_dev); } =20 diff --git a/drivers/iio/adc/ad_sigma_delta.c b/drivers/iio/adc/ad_sigma_de= lta.c index d5d81581ab34099cef30ec63944ce1171c80ec14..38a72ced10326656b30fd39d7a7= 2cefe8c4c1aa5 100644 --- a/drivers/iio/adc/ad_sigma_delta.c +++ b/drivers/iio/adc/ad_sigma_delta.c @@ -801,10 +801,7 @@ int ad_sd_init(struct ad_sigma_delta *sigma_delta, str= uct iio_dev *indio_dev, =20 spin_lock_init(&sigma_delta->irq_lock); =20 - if (info->irq_line) - sigma_delta->irq_line =3D info->irq_line; - else - sigma_delta->irq_line =3D spi->irq; + sigma_delta->irq_line =3D spi->irq; =20 sigma_delta->rdy_gpiod =3D devm_gpiod_get_optional(&spi->dev, "rdy", GPIO= D_IN); if (IS_ERR(sigma_delta->rdy_gpiod)) diff --git a/include/linux/iio/adc/ad_sigma_delta.h b/include/linux/iio/adc= /ad_sigma_delta.h index 417073c52380f60a1a45a4924f4f556b64832295..521e3dc95db9117b7df12710eaa= e3f373d1df7bc 100644 --- a/include/linux/iio/adc/ad_sigma_delta.h +++ b/include/linux/iio/adc/ad_sigma_delta.h @@ -53,7 +53,6 @@ struct iio_dev; * be used. * @irq_flags: flags for the interrupt used by the triggered buffer * @num_slots: Number of sequencer slots - * @irq_line: IRQ for reading conversions. If 0, spi->irq will be used * @num_resetclks: Number of SPI clk cycles with MOSI=3D1 to reset the chi= p. */ struct ad_sigma_delta_info { @@ -70,7 +69,6 @@ struct ad_sigma_delta_info { unsigned int data_reg; unsigned long irq_flags; unsigned int num_slots; - int irq_line; unsigned int num_resetclks; }; =20 --=20 2.43.0