From patchwork Thu Feb 22 12:55:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 13567281 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 D0CD660B90; Thu, 22 Feb 2024 12:53:10 +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=1708606392; cv=none; b=rhn+PVe67werINn2ShvrX3PensVZHWSkX3prrG/4HsQXa0rJEhxNWi+g6bF81HyCIEtxU3OSlXR9akHXdzxoJz7z3tMerAImxm/e1HWW5hEnUQIiIiOBxaa+bFCCX1GtdeOzri79ry7MKgkaLr32AwrG8S4WWMvNEeymvRE5UMs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708606392; c=relaxed/simple; bh=v5loQEcfCIJoJhzCt8ePUvNFfs0yZ6UNWSbufLX9E/w=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=KX0HH9622Gzk0EspgxtcNCJNXfQLWh2n8Thnfw/w1uOxT1kBViJ7/Y2wyDCAP/WuIjM79qYk69cvJ47U1mDjOSojX4mSmTGDMdgku5aWKFsvKhyo0b3+j4z9k3wpa9TmTw3uM2yJi5vhTzxoLBI9xMfu1cqZZp6iWwfkOS4E54M= 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; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=FSKXCQpp; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="FSKXCQpp" 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 41MAfFWf016288; Thu, 22 Feb 2024 07:52:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h= from:date:subject:mime-version:content-type :content-transfer-encoding:message-id:references:in-reply-to:to :cc; s=DKIM; bh=cyF9bSmkLHTbgIOAHAAsLTu1Vwr2sxa/02k1qWn90Gs=; b= FSKXCQppkHcG1cynmZDrrh3PC+3loHT/fUViTJ2F5vTmhnHSmj9w/gYU7UtGQdan tpP452HYwwp7xYXcWOto5DcxkEcsj6TF2Pij7T+gl6N8JGibGV1szdL5rC2aT6rr oLD74vLd8KhPdb8yYeNntSOjf1ZBquvLp1gcPnYVbCHfBH6IRTaeEif9oloeQQ72 L2uCzBDEPu0EcH0XCppLKzqRCzG7UC5JNgIc0A8HCiDOvNigPBwjzNremS33xrj7 3164xxYJr5QoY0BDbKLy+QYl8A/MuokwauoP7rAE/baxitfoBnrB37KUNytVXEXt 1BsOruqh8p2nbuuKajoQZg== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0b-00128a01.pphosted.com (PPS) with ESMTPS id 3we4r2gd06-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 07:52:44 -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 41MCqhMF047592 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 22 Feb 2024 07:52:43 -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; Thu, 22 Feb 2024 07:52:42 -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; Thu, 22 Feb 2024 07:52:42 -0500 Received: from [127.0.0.1] ([10.44.3.55]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 41MCqTF8003844; Thu, 22 Feb 2024 07:52:37 -0500 From: Nuno Sa Date: Thu, 22 Feb 2024 13:55:52 +0100 Subject: [PATCH 1/6] iio: temperature: ltc2983: make use of spi_get_device_match_data() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240222-ltc2983-misc-improv-v1-1-cf7d4457e98c@analog.com> References: <20240222-ltc2983-misc-improv-v1-0-cf7d4457e98c@analog.com> In-Reply-To: <20240222-ltc2983-misc-improv-v1-0-cf7d4457e98c@analog.com> To: , CC: Jonathan Cameron , Lars-Peter Clausen , Michael Hennerich , Rob Herring , Krzysztof Kozlowski , Conor Dooley X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708606552; l=784; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=v5loQEcfCIJoJhzCt8ePUvNFfs0yZ6UNWSbufLX9E/w=; b=jAeNPlJa3eRP3Q13idxXiqPKB4MQROM8iCwq1IDj70Y19FB9LBJu4sJk9NbOzIXJUUOi9JVRM h9xprJZPMUsCYlM2gyKKLhgkS2z+LkvWNVi7vbn/3YuTOCMak50/STw X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: uXQU7vJgoqPcdvnFIAX0GwpBJw2D0wkX X-Proofpoint-ORIG-GUID: uXQU7vJgoqPcdvnFIAX0GwpBJw2D0wkX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-22_09,2024-02-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 malwarescore=0 adultscore=0 impostorscore=0 mlxscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 clxscore=1011 mlxlogscore=999 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402220101 Use spi_get_device_match_data() as it simplifies the code. No functional change intended... Signed-off-by: Nuno Sa --- drivers/iio/temperature/ltc2983.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c index fcb96c44d954..acc631857e27 100644 --- a/drivers/iio/temperature/ltc2983.c +++ b/drivers/iio/temperature/ltc2983.c @@ -1614,9 +1614,7 @@ static int ltc2983_probe(struct spi_device *spi) st = iio_priv(indio_dev); - st->info = device_get_match_data(&spi->dev); - if (!st->info) - st->info = (void *)spi_get_device_id(spi)->driver_data; + st->info = spi_get_device_match_data(spi); if (!st->info) return -ENODEV; From patchwork Thu Feb 22 12:55:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 13567286 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 91B3212DD96; Thu, 22 Feb 2024 12:54:33 +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=1708606475; cv=none; b=F9+HUNDXVcQg+ZRVBRGMW8zEFl08qDZw3DwFTJNYY3YaaLma2YQLnV3LK1nsQ/KYCGETTh2+efeZaT8BbAKCsXyZT2RWUsw4j5RZnwIw7TSBFyyV3iDMNZDnhyQfHMK9AEDXiR69QRynAZo08hO9pZdElXTgd/9437rx5oas7ZI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708606475; c=relaxed/simple; bh=rCnlKD8b+gtA03NTNp9yXgTO+UWNnKjvPIXyqlwcN1E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=mwtYvPhNTzmm8xIU/ae3UzWg9BYV64ZktlXhBVwIkDijK6tGgy9jG+eOc6RAFk2ZsBkYcf699xmInjXyJrUCI868lvk7mO7nMBij1Ppb3/IAdrety2VBpAnnU7Et0IxDDY5yPlUlDOnYJF423IU24LK4FsgIlg8UbyvBVO+yPx4= 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; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=k+UP0DkY; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="k+UP0DkY" 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 41MAfLjJ016357; Thu, 22 Feb 2024 07:54:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h= from:date:subject:mime-version:content-type :content-transfer-encoding:message-id:references:in-reply-to:to :cc; s=DKIM; bh=6/J6c7gdgJfA1dTJNS21v/V1aKxV/G+GTCGksVKLi+0=; b= k+UP0DkYLw+sJwbw/M/HvvSGpUlEJAd6+dEjM2fE8+H2verHJhm4ze9doOSFbJZx wQIBvTKvq+xH9SXEqL3cgfbjokme12xctSfoxUAtMFcc5ZdP3kJ+Td2jpuAv+KHv zfiYMhcsnMm1Gzf91zHnrDFSsNxqRPyLnR/JMjVp+OQWfExNvFRFhFFmH0gDXK+z Y3uvIp2jy2ahffBl3nJd+i82KwgBnDLVGnFm6BnFF6UcG4A8KVXNGFXPxfBGuiuY JOm3LJAqavlqt0aoKYwlbzfv/u34OjlvE7Wt3GbivdrWDCNeqsbJIT8vc41S8E9Y /xunMcnxbJ4IjNTgfzs47Q== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0b-00128a01.pphosted.com (PPS) with ESMTPS id 3we4r2gd0a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 07:52:46 -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 41MCqjuS047599 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 22 Feb 2024 07:52:45 -0500 Received: from ASHBCASHYB5.ad.analog.com (10.64.17.133) 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; Thu, 22 Feb 2024 07:52:44 -0500 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBCASHYB5.ad.analog.com (10.64.17.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Thu, 22 Feb 2024 07:52:44 -0500 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Thu, 22 Feb 2024 07:52:44 -0500 Received: from [127.0.0.1] ([10.44.3.55]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 41MCqTF9003844; Thu, 22 Feb 2024 07:52:38 -0500 From: Nuno Sa Date: Thu, 22 Feb 2024 13:55:53 +0100 Subject: [PATCH 2/6] iio: temperature: ltc2983: rename ltc2983_parse_dt() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240222-ltc2983-misc-improv-v1-2-cf7d4457e98c@analog.com> References: <20240222-ltc2983-misc-improv-v1-0-cf7d4457e98c@analog.com> In-Reply-To: <20240222-ltc2983-misc-improv-v1-0-cf7d4457e98c@analog.com> To: , CC: Jonathan Cameron , Lars-Peter Clausen , Michael Hennerich , Rob Herring , Krzysztof Kozlowski , Conor Dooley X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708606552; l=1042; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=rCnlKD8b+gtA03NTNp9yXgTO+UWNnKjvPIXyqlwcN1E=; b=XptwqaqLuZsK3OLCZh1omMt75l8dijwvZWaHOmcDpwPpmKHZBb23F/k4DSXIpEsDDwI/+kuAj nVr5EJz6WT3Dq4TcXsb5F557OgiZV81L+FSbwPHagMYxJoxHG++WTBE X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: 0YTL4vtjmxlrLhxkC8gWkzU0yX6ut8yq X-Proofpoint-ORIG-GUID: 0YTL4vtjmxlrLhxkC8gWkzU0yX6ut8yq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-22_09,2024-02-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 malwarescore=0 adultscore=0 impostorscore=0 mlxscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=598 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402220102 Rename ltc2983_parse_dt() to ltc2983_parse_fw() as there's no explicit dependency on devicetree. No functional change intended... Signed-off-by: Nuno Sa --- drivers/iio/temperature/ltc2983.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c index acc631857e27..23f2d43fc040 100644 --- a/drivers/iio/temperature/ltc2983.c +++ b/drivers/iio/temperature/ltc2983.c @@ -1346,7 +1346,7 @@ static irqreturn_t ltc2983_irq_handler(int irq, void *data) __chan; \ }) -static int ltc2983_parse_dt(struct ltc2983_data *st) +static int ltc2983_parse_fw(struct ltc2983_data *st) { struct device *dev = &st->spi->dev; struct fwnode_handle *child; @@ -1630,7 +1630,7 @@ static int ltc2983_probe(struct spi_device *spi) st->eeprom_key = cpu_to_be32(LTC2983_EEPROM_KEY); spi_set_drvdata(spi, st); - ret = ltc2983_parse_dt(st); + ret = ltc2983_parse_fw(st); if (ret) return ret; From patchwork Thu Feb 22 12:55:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 13567284 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 86DC212FB30; Thu, 22 Feb 2024 12:53:12 +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=1708606394; cv=none; b=sJkrnd832lZXzS7WIWu//SvKKDeqBIG8R96Z4Rcil4dOMYuUk9bKjtOJ/au7KK23o9+ssRpHU/pj0tm+kzrnX14FkE50uvUhSrCro9d4nnuu7kl3ZItgoiSqIzHnFx/HikPuwdkrTHVwb+aixC3LDBI2o/Nrnf6QXYdmqBn3T9o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708606394; c=relaxed/simple; bh=Pn0aueoTaFNTYznkk+Bdw5JxxyZ9XUi3tNSkzkTyPJM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=K71L//koxJXvdm+E0rVweIDkgiicIQyF2/EGypcrCxpTis0YJuE/CJ3p6FQyC1+hoxuWfuw3KgoIG1EZIlkNVdA2/hBDdNkSLjdg1TToGZzfqYRKinvTmoQaWvqufiS8gthEOowFD/Ia8rNamBsclKZTI9CnVurjp34BlF8KoMs= 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; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=ov+jd4/7; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="ov+jd4/7" 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 41M9C1Bj030385; Thu, 22 Feb 2024 07:52:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h= from:date:subject:mime-version:content-type :content-transfer-encoding:message-id:references:in-reply-to:to :cc; s=DKIM; bh=qiolDx4DRN3VvMNQw7t/iZ++A0MYA0o8Z4ocfPigOuU=; b= ov+jd4/7GQkXPx677jhSrkrXeFxDp3SyEV6Qx+Ad3RnoQmu22/xEPuRqzNYwvSOS 49YjJlwUzMg+h8CfgTzcEJDbGiVxdspmhto/Bq5MxqnQlKct3BooHL/CWq73b4aY OUgqP+EnvOomje3Sve6nwlMTGboHXG0LatnUd4w+EcC5TLqxnorfxcrxC1mgNP9W iPSeMFJHRQWT6l3AWxWS6MDER0t+8ZZsgqn9tkGsDJs6MQXPoWDsC7JxK/eze8t0 914uT8v+QlxqyCBFMmge98+t6A5A2M+LFYLsiV0FKDlBs3cZLTKdfCoIwKRHFq4u 6eecnrcHbwdZVZWaqxESuw== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 3wd21ggpj4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 07:52:45 -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 41MCqixk047596 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 22 Feb 2024 07:52:44 -0500 Received: from ASHBCASHYB5.ad.analog.com (10.64.17.133) 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; Thu, 22 Feb 2024 07:52:43 -0500 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBCASHYB5.ad.analog.com (10.64.17.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Thu, 22 Feb 2024 07:52:43 -0500 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Thu, 22 Feb 2024 07:52:43 -0500 Received: from [127.0.0.1] ([10.44.3.55]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 41MCqTFA003844; Thu, 22 Feb 2024 07:52:39 -0500 From: Nuno Sa Date: Thu, 22 Feb 2024 13:55:54 +0100 Subject: [PATCH 3/6] iio: temperature: ltc2983: convert to dev_err_probe() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240222-ltc2983-misc-improv-v1-3-cf7d4457e98c@analog.com> References: <20240222-ltc2983-misc-improv-v1-0-cf7d4457e98c@analog.com> In-Reply-To: <20240222-ltc2983-misc-improv-v1-0-cf7d4457e98c@analog.com> To: , CC: Jonathan Cameron , Lars-Peter Clausen , Michael Hennerich , Rob Herring , Krzysztof Kozlowski , Conor Dooley X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708606552; l=17248; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=Pn0aueoTaFNTYznkk+Bdw5JxxyZ9XUi3tNSkzkTyPJM=; b=n5bTgwiw99PGee0CZBefaral4qOukdXXgqifg8qr1PGc5MKB0y137Yl0x0UmZnQ3vblcjrV88 WxKlBKFLb23BHDqnUQz4A6ZDkJh+qOvagjnOz/gCw/CbBHgEmfg3vHA X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: lJBrd0Br-ctmoNhUCd8e7NfSX0DYebjj X-Proofpoint-ORIG-GUID: lJBrd0Br-ctmoNhUCd8e7NfSX0DYebjj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-22_09,2024-02-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 adultscore=0 malwarescore=0 spamscore=0 lowpriorityscore=0 phishscore=0 impostorscore=0 mlxlogscore=999 mlxscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402220101 Use dev_err_probe() in the probe() path. While at it, made some simple improvements: * Declare a struct device *dev helper. This also makes the style more consistent (some places the helper was used and not in other places); * Explicitly included the err.h and errno.h headers; * Removed an useless else if(). Signed-off-by: Nuno Sa --- drivers/iio/temperature/ltc2983.c | 190 ++++++++++++++++++++------------------ 1 file changed, 98 insertions(+), 92 deletions(-) diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c index 23f2d43fc040..4b096aa3fbd8 100644 --- a/drivers/iio/temperature/ltc2983.c +++ b/drivers/iio/temperature/ltc2983.c @@ -8,6 +8,8 @@ #include #include #include +#include +#include #include #include #include @@ -656,11 +658,12 @@ ltc2983_thermocouple_new(const struct fwnode_handle *child, struct ltc2983_data const struct ltc2983_sensor *sensor) { struct ltc2983_thermocouple *thermo; + struct device *dev = &st->spi->dev; struct fwnode_handle *ref; u32 oc_current; int ret; - thermo = devm_kzalloc(&st->spi->dev, sizeof(*thermo), GFP_KERNEL); + thermo = devm_kzalloc(dev, sizeof(*thermo), GFP_KERNEL); if (!thermo) return ERR_PTR(-ENOMEM); @@ -687,8 +690,9 @@ ltc2983_thermocouple_new(const struct fwnode_handle *child, struct ltc2983_data LTC2983_THERMOCOUPLE_OC_CURR(3); break; default: - dev_err(&st->spi->dev, - "Invalid open circuit current:%u", oc_current); + dev_err_probe(dev, -EINVAL, + "Invalid open circuit current:%u", + oc_current); return ERR_PTR(-EINVAL); } @@ -697,9 +701,9 @@ ltc2983_thermocouple_new(const struct fwnode_handle *child, struct ltc2983_data /* validate channel index */ if (!(thermo->sensor_config & LTC2983_THERMOCOUPLE_DIFF_MASK) && sensor->chan < LTC2983_DIFFERENTIAL_CHAN_MIN) { - dev_err(&st->spi->dev, - "Invalid chann:%d for differential thermocouple", - sensor->chan); + dev_err_probe(dev, -EINVAL, + "Invalid chann:%d for differential thermocouple", + sensor->chan); return ERR_PTR(-EINVAL); } @@ -713,7 +717,7 @@ ltc2983_thermocouple_new(const struct fwnode_handle *child, struct ltc2983_data * This would be catched later but we can just return * the error right away. */ - dev_err(&st->spi->dev, "Property reg must be given\n"); + dev_err_probe(dev, ret, "Property reg must be given\n"); goto fail; } } @@ -759,13 +763,14 @@ ltc2983_rtd_new(const struct fwnode_handle *child, struct ltc2983_data *st, ref = fwnode_find_reference(child, "adi,rsense-handle", 0); if (IS_ERR(ref)) { - dev_err(dev, "Property adi,rsense-handle missing or invalid"); + dev_err_probe(dev, PTR_ERR(ref), + "Property adi,rsense-handle missing or invalid"); return ERR_CAST(ref); } ret = fwnode_property_read_u32(ref, "reg", &rtd->r_sense_chan); if (ret) { - dev_err(dev, "Property reg must be given\n"); + dev_err_probe(dev, ret, "Property reg must be given\n"); goto fail; } @@ -786,8 +791,9 @@ ltc2983_rtd_new(const struct fwnode_handle *child, struct ltc2983_data *st, rtd->sensor_config = LTC2983_RTD_N_WIRES(3); break; default: - dev_err(dev, "Invalid number of wires:%u\n", n_wires); - ret = -EINVAL; + ret = dev_err_probe(dev, -EINVAL, + "Invalid number of wires:%u\n", + n_wires); goto fail; } } @@ -796,9 +802,8 @@ ltc2983_rtd_new(const struct fwnode_handle *child, struct ltc2983_data *st, /* Current rotation is only available with rsense sharing */ if (fwnode_property_read_bool(child, "adi,current-rotate")) { if (n_wires == 2 || n_wires == 3) { - dev_err(dev, - "Rotation not allowed for 2/3 Wire RTDs"); - ret = -EINVAL; + ret = dev_err_probe(dev, -EINVAL, + "Rotation not allowed for 2/3 Wire RTDs"); goto fail; } rtd->sensor_config |= LTC2983_RTD_C_ROTATE(1); @@ -825,28 +830,24 @@ ltc2983_rtd_new(const struct fwnode_handle *child, struct ltc2983_data *st, == LTC2983_RTD_KELVIN_R_SENSE_MASK) && (rtd->r_sense_chan <= min)) { /* kelvin rsense*/ - dev_err(dev, - "Invalid rsense chann:%d to use in kelvin rsense", - rtd->r_sense_chan); - - ret = -EINVAL; + ret = dev_err_probe(dev, -EINVAL, + "Invalid rsense chann:%d to use in kelvin rsense", + rtd->r_sense_chan); goto fail; } if (sensor->chan < min || sensor->chan > max) { - dev_err(dev, "Invalid chann:%d for the rtd config", - sensor->chan); - - ret = -EINVAL; + ret = dev_err_probe(dev, -EINVAL, + "Invalid chann:%d for the rtd config", + sensor->chan); goto fail; } } else { /* same as differential case */ if (sensor->chan < LTC2983_DIFFERENTIAL_CHAN_MIN) { - dev_err(&st->spi->dev, - "Invalid chann:%d for RTD", sensor->chan); - - ret = -EINVAL; + ret = dev_err_probe(dev, -EINVAL, + "Invalid chann:%d for RTD", + sensor->chan); goto fail; } } @@ -898,10 +899,9 @@ ltc2983_rtd_new(const struct fwnode_handle *child, struct ltc2983_data *st, rtd->excitation_current = 0x08; break; default: - dev_err(&st->spi->dev, - "Invalid value for excitation current(%u)", - excitation_current); - ret = -EINVAL; + ret = dev_err_probe(dev, -EINVAL, + "Invalid value for excitation current(%u)", + excitation_current); goto fail; } } @@ -931,13 +931,15 @@ ltc2983_thermistor_new(const struct fwnode_handle *child, struct ltc2983_data *s ref = fwnode_find_reference(child, "adi,rsense-handle", 0); if (IS_ERR(ref)) { - dev_err(dev, "Property adi,rsense-handle missing or invalid"); + dev_err_probe(dev, PTR_ERR(ref), + "Property adi,rsense-handle missing or invalid"); return ERR_CAST(ref); } ret = fwnode_property_read_u32(ref, "reg", &thermistor->r_sense_chan); if (ret) { - dev_err(dev, "rsense channel must be configured...\n"); + dev_err_probe(dev, ret, + "rsense channel must be configured...\n"); goto fail; } @@ -955,10 +957,9 @@ ltc2983_thermistor_new(const struct fwnode_handle *child, struct ltc2983_data *s /* validate channel index */ if (!(thermistor->sensor_config & LTC2983_THERMISTOR_DIFF_MASK) && sensor->chan < LTC2983_DIFFERENTIAL_CHAN_MIN) { - dev_err(&st->spi->dev, - "Invalid chann:%d for differential thermistor", - sensor->chan); - ret = -EINVAL; + ret = dev_err_probe(dev, -EINVAL, + "Invalid chann:%d for differential thermistor", + sensor->chan); goto fail; } @@ -1003,9 +1004,8 @@ ltc2983_thermistor_new(const struct fwnode_handle *child, struct ltc2983_data *s /* auto range */ if (sensor->type >= LTC2983_SENSOR_THERMISTOR_STEINHART) { - dev_err(&st->spi->dev, - "Auto Range not allowed for custom sensors\n"); - ret = -EINVAL; + ret = dev_err_probe(dev, -EINVAL, + "Auto Range not allowed for custom sensors\n"); goto fail; } thermistor->excitation_current = 0x0c; @@ -1044,10 +1044,9 @@ ltc2983_thermistor_new(const struct fwnode_handle *child, struct ltc2983_data *s thermistor->excitation_current = 0x0b; break; default: - dev_err(&st->spi->dev, - "Invalid value for excitation current(%u)", - excitation_current); - ret = -EINVAL; + ret = dev_err_probe(dev, -EINVAL, + "Invalid value for excitation current(%u)", + excitation_current); goto fail; } } @@ -1063,11 +1062,12 @@ static struct ltc2983_sensor * ltc2983_diode_new(const struct fwnode_handle *child, const struct ltc2983_data *st, const struct ltc2983_sensor *sensor) { + struct device *dev = &st->spi->dev; struct ltc2983_diode *diode; u32 temp = 0, excitation_current = 0; int ret; - diode = devm_kzalloc(&st->spi->dev, sizeof(*diode), GFP_KERNEL); + diode = devm_kzalloc(dev, sizeof(*diode), GFP_KERNEL); if (!diode) return ERR_PTR(-ENOMEM); @@ -1083,9 +1083,9 @@ ltc2983_diode_new(const struct fwnode_handle *child, const struct ltc2983_data * /* validate channel index */ if (!(diode->sensor_config & LTC2983_DIODE_DIFF_MASK) && sensor->chan < LTC2983_DIFFERENTIAL_CHAN_MIN) { - dev_err(&st->spi->dev, - "Invalid chann:%d for differential thermistor", - sensor->chan); + dev_err_probe(dev, -EINVAL, + "Invalid chann:%d for differential thermistor", + sensor->chan); return ERR_PTR(-EINVAL); } /* set common parameters */ @@ -1109,9 +1109,9 @@ ltc2983_diode_new(const struct fwnode_handle *child, const struct ltc2983_data * diode->excitation_current = 0x03; break; default: - dev_err(&st->spi->dev, - "Invalid value for excitation current(%u)", - excitation_current); + dev_err_probe(dev, -EINVAL, + "Invalid value for excitation current(%u)", + excitation_current); return ERR_PTR(-EINVAL); } } @@ -1128,24 +1128,26 @@ static struct ltc2983_sensor *ltc2983_r_sense_new(struct fwnode_handle *child, struct ltc2983_data *st, const struct ltc2983_sensor *sensor) { + struct device *dev = &st->spi->dev; struct ltc2983_rsense *rsense; int ret; u32 temp; - rsense = devm_kzalloc(&st->spi->dev, sizeof(*rsense), GFP_KERNEL); + rsense = devm_kzalloc(dev, sizeof(*rsense), GFP_KERNEL); if (!rsense) return ERR_PTR(-ENOMEM); /* validate channel index */ if (sensor->chan < LTC2983_DIFFERENTIAL_CHAN_MIN) { - dev_err(&st->spi->dev, "Invalid chann:%d for r_sense", - sensor->chan); + dev_err_probe(dev, -EINVAL, "Invalid chann:%d for r_sense", + sensor->chan); return ERR_PTR(-EINVAL); } ret = fwnode_property_read_u32(child, "adi,rsense-val-milli-ohms", &temp); if (ret) { - dev_err(&st->spi->dev, "Property adi,rsense-val-milli-ohms missing\n"); + dev_err_probe(dev, -EINVAL, + "Property adi,rsense-val-milli-ohms missing\n"); return ERR_PTR(-EINVAL); } /* @@ -1166,9 +1168,10 @@ static struct ltc2983_sensor *ltc2983_adc_new(struct fwnode_handle *child, struct ltc2983_data *st, const struct ltc2983_sensor *sensor) { + struct device *dev = &st->spi->dev; struct ltc2983_adc *adc; - adc = devm_kzalloc(&st->spi->dev, sizeof(*adc), GFP_KERNEL); + adc = devm_kzalloc(dev, sizeof(*adc), GFP_KERNEL); if (!adc) return ERR_PTR(-ENOMEM); @@ -1177,8 +1180,9 @@ static struct ltc2983_sensor *ltc2983_adc_new(struct fwnode_handle *child, if (!adc->single_ended && sensor->chan < LTC2983_DIFFERENTIAL_CHAN_MIN) { - dev_err(&st->spi->dev, "Invalid chan:%d for differential adc\n", - sensor->chan); + dev_err_probe(dev, -EINVAL, + "Invalid chan:%d for differential adc\n", + sensor->chan); return ERR_PTR(-EINVAL); } /* set common parameters */ @@ -1192,9 +1196,10 @@ static struct ltc2983_sensor *ltc2983_temp_new(struct fwnode_handle *child, struct ltc2983_data *st, const struct ltc2983_sensor *sensor) { + struct device *dev = &st->spi->dev; struct ltc2983_temp *temp; - temp = devm_kzalloc(&st->spi->dev, sizeof(*temp), GFP_KERNEL); + temp = devm_kzalloc(dev, sizeof(*temp), GFP_KERNEL); if (!temp) return ERR_PTR(-ENOMEM); @@ -1203,8 +1208,8 @@ static struct ltc2983_sensor *ltc2983_temp_new(struct fwnode_handle *child, if (!temp->single_ended && sensor->chan < LTC2983_DIFFERENTIAL_CHAN_MIN) { - dev_err(&st->spi->dev, "Invalid chan:%d for differential temp\n", - sensor->chan); + dev_err_probe(dev, -EINVAL, "Invalid chan:%d for differential temp\n", + sensor->chan); return ERR_PTR(-EINVAL); } @@ -1357,10 +1362,9 @@ static int ltc2983_parse_fw(struct ltc2983_data *st) device_property_read_u32(dev, "adi,filter-notch-freq", &st->filter_notch_freq); st->num_channels = device_get_child_node_count(dev); - if (!st->num_channels) { - dev_err(&st->spi->dev, "At least one channel must be given!"); - return -EINVAL; - } + if (!st->num_channels) + return dev_err_probe(dev, -EINVAL, + "At least one channel must be given!"); st->sensors = devm_kcalloc(dev, st->num_channels, sizeof(*st->sensors), GFP_KERNEL); @@ -1373,27 +1377,31 @@ static int ltc2983_parse_fw(struct ltc2983_data *st) ret = fwnode_property_read_u32(child, "reg", &sensor.chan); if (ret) { - dev_err(dev, "reg property must given for child nodes\n"); + dev_err_probe(dev, ret, + "reg property must given for child nodes\n"); goto put_child; } /* check if we have a valid channel */ if (sensor.chan < LTC2983_MIN_CHANNELS_NR || sensor.chan > st->info->max_channels_nr) { - ret = -EINVAL; - dev_err(dev, "chan:%d must be from %u to %u\n", sensor.chan, - LTC2983_MIN_CHANNELS_NR, st->info->max_channels_nr); + ret = dev_err_probe(dev, -EINVAL, + "chan:%d must be from %u to %u\n", + sensor.chan, LTC2983_MIN_CHANNELS_NR, + st->info->max_channels_nr); goto put_child; - } else if (channel_avail_mask & BIT(sensor.chan)) { - ret = -EINVAL; - dev_err(dev, "chan:%d already in use\n", sensor.chan); + } + + if (channel_avail_mask & BIT(sensor.chan)) { + ret = dev_err_probe(dev, -EINVAL, "chan:%d already in use\n", + sensor.chan); goto put_child; } ret = fwnode_property_read_u32(child, "adi,sensor-type", &sensor.type); if (ret) { - dev_err(dev, - "adi,sensor-type property must given for child nodes\n"); + dev_err_probe(dev, ret, + "adi,sensor-type property must given for child nodes\n"); goto put_child; } @@ -1426,15 +1434,14 @@ static int ltc2983_parse_fw(struct ltc2983_data *st) sensor.type == LTC2983_SENSOR_ACTIVE_TEMP) { st->sensors[chan] = ltc2983_temp_new(child, st, &sensor); } else { - dev_err(dev, "Unknown sensor type %d\n", sensor.type); - ret = -EINVAL; + ret = dev_err_probe(dev, -EINVAL, "Unknown sensor type %d\n", + sensor.type); goto put_child; } if (IS_ERR(st->sensors[chan])) { - dev_err(dev, "Failed to create sensor %ld", - PTR_ERR(st->sensors[chan])); - ret = PTR_ERR(st->sensors[chan]); + ret = dev_err_probe(dev, PTR_ERR(st->sensors[chan]), + "Failed to create sensor\n"); goto put_child; } /* set generic sensor parameters */ @@ -1602,13 +1609,14 @@ static const struct iio_info ltc2983_iio_info = { static int ltc2983_probe(struct spi_device *spi) { + struct device *dev = &spi->dev; struct ltc2983_data *st; struct iio_dev *indio_dev; struct gpio_desc *gpio; const char *name = spi_get_device_id(spi)->name; int ret; - indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); + indio_dev = devm_iio_device_alloc(dev, sizeof(*st)); if (!indio_dev) return -ENOMEM; @@ -1619,10 +1627,9 @@ static int ltc2983_probe(struct spi_device *spi) return -ENODEV; st->regmap = devm_regmap_init_spi(spi, <c2983_regmap_config); - if (IS_ERR(st->regmap)) { - dev_err(&spi->dev, "Failed to initialize regmap\n"); - return PTR_ERR(st->regmap); - } + if (IS_ERR(st->regmap)) + return dev_err_probe(dev, PTR_ERR(st->regmap), + "Failed to initialize regmap\n"); mutex_init(&st->lock); init_completion(&st->completion); @@ -1634,7 +1641,7 @@ static int ltc2983_probe(struct spi_device *spi) if (ret) return ret; - gpio = devm_gpiod_get_optional(&st->spi->dev, "reset", GPIOD_OUT_HIGH); + gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(gpio)) return PTR_ERR(gpio); @@ -1644,7 +1651,7 @@ static int ltc2983_probe(struct spi_device *spi) gpiod_set_value_cansleep(gpio, 0); } - st->iio_chan = devm_kzalloc(&spi->dev, + st->iio_chan = devm_kzalloc(dev, st->iio_channels * sizeof(*st->iio_chan), GFP_KERNEL); if (!st->iio_chan) @@ -1654,12 +1661,11 @@ static int ltc2983_probe(struct spi_device *spi) if (ret) return ret; - ret = devm_request_irq(&spi->dev, spi->irq, ltc2983_irq_handler, + ret = devm_request_irq(dev, spi->irq, ltc2983_irq_handler, IRQF_TRIGGER_RISING, name, st); - if (ret) { - dev_err(&spi->dev, "failed to request an irq, %d", ret); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, "failed to request an irq, %d", + ret); if (st->info->has_eeprom) { ret = ltc2983_eeprom_cmd(st, LTC2983_EEPROM_WRITE_CMD, @@ -1676,7 +1682,7 @@ static int ltc2983_probe(struct spi_device *spi) indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->info = <c2983_iio_info; - return devm_iio_device_register(&spi->dev, indio_dev); + return devm_iio_device_register(dev, indio_dev); } static int ltc2983_resume(struct device *dev) From patchwork Thu Feb 22 12:55:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 13567283 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 86DFA12FF94; Thu, 22 Feb 2024 12:53:12 +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=1708606394; cv=none; b=C8vfBYC5vAff1Me0SqSxM0I6ZYpPB4exa3KntoRtqvL7ha08GPrhJVRr5k/sD+DAPr6+ywZRB44lf+hRDbtZEOMkSaNLe/1MsDUyi5t83AAcK+VJSHMGCf0qUBGYc7ei/nvC8LpOMOaEUubIHKsSgrPamhgfgT5faj7YVP8zOGk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708606394; c=relaxed/simple; bh=LwEIca91rqeRRZZ44qei8F/5sbBn5656SlWnEtYijoo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=nCTD1UTbBoWYDcO0NpAEx/9dV5luABfVPXOK5rLri+uz4gt1in8DkPpaKdfLiAeeOYzEvbDNNOcvVlENX6CVxnDrXzKIgR4P/YGvFUdygqEONBCw56Tp98bIvEEaRaq16n3aYhg9fJsxYngc8Kg7bBmvrM3WoCfCk6OWvfOj2jg= 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; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=KMX09TNk; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="KMX09TNk" 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 41M9IUw4030381; Thu, 22 Feb 2024 07:52:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h= from:date:subject:mime-version:content-type :content-transfer-encoding:message-id:references:in-reply-to:to :cc; s=DKIM; bh=GxFUx0q2HfPn52sbsbR+ryguODdrJcJ8S2Inz5zweJ0=; b= KMX09TNkixrFYLm+74+UpUL3J4ky67+wQndsZRyUr2c/g3fi7ljTaewOBvE7U6H7 4S5f7d+z/FTPeKuGR4GCuH2+qytYJfkHcVPSgAqBbJpuONQPPo3hoE5z95aujVK/ Kbd66sSfEITdHet5qj+kkhKvDaQ4vbbDXdtiBIM9zC56Z/gCF7Qn0kmP0kRiXSax 8idYAW5cStb931fzq0N3GvRlAE0RihxRpdTsMV4pLDSraGcexra0/TBvCT5nduGJ wZvhqoWS5egJMjeKqYpwsyuhsFpWx1pFTi8AZS7ksQr/axYq1cjRwrcALKV90x80 8LDHMU7jSAQwxdXvTbBAqA== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 3wd21ggpj7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 07:52:47 -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 41MCqkif047603 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 22 Feb 2024 07:52:46 -0500 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) 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; Thu, 22 Feb 2024 07:52:45 -0500 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Thu, 22 Feb 2024 07:52:45 -0500 Received: from [127.0.0.1] ([10.44.3.55]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 41MCqTFB003844; Thu, 22 Feb 2024 07:52:40 -0500 From: Nuno Sa Date: Thu, 22 Feb 2024 13:55:55 +0100 Subject: [PATCH 4/6] iio: temperature: ltc2983: explicitly set the name in chip_info Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240222-ltc2983-misc-improv-v1-4-cf7d4457e98c@analog.com> References: <20240222-ltc2983-misc-improv-v1-0-cf7d4457e98c@analog.com> In-Reply-To: <20240222-ltc2983-misc-improv-v1-0-cf7d4457e98c@analog.com> To: , CC: Jonathan Cameron , Lars-Peter Clausen , Michael Hennerich , Rob Herring , Krzysztof Kozlowski , Conor Dooley X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708606552; l=3302; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=LwEIca91rqeRRZZ44qei8F/5sbBn5656SlWnEtYijoo=; b=vNMsXwg9SRRSttmByciv4dDBR/2YNJlGNd4HWmfKmZSAZ0fAjsq+18zNfA9JOmW/TsH+76LQ0 nRC3pV9I6ICAAIFhHqimNfDcMSOI2MkM+4jbfvzpCFDKg3ZeLjboDD9 X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: IplNDVTQleyhDLj5WFHGia6uUuvlYQd- X-Proofpoint-ORIG-GUID: IplNDVTQleyhDLj5WFHGia6uUuvlYQd- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-22_09,2024-02-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 adultscore=0 malwarescore=0 spamscore=0 lowpriorityscore=0 phishscore=0 impostorscore=0 mlxlogscore=758 mlxscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402220101 Getting the part name with 'spi_get_device_id(spi)->name' is not a very good pattern. Hence, explicitly add the name in the struct chip_info and use that instead. Signed-off-by: Nuno Sa --- drivers/iio/temperature/ltc2983.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c index 4b096aa3fbd8..9bd53e102ab3 100644 --- a/drivers/iio/temperature/ltc2983.c +++ b/drivers/iio/temperature/ltc2983.c @@ -209,6 +209,7 @@ enum { container_of(_sensor, struct ltc2983_temp, sensor) struct ltc2983_chip_info { + const char *name; unsigned int max_channels_nr; bool has_temp; bool has_eeprom; @@ -1613,7 +1614,6 @@ static int ltc2983_probe(struct spi_device *spi) struct ltc2983_data *st; struct iio_dev *indio_dev; struct gpio_desc *gpio; - const char *name = spi_get_device_id(spi)->name; int ret; indio_dev = devm_iio_device_alloc(dev, sizeof(*st)); @@ -1662,7 +1662,7 @@ static int ltc2983_probe(struct spi_device *spi) return ret; ret = devm_request_irq(dev, spi->irq, ltc2983_irq_handler, - IRQF_TRIGGER_RISING, name, st); + IRQF_TRIGGER_RISING, st->info->name, st); if (ret) return dev_err_probe(dev, ret, "failed to request an irq, %d", ret); @@ -1676,7 +1676,7 @@ static int ltc2983_probe(struct spi_device *spi) return ret; } - indio_dev->name = name; + indio_dev->name = st->info->name; indio_dev->num_channels = st->iio_channels; indio_dev->channels = st->iio_chan; indio_dev->modes = INDIO_DIRECT_MODE; @@ -1707,15 +1707,25 @@ static DEFINE_SIMPLE_DEV_PM_OPS(ltc2983_pm_ops, ltc2983_suspend, ltc2983_resume); static const struct ltc2983_chip_info ltc2983_chip_info_data = { + .name = "ltc2983", .max_channels_nr = 20, }; static const struct ltc2983_chip_info ltc2984_chip_info_data = { + .name = "ltc2984", .max_channels_nr = 20, .has_eeprom = true, }; static const struct ltc2983_chip_info ltc2986_chip_info_data = { + .name = "ltc2986", + .max_channels_nr = 10, + .has_temp = true, + .has_eeprom = true, +}; + +static const struct ltc2983_chip_info ltm2985_chip_info_data = { + .name = "ltm2985", .max_channels_nr = 10, .has_temp = true, .has_eeprom = true, @@ -1725,7 +1735,7 @@ static const struct spi_device_id ltc2983_id_table[] = { { "ltc2983", (kernel_ulong_t)<c2983_chip_info_data }, { "ltc2984", (kernel_ulong_t)<c2984_chip_info_data }, { "ltc2986", (kernel_ulong_t)<c2986_chip_info_data }, - { "ltm2985", (kernel_ulong_t)<c2986_chip_info_data }, + { "ltm2985", (kernel_ulong_t)<m2985_chip_info_data }, {}, }; MODULE_DEVICE_TABLE(spi, ltc2983_id_table); @@ -1734,7 +1744,7 @@ static const struct of_device_id ltc2983_of_match[] = { { .compatible = "adi,ltc2983", .data = <c2983_chip_info_data }, { .compatible = "adi,ltc2984", .data = <c2984_chip_info_data }, { .compatible = "adi,ltc2986", .data = <c2986_chip_info_data }, - { .compatible = "adi,ltm2985", .data = <c2986_chip_info_data }, + { .compatible = "adi,ltm2985", .data = <m2985_chip_info_data }, {}, }; MODULE_DEVICE_TABLE(of, ltc2983_of_match); From patchwork Thu Feb 22 12:55:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 13567285 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 83FF35FBA5; Thu, 22 Feb 2024 12:54:33 +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=1708606475; cv=none; b=ZhXFgaDBxODHXdLyhQC001U4IOqhnjanLsuKutjgZxrW9LqMjKYH5oY+Jy6bq9RRg94rNV6u6+T3e4aYU/st2x/uOrUplngrlT8wuVwxNUhPr/KHeAFG2tYjp3dz69m3FbTHO6rIWI04J2PLGVmSsxZsg7KXHqm5heeNULORFVo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708606475; c=relaxed/simple; bh=ZTYlvwiK9vVN69GcFo/qAmR8YHixWv+wRqRxKtADJM8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=VGeeyhoRYkuHGRk9Bqbi7wzg7XRBvvcUX8cDyxHdi4kZ0/kDII9uYlXG4y+9NyDuxSjV1es3Fjb439IdiZAeaSxHVIt92veOuPAuDtgohT6hKySmicdpgBjwWhpC2S20pPGcKwmJ4Bh3VI6x5NKSbEM2UujJfIJGUPCGspMcoP0= 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; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=I8icC6XX; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="I8icC6XX" 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 41MAfYYs016571; Thu, 22 Feb 2024 07:54:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h= from:date:subject:mime-version:content-type :content-transfer-encoding:message-id:references:in-reply-to:to :cc; s=DKIM; bh=VIv4rW3ent6lnScEcJpfZujhTy9YTm3BxVqW5yvh6Yg=; b= I8icC6XXa7kUufc6hj3TIcx9kjCI2V7nyRAg5xTLlHD7k3J0ALLXU+CrhCEfwu7H 9s3UqOqNz1LIf6nODslq9wKB7/x6xD7eJLMCRkL4z6F6vXuykP2Yz2ixwRBvQk/F MuXXHhQ8IBZolx/yOgi+buB8yWU6HbrKrlwcURdCV6im3xcPIoUwyAR3M+7QGADT LdMvv5JHuPAhz2RsZGRJFI9CGtEJSD+itOs97vcxlQDXmi7wFpY/qienvm7y8CZF Yb0VlflpyoVMeaKxQc7WoWLyc57jhyA7Z5Daq2kqfexRuW/dlugVfT0GSfQAOJUL Z6bsSTUXgyFc7nPym1ogng== Received: from nwd2mta3.analog.com ([137.71.173.56]) by mx0b-00128a01.pphosted.com (PPS) with ESMTPS id 3we4r2gd0d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 07:52: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 41MCqmxh047608 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 22 Feb 2024 07:52:48 -0500 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) 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; Thu, 22 Feb 2024 07:52:47 -0500 Received: from zeus.spd.analog.com (10.66.68.11) by ashbmbx9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.2.986.14 via Frontend Transport; Thu, 22 Feb 2024 07:52:47 -0500 Received: from [127.0.0.1] ([10.44.3.55]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 41MCqTFC003844; Thu, 22 Feb 2024 07:52:41 -0500 From: Nuno Sa Date: Thu, 22 Feb 2024 13:55:56 +0100 Subject: [PATCH 5/6] dt-bindings: iio: temperature: ltc2983: document power supply Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240222-ltc2983-misc-improv-v1-5-cf7d4457e98c@analog.com> References: <20240222-ltc2983-misc-improv-v1-0-cf7d4457e98c@analog.com> In-Reply-To: <20240222-ltc2983-misc-improv-v1-0-cf7d4457e98c@analog.com> To: , CC: Jonathan Cameron , Lars-Peter Clausen , Michael Hennerich , Rob Herring , Krzysztof Kozlowski , Conor Dooley X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708606552; l=790; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=ZTYlvwiK9vVN69GcFo/qAmR8YHixWv+wRqRxKtADJM8=; b=5Kvk8Qq8zutX1xjjUfZ1u/PiWOgN624RxfnuvZr073l85r9qM4ehzGV9yGpok2dzihVBdMRZJ ZvSAKD2D5BABaIk8d8rSPegzuA2llibsTOavYnilBu6ZqCXgM3vv9Uv X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: 7d9XSzTIf7ouIcIZ96wO9ODMD47ukuXj X-Proofpoint-ORIG-GUID: 7d9XSzTIf7ouIcIZ96wO9ODMD47ukuXj X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-22_09,2024-02-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 malwarescore=0 adultscore=0 impostorscore=0 mlxscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 clxscore=1015 mlxlogscore=745 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402220102 Add a property for the VDD power supply regulator. Signed-off-by: Nuno Sa --- Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml index dbb85135fd66..8aae867a770a 100644 --- a/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml +++ b/Documentation/devicetree/bindings/iio/temperature/adi,ltc2983.yaml @@ -57,6 +57,8 @@ properties: interrupts: maxItems: 1 + vdd-supply: true + adi,mux-delay-config-us: description: | Extra delay prior to each conversion, in addition to the internal 1ms From patchwork Thu Feb 22 12:55:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 13567282 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 828E378B52; Thu, 22 Feb 2024 12:53:11 +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=1708606393; cv=none; b=Zk/aZBsmYTW53umOTux6WUFLQQ+XL1FIuSJhzDK/7OAhnxTlE0TVyRqMar/3hCx7CRHOdG2Aq2Ocd5fPcA3H+PFNOe+QGi4kks8gn9RtHI5lOilPq/E7Tp/oG9VsKQtDOXMxlHwMUW7tZNrAMMiMw176fVo5TIeTGEq9EdskTHo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708606393; c=relaxed/simple; bh=/VGP64v3Ln6cjGmWsvRX46hu6V3ENfphnkCHqlx0f7I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-ID:References: In-Reply-To:To:CC; b=DqyZMLvE4G632dzpx7/bz2A0GuhbrmQtgLbKvytddEAvadbP1Fnq6tMKdJw88A1WIY8IJZ6LV+YlC+KX3XKkUxHXTUnvkmNNE/H2tdOWYCiRUxWCdOVB7WaTuTPTDjUPwuqB6J939O7yd2TRQKoeSnOEE5XdlwJDrk+xZVpohi0= 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; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b=tgNpbBB/; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=analog.com header.i=@analog.com header.b="tgNpbBB/" 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 41M9c7PH014757; Thu, 22 Feb 2024 07:52:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.com; h= from:date:subject:mime-version:content-type :content-transfer-encoding:message-id:references:in-reply-to:to :cc; s=DKIM; bh=LaMqFHtNFmd6l77ZP4bQThWXZA8vZWBqG3tx5vyLwII=; b= tgNpbBB/f1iND48/mN+TVXco+0J84P+B6GPBDUMkIildJTe5tKBhrL7wmJ/XiHsH tGT3TLMN3zzpHFO/eoVYP7VRT2t5iRnbLa4Wxmhka8OB8+O34BrXU9CY/f7A8oZ8 RTfA9P80DAAsndeBu0n3NYeLc2J05Yvoqf4yKIqEuy+UGa8YTZNK51Eijtd2EEKM Mu3nhcZTF7Mv5Uyc2zSlecpzCpWywIt+65qrNArO6B6eNEwiIxv2VwSSoi1Xf8v9 r1m/Qs6u21TJq9UViN0G8fEUQu4z/4lNkSYSfFW/yLaiu7X3hO0/9TqDoEWs92B6 fzt5RSCQ0ZUHPWjiIZz4Kg== Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com (PPS) with ESMTPS id 3wd21p8ka1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 07:52:51 -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 41MCqo97022907 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 22 Feb 2024 07:52:50 -0500 Received: from ASHBCASHYB5.ad.analog.com (10.64.17.133) 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; Thu, 22 Feb 2024 07:52:49 -0500 Received: from ASHBMBX8.ad.analog.com (10.64.17.5) by ASHBCASHYB5.ad.analog.com (10.64.17.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.14; Thu, 22 Feb 2024 07:52: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; Thu, 22 Feb 2024 07:52:49 -0500 Received: from [127.0.0.1] ([10.44.3.55]) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 41MCqTFD003844; Thu, 22 Feb 2024 07:52:42 -0500 From: Nuno Sa Date: Thu, 22 Feb 2024 13:55:57 +0100 Subject: [PATCH 6/6] iio: temperature: ltc2983: support vdd regulator Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <20240222-ltc2983-misc-improv-v1-6-cf7d4457e98c@analog.com> References: <20240222-ltc2983-misc-improv-v1-0-cf7d4457e98c@analog.com> In-Reply-To: <20240222-ltc2983-misc-improv-v1-0-cf7d4457e98c@analog.com> To: , CC: Jonathan Cameron , Lars-Peter Clausen , Michael Hennerich , Rob Herring , Krzysztof Kozlowski , Conor Dooley X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1708606552; l=908; i=nuno.sa@analog.com; s=20231116; h=from:subject:message-id; bh=/VGP64v3Ln6cjGmWsvRX46hu6V3ENfphnkCHqlx0f7I=; b=OVb3zTmwz3mChSUZxEkIHU1dIFUyqWu4i8dLdcgO7gML/JGmqv/jKr/XQ88gpV2taFeILFjMj WAavMSAIgw+C6Fy8riX7R74cGIHT2S/bnTPSJdvEQD0y57747lRCHQv X-Developer-Key: i=nuno.sa@analog.com; a=ed25519; pk=3NQwYA013OUYZsmDFBf8rmyyr5iQlxV/9H4/Df83o1E= X-ADIRuleOP-NewSCL: Rule Triggered X-Proofpoint-GUID: wef63mPP8aSD28hYTDFHkMxxDOutEjeq X-Proofpoint-ORIG-GUID: wef63mPP8aSD28hYTDFHkMxxDOutEjeq X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-22_09,2024-02-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 spamscore=0 suspectscore=0 malwarescore=0 mlxlogscore=827 priorityscore=1501 impostorscore=0 clxscore=1015 lowpriorityscore=0 bulkscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402220101 Add support for the power supply regulator. Signed-off-by: Nuno Sa --- drivers/iio/temperature/ltc2983.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/iio/temperature/ltc2983.c b/drivers/iio/temperature/ltc2983.c index 9bd53e102ab3..bc0518ee1b89 100644 --- a/drivers/iio/temperature/ltc2983.c +++ b/drivers/iio/temperature/ltc2983.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -1641,6 +1642,10 @@ static int ltc2983_probe(struct spi_device *spi) if (ret) return ret; + ret = devm_regulator_get_enable(&spi->dev, "vdd"); + if (ret) + return ret; + gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(gpio)) return PTR_ERR(gpio);