From patchwork Wed Jan 17 13:10:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 13521721 Received: from mx0b-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED4231EB32 for ; Wed, 17 Jan 2024 13:08:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705496885; cv=none; b=K7Faz/EYnn3g+eAUWaXGbOIPvhbyivTZld5oPUQd8iyZ8yBwZ1MjpOQICxICoW0XH9qpK6F15SZTXd3PWAgMzx28TYRMaC2d+cRHjOKrImGjw18Q3hZ0Ry00g6kfgJweA9xxTWXxcNQtP49UEkPobfwFZ+aF2farcwJ3axIlhIc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705496885; c=relaxed/simple; bh=HVpaOvhygPjo/K8JIF1O7xuBgb5ksT92uyUkSAlK2Mw=; h=Received:Received:Received:Received:Received:Received:Received: From:Date:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-ID:References:In-Reply-To:To:CC: X-Mailer:X-Developer-Signature:X-Developer-Key:X-ADIRuleOP-NewSCL: X-Proofpoint-GUID:X-Proofpoint-ORIG-GUID: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; b=YjKNq8fxi5I20pK4fB1OrJhh9R2FkkAScahAfRVQVjtnz6hExNttSw5de/pBWcIpzGmcDo6LpuJ2O1yf+3zpJQivfKR28394/TEDDAoOITDUorquX7tl8bET36NxSBYOlfD1YjL1fVHcyeqpNqMldKVDi8gg1TQ12hn22WkGW3w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Received: from pps.filterd (m0375855.ppops.net [127.0.0.1]) by mx0b-00128a01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40H9p6uN029673; Wed, 17 Jan 2024 08:07:49 -0500 Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0b-00128a01.pphosted.com (PPS) with ESMTPS id 3vnx38c01a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Jan 2024 08:07:49 -0500 (EST) Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 40HD7mPB032876 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 17 Jan 2024 08:07:48 -0500 Received: from ASHBCASHYB4.ad.analog.com (10.64.17.132) by ASHBMBX9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Wed, 17 Jan 2024 08:07:47 -0500 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) by ASHBCASHYB4.ad.analog.com (10.64.17.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Wed, 17 Jan 2024 08:07:47 -0500 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Wed, 17 Jan 2024 08:07:47 -0500 Received: from [127.0.0.1] ([10.44.3.50]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 40HD7ZCk030917; Wed, 17 Jan 2024 08:07:40 -0500 From: Nuno Sa Date: Wed, 17 Jan 2024 14:10:49 +0100 Subject: [PATCH 1/3] iio: imu: adis: ensure proper DMA alignment Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240117-adis-improv-v1-1-7f90e9fad200@analog.com> References: <20240117-adis-improv-v1-0-7f90e9fad200@analog.com> In-Reply-To: <20240117-adis-improv-v1-0-7f90e9fad200@analog.com> To: CC: Michael Hennerich , Lars-Peter Clausen , Jonathan Cameron X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1705497049; l=1156; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=HVpaOvhygPjo/K8JIF1O7xuBgb5ksT92uyUkSAlK2Mw=; b=+j4r+vCY+FIEl/6nuKYJudFJA/f7NMql5MzAxW/UjmUUCldaOQQaMKlbevuLl5MzWUxqErEeH FC4e/wOlCtqDT7UtxwiC023GMcvPfiGOCbLTaMlEcBO+E6W5gu9Vi32 X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: pqnDubytTNYEdWSzfapIoqfHNyzuzGVn X-Proofpoint-ORIG-GUID: pqnDubytTNYEdWSzfapIoqfHNyzuzGVn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-17_07,2024-01-17_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=350 adultscore=0 malwarescore=0 clxscore=1015 impostorscore=0 mlxscore=0 spamscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401170093 Aligning the buffer to the L1 cache is not sufficient in some platforms as they might have larger cacheline sizes for caches after L1 and thus, we can't guarantee DMA safety. That was the whole reason to introduce IIO_DMA_MINALIGN in [1]. Do the same for the sigma_delta ADCs. [1]: https://lore.kernel.org/linux-iio/20220508175712.647246-2-jic23@kernel.org/ Fixes: ccd2b52f4ac6 ("staging:iio: Add common ADIS library") Signed-off-by: Nuno Sa --- include/linux/iio/imu/adis.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/iio/imu/adis.h b/include/linux/iio/imu/adis.h index dc9ea299e088..8898966bc0f0 100644 --- a/include/linux/iio/imu/adis.h +++ b/include/linux/iio/imu/adis.h @@ -11,6 +11,7 @@ #include #include +#include #include #define ADIS_WRITE_REG(reg) ((0x80 | (reg))) @@ -131,7 +132,7 @@ struct adis { unsigned long irq_flag; void *buffer; - u8 tx[10] ____cacheline_aligned; + u8 tx[10] __aligned(IIO_DMA_MINALIGN); u8 rx[4]; }; From patchwork Wed Jan 17 13:10:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 13521719 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AB49D1F5E7 for ; Wed, 17 Jan 2024 13:08:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705496883; cv=none; b=ev2cYgyvYf1nzKcK2yKbRWPnXbK+puyCEOk2r0mMyGVh2lNaLpG/UIt9mVVc4Wfm2BoAddiZutJfFc9pUqZCcbG/rXrF1XuJ5slmFLEeIoo/rbpT9PlYi3tyXAGjk4e+btJYP/rprqL0mCgEt6fRvVYzoMY5tF/WSl8X0juvw6Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705496883; c=relaxed/simple; bh=QBGe99KHP7hIM4Af343vWfD7ZswqgQ9VUsnJpX5OEH4=; h=Received:Received:Received:Received:Received:Received:From:Date: Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-ID:References:In-Reply-To:To:CC:X-Mailer: X-Developer-Signature:X-Developer-Key:X-ADIRuleOP-NewSCL: X-Proofpoint-GUID:X-Proofpoint-ORIG-GUID: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; b=FL/Ss9aOJBxKmoSex9FDUcTSFAOZO2YUpT5Yrw1RXTs6kSvafsQW/VONbREK0ia+WQNPtwg3wfI2HuR0VLddSajGkPp2g6nu8NgatR0+WCCzqa8Zn86949WvzRJF1/SOIaEPNMPIOCnL0NEZ49TuVSAwz5VKkwJcu1UEVFuyi2w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Received: from pps.filterd (m0167088.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40H9f7wT016135; Wed, 17 Jan 2024 08:07:48 -0500 Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 3vnm166q3u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Jan 2024 08:07:48 -0500 (EST) Received: from ASHBMBX8.ad.analog.com (ASHBMBX8.ad.analog.com [10.64.17.5]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 40HD7kQb030774 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 17 Jan 2024 08:07:46 -0500 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Wed, 17 Jan 2024 08:07:45 -0500 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Wed, 17 Jan 2024 08:07:45 -0500 Received: from [127.0.0.1] ([10.44.3.50]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 40HD7ZCl030917; Wed, 17 Jan 2024 08:07:41 -0500 From: Nuno Sa Date: Wed, 17 Jan 2024 14:10:50 +0100 Subject: [PATCH 2/3] iio: imu: adis16475: make use of irq_get_trigger_type() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240117-adis-improv-v1-2-7f90e9fad200@analog.com> References: <20240117-adis-improv-v1-0-7f90e9fad200@analog.com> In-Reply-To: <20240117-adis-improv-v1-0-7f90e9fad200@analog.com> To: CC: Michael Hennerich , Lars-Peter Clausen , Jonathan Cameron X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1705497049; l=1277; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=QBGe99KHP7hIM4Af343vWfD7ZswqgQ9VUsnJpX5OEH4=; b=JZ2kQQMfSl6Si2Q34PKVYnj/kxY3jt4qdMyGZLzmtAbRtul/NojZZ7YkPhGZ2k/R2N/07AZzf ZsB6fxIbW5CAVOXEQln8YtA/CrTbmlcDY0wsydwsVsY2nN4BNC27GOq X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: f0HtB8HpX53WfGeB3kFEXU7eS5L8vzez X-Proofpoint-ORIG-GUID: f0HtB8HpX53WfGeB3kFEXU7eS5L8vzez X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-17_07,2024-01-17_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 malwarescore=0 clxscore=1015 impostorscore=0 bulkscore=0 lowpriorityscore=0 mlxlogscore=683 phishscore=0 priorityscore=1501 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401170094 There's no need to call both irq_get_irq_data() and irqd_get_trigger_type() as we already have an helper for that. This allows for code simplification. Signed-off-by: Nuno Sa --- drivers/iio/imu/adis16475.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/iio/imu/adis16475.c b/drivers/iio/imu/adis16475.c index b7cbe1565aee..7c5270f70b7b 100644 --- a/drivers/iio/imu/adis16475.c +++ b/drivers/iio/imu/adis16475.c @@ -1363,22 +1363,16 @@ static int adis16475_config_sync_mode(struct adis16475 *st) static int adis16475_config_irq_pin(struct adis16475 *st) { int ret; - struct irq_data *desc; u32 irq_type; u16 val = 0; u8 polarity; struct spi_device *spi = st->adis.spi; - desc = irq_get_irq_data(spi->irq); - if (!desc) { - dev_err(&spi->dev, "Could not find IRQ %d\n", spi->irq); - return -EINVAL; - } /* * It is possible to configure the data ready polarity. Furthermore, we * need to update the adis struct if we want data ready as active low. */ - irq_type = irqd_get_trigger_type(desc); + irq_type = irq_get_trigger_type(spi->irq); if (irq_type == IRQ_TYPE_EDGE_RISING) { polarity = 1; st->adis.irq_flag = IRQF_TRIGGER_RISING; From patchwork Wed Jan 17 13:10:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 13521722 Received: from mx0a-00128a01.pphosted.com (mx0a-00128a01.pphosted.com [148.163.135.77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 07B131EB38 for ; Wed, 17 Jan 2024 13:08:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.135.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705496886; cv=none; b=oJQM+4STu00z6ubV2q+DM1+zBW95myu0/HnFBx6n8Zsm6ZTvlTo8lVBoZ3aLwlH+nUTUIfNLFHHqDpNd1I/qpf3YmvhfB2EjhRvjGpYnNiXYR/dFCmaDXlR4+hdeKjm27zglgAECwpci1X8hHLVuWqpsAVW9xhivqc8h9lYdQ54= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705496886; c=relaxed/simple; bh=BVuuhLDo707JKOt+bdBwqZ6OPflzJFQ/eolM0xVT4H0=; h=Received:Received:Received:Received:Received:Received:From:Date: Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-ID:References:In-Reply-To:To:CC:X-Mailer: X-Developer-Signature:X-Developer-Key:X-ADIRuleOP-NewSCL: X-Proofpoint-GUID:X-Proofpoint-ORIG-GUID: X-Proofpoint-Virus-Version:X-Proofpoint-Spam-Details; b=aSCyglIp1Qq2cBTtYkauSKnPEHQ0y+34Ork/AoOih8v3gs3uJZmhKFVi9qo1ech7cZu5Hd3LJPppG4vk1sjjft5+WRRCNzQy5sryJBWcHpTpA7d0I0Ncg0honm712G9TZQ4A6Zg41vqImBzPhUuZYAdGTCG6GV6pfDvQ+acs2jI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com; spf=pass smtp.mailfrom=analog.com; arc=none smtp.client-ip=148.163.135.77 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=analog.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=analog.com Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40H8JtTO018977; Wed, 17 Jan 2024 08:07:52 -0500 Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 3vpb9mgxr8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 17 Jan 2024 08:07:51 -0500 (EST) Received: from ASHBMBX9.ad.analog.com (ASHBMBX9.ad.analog.com [10.64.17.10]) by nwd2mta3.analog.com (8.14.7/8.14.7) with ESMTP id 40HD7olA032887 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 17 Jan 2024 08:07:50 -0500 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) by ASHBMBX9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Wed, 17 Jan 2024 08:07:49 -0500 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Wed, 17 Jan 2024 08:07:49 -0500 Received: from [127.0.0.1] ([10.44.3.50]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 40HD7ZCm030917; Wed, 17 Jan 2024 08:07:41 -0500 From: Nuno Sa Date: Wed, 17 Jan 2024 14:10:51 +0100 Subject: [PATCH 3/3] iio: imu: adis16480: make use of irq_get_trigger_type() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240117-adis-improv-v1-3-7f90e9fad200@analog.com> References: <20240117-adis-improv-v1-0-7f90e9fad200@analog.com> In-Reply-To: <20240117-adis-improv-v1-0-7f90e9fad200@analog.com> To: CC: Michael Hennerich , Lars-Peter Clausen , Jonathan Cameron X-Mailer: b4 0.12.4 X-Developer-Signature: v=1; a=ed25519-sha256; t=1705497049; l=1496; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=BVuuhLDo707JKOt+bdBwqZ6OPflzJFQ/eolM0xVT4H0=; b=GE3x8ciebOYIQlKi5vP+jjln85ujBMmIMD9s7kf80gERjmjOcP8FaXOLgAG8AQBoLXYzC7VYC 7/kBqbPF0vNBSojRHg8roz8tYOiw2aSQHYYvyP2+pTUkS8F99kOGOBL X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: iTJwkcfoNhjoy-KJ5CQA9sObNoKAUDCC X-Proofpoint-ORIG-GUID: iTJwkcfoNhjoy-KJ5CQA9sObNoKAUDCC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-17_07,2024-01-17_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 suspectscore=0 adultscore=0 mlxlogscore=738 priorityscore=1501 impostorscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401170094 There's no need to call both irq_get_irq_data() and irqd_get_trigger_type() as we already have an helper for that. This allows for code simplification. Signed-off-by: Nuno Sa --- drivers/iio/imu/adis16480.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c index fe520194a837..b40a55bba30c 100644 --- a/drivers/iio/imu/adis16480.c +++ b/drivers/iio/imu/adis16480.c @@ -1246,18 +1246,11 @@ static int adis16480_config_irq_pin(struct adis16480 *st) { struct device *dev = &st->adis.spi->dev; struct fwnode_handle *fwnode = dev_fwnode(dev); - struct irq_data *desc; enum adis16480_int_pin pin; unsigned int irq_type; uint16_t val; int i, irq = 0; - desc = irq_get_irq_data(st->adis.spi->irq); - if (!desc) { - dev_err(dev, "Could not find IRQ %d\n", irq); - return -EINVAL; - } - /* Disable data ready since the default after reset is on */ val = ADIS16480_DRDY_EN(0); @@ -1285,7 +1278,7 @@ static int adis16480_config_irq_pin(struct adis16480 *st) * configured as positive or negative, corresponding to * IRQ_TYPE_EDGE_RISING or IRQ_TYPE_EDGE_FALLING respectively. */ - irq_type = irqd_get_trigger_type(desc); + irq_type = irq_get_trigger_type(st->adis.spi->irq); if (irq_type == IRQ_TYPE_EDGE_RISING) { /* Default */ val |= ADIS16480_DRDY_POL(1); } else if (irq_type == IRQ_TYPE_EDGE_FALLING) {