From patchwork Thu Apr 25 15:03:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13643534 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3A083C19F4E for ; Thu, 25 Apr 2024 16:16:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vpBUGyepvDOW3b2xLaa5xULoVqSzTNaPJfa4SO0/JAQ=; b=jcXOp7tKgIJhng KGZqkQ7RX7ED3BWVOjU0Xst7pmmOdQPI3g+jrc8BU9g6PvxtetbpJp+9N9oRPByJ/7Zi9vW82h6/C 8g+UPI6nxqMt3ywe3zcR0k/8MzUcakh54SHpIyCNczohaPkgBSArJyUb7gpcnCsZFuw4oW0ODFE6W gblq8HZ1Vxe4RrTqby/jSGcpt1Q8+zUAoGIHp/n5UPVDWoIdiHEJF/PtpK05AJS2Mg15obpjgX3De bj2jH6+0pl59R878affk77Bx4Pex5HTQEjscKxwR6HZ8aMZM/mGjzirhaJgE+cPPhCb60Kmqixi4I afJDvZNyDRO2wZp7+H+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s01lv-00000009K6n-2nyK; Thu, 25 Apr 2024 16:16:31 +0000 Received: from mail-oa1-f48.google.com ([209.85.160.48]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s00dS-0000000902d-02ZW for linux-arm-kernel@lists.infradead.org; Thu, 25 Apr 2024 15:03:44 +0000 Received: by mail-oa1-f48.google.com with SMTP id 586e51a60fabf-23319017c4cso648040fac.2 for ; Thu, 25 Apr 2024 08:03:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1714057415; x=1714662215; darn=lists.infradead.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=GHHT3V3NAkn80zT3ZwzVgbMDW8DV/51JYCXCI4YMBAU=; b=n528BsHRt3v6PD3ezoth/T2MMdXkqJtL6FvmTCTNKcFxZG29HLKvTNEPJXTGVzUjI3 wX2tRIL8dqkBfN7pHC8yQCXbua4ZPDSj1cSfJEhnp3BEMrrbiKKMDW+ewN6y6MlVxJPc 1vGsw9c9Ilemo8/fA1eBDFhmQAEelkK259OS2rR79BWfGs87IljHTjF/ylyToq6VsLxs +JW9AvVoirTseZYCgKbLMOWuQ74BhMyEV25e4jCt8zOMwC7w3A+N96o0u/3+Bam8noqy 00AYNYdSqWygfgmq/7wfpPAvXBmlebVC2reShFiIh0EFMm+3JKWdwxia+PGZ/GhITotr yvIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714057415; x=1714662215; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GHHT3V3NAkn80zT3ZwzVgbMDW8DV/51JYCXCI4YMBAU=; b=EGgrRdTqhFnsre6ZVQhsG0kY425kU3OGbJKf1LUuQ1ySwatkbJvCMHL0bK973KKAfz sKIJcOyIlgXJ89va7fZVR+wzfN83xDil/Ao7qKPd0P4fsq+W1a/awV66ZgQsumZ0W727 y6gtDGDZKZgzUPzxq0VXNlCs0GYUql8vcxvzLnQtc+cXSaYRFNPo/U1Q+dPfaujj0XOV K4evX1sB0HyGvC7TLGGr8qN+ty7lNi2c/r2Pxw1GBO7Y55DXfVlhvQ2OTNnMeweIkYkt r7maWKYa15uPdLRTRifprx1lNOuA3VExj7oehq2JnRrGky/K/YRyqn/zZMuYJxk1R9s2 cjzQ== X-Forwarded-Encrypted: i=1; AJvYcCUYFfDtjl7Ri8yA89COgxJJH/HrUd3826OdY/gHS36AK+vhrTPshlqq7BRE5YZoDQPPKWetQpXWjY257FshJelEA0y9P7YE9+WWXnnD1HnbgrxzCQk= X-Gm-Message-State: AOJu0Yyy+5bJSVJXTFP9GVIrShFLeMBJowjD9uWVMRyywNgiTwQb97fz eq/6NhMCxF7sqw0uXF9EoCM7OvSoiASvps+bS+p80mMa17eGV6jitSlNXK+/JRA= X-Google-Smtp-Source: AGHT+IGKUzbiZmA4xkuzW4Obu31RHZOeYQIUKpUb81CCZ1vyHCvuVjk+AQ/mnzT8PDS0gPeY3MKOiA== X-Received: by 2002:a05:6871:b13:b0:22e:c787:5fa2 with SMTP id fq19-20020a0568710b1300b0022ec7875fa2mr6465784oab.58.1714057414871; Thu, 25 Apr 2024 08:03:34 -0700 (PDT) Received: from freyr.lechnology.com (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id mp2-20020a056871328200b0023b6d4723edsm166739oac.14.2024.04.25.08.03.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 08:03:34 -0700 (PDT) From: David Lechner To: Jonathan Cameron Cc: David Lechner , Lars-Peter Clausen , Michael Hennerich , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/3] iio: adc: ad7266: don't set masklength Date: Thu, 25 Apr 2024 10:03:27 -0500 Message-ID: <20240425-b4-iio-masklength-cleanup-v1-1-d3d16318274d@baylibre.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240425-b4-iio-masklength-cleanup-v1-0-d3d16318274d@baylibre.com> References: <20240425-b4-iio-masklength-cleanup-v1-0-d3d16318274d@baylibre.com> MIME-Version: 1.0 X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240425_080342_084111_981D8E6D X-CRM114-Status: GOOD ( 11.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The masklength field is marked as [INTERN] and should not be set by drivers, so remove the assignment in the ad7266 driver. __iio_device_register() will populate this field with the correct value. Signed-off-by: David Lechner --- drivers/iio/adc/ad7266.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/iio/adc/ad7266.c b/drivers/iio/adc/ad7266.c index 468c2656d2be..353a97f9c086 100644 --- a/drivers/iio/adc/ad7266.c +++ b/drivers/iio/adc/ad7266.c @@ -371,7 +371,6 @@ static void ad7266_init_channels(struct iio_dev *indio_dev) indio_dev->channels = chan_info->channels; indio_dev->num_channels = chan_info->num_channels; indio_dev->available_scan_masks = chan_info->scan_masks; - indio_dev->masklength = chan_info->num_channels - 1; } static const char * const ad7266_gpio_labels[] = { From patchwork Thu Apr 25 15:03:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13643533 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EB237C10F15 for ; Thu, 25 Apr 2024 16:16:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=36ithArGPnjlyu8UAWboBgoxd3cfW6shxknUNjPFMpc=; b=hf/UTSJ24yx+tP CCTEPBhKhvP5QTxaxVIOBUAQE9gNeDKGertfao8MdOOoTN9wsuScUQ7HJOOEFUhyr6PR3yGKiTXew DmAiaQ48Qoc+jZV0UVNJcnJ6r2O+4kNdcdzni81d9SB8cA3tYrEpVZzDDCZrZdI9iZqmTrR5n05cY hWaqUCt9LJAp3unhVZl3y1mELPyngkE75tki3dsX8IR4Ps3WzK3qyrIMLIFvIwM9GfL2E+kRW0rl7 BJvRsK403gZICP0Vzv3S1eHEuEWukiWaUo+tTwpkFBYDPA9kjt5m5WujGAd6FBYk0f0Bo2JZjig53 4j7CJexAm/lDROtJztLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s01lv-00000009K6O-0Gd7; Thu, 25 Apr 2024 16:16:31 +0000 Received: from mail-oa1-x2c.google.com ([2001:4860:4864:20::2c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s00dR-0000000902x-3Y0Z for linux-arm-kernel@lists.infradead.org; Thu, 25 Apr 2024 15:03:43 +0000 Received: by mail-oa1-x2c.google.com with SMTP id 586e51a60fabf-238fd648224so438828fac.2 for ; Thu, 25 Apr 2024 08:03:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1714057416; x=1714662216; darn=lists.infradead.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=FuUgN+eqDnD1TSwHoUcLirGapuP4idukeuGNZ2DNfLI=; b=H8cjwG4DzSXACGgYLIzT20fkb0EHe5Gc/Ti8zZlcEYPO/f/rzoAF9BxmEhWMOCsDdE C9jfOHfff1FKOLKz2xZrXhqxRhum2xYgvIKwpHboXVFzwSP88QO13r8bW9sSg/UZlvMe fBijeloW6w3Fgp2Lc0wCLGrutPcaqaYTpsdXOHgG4HGue+DOnAPV4QEzWgdzpxVGHVGr iQYAszn1SuUCjUK6vHnZtrhhd4egXt2PSk6S12xeDnheDmDwZ7ixq/AMvJ5F4QJO/DO/ pHzDybHibhKo/McByEMEBj1orU0K9ysWQY2lJbb9vJBF7QcNv/iGBILN/MWJiTdBclJA 9JEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714057416; x=1714662216; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FuUgN+eqDnD1TSwHoUcLirGapuP4idukeuGNZ2DNfLI=; b=Q28MEB5YVtTuRsvRSjVP2pC/SB4Ea4Q1Y/kd/CyAXlAQQ6ZwCmDUbmCjtYFIN+ims1 A12cVcwIAlghhJwnL2vBS4Jjr0rgCIcenRN2NdULcLkHGNNtOAGIuxyV1qhRM8LjsNaF c0QrBGUtfFADXhuYOxN+DCBRFZdiVibC5vK4DbqIC/cWYVaduS3te5L1n0dvPrRmCDY7 z+AmimMGLspO8brJdf8TIQ7a22vpMqcFFGZ5H43SBK3MXqu0aPv/8sPD3ApTd7f+otZ7 14mUbvV0169jb+JOHbV4WVRwqSx14YxY7LFfPeKkTRZUO74FKZdwN8E05Ez0h5RXb957 t+0w== X-Forwarded-Encrypted: i=1; AJvYcCWje0qCekQdnRqQquK2dkcbo2GweGUYHHe2cgaS1ZYuAfwvzXbYktU6MbEBYm8cLe6PbITJ79+Q8WGZcUObOC8LR1SH8DiuEipxhc/TijtiCqeYV+s= X-Gm-Message-State: AOJu0Yzxe0Vm0J2PIXrC61Foh1Yqt+CPOozob9iIZHDcJpa103BdYa4W Vf1YR8Ljkj0Tzg5mJO4A8kuqGk9DUbHpi9jJcJiv15qa9cwHGIZesnntKcI4sb4= X-Google-Smtp-Source: AGHT+IFvAtaidOO7h0zkTLuuS0Zuix9lqDgu9+DKxThfm0jLTYtjgYSEE2bX05vg7lHkXPUfguF9Bw== X-Received: by 2002:a05:6870:9f86:b0:22e:de21:e084 with SMTP id xm6-20020a0568709f8600b0022ede21e084mr7083274oab.9.1714057415874; Thu, 25 Apr 2024 08:03:35 -0700 (PDT) Received: from freyr.lechnology.com (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id mp2-20020a056871328200b0023b6d4723edsm166739oac.14.2024.04.25.08.03.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 08:03:35 -0700 (PDT) From: David Lechner To: Jonathan Cameron Cc: David Lechner , Lars-Peter Clausen , Michael Hennerich , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/3] iio: adc: mxs-lradc-adc: don't set masklength Date: Thu, 25 Apr 2024 10:03:28 -0500 Message-ID: <20240425-b4-iio-masklength-cleanup-v1-2-d3d16318274d@baylibre.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240425-b4-iio-masklength-cleanup-v1-0-d3d16318274d@baylibre.com> References: <20240425-b4-iio-masklength-cleanup-v1-0-d3d16318274d@baylibre.com> MIME-Version: 1.0 X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240425_080341_934999_7F1C32DE X-CRM114-Status: GOOD ( 12.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The masklength field is marked as [INTERN] and should not be set by drivers, so remove the assignment in the mxs-lradc-adc driver. __iio_device_register() will populate this field with the correct value. Signed-off-by: David Lechner --- drivers/iio/adc/mxs-lradc-adc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/iio/adc/mxs-lradc-adc.c b/drivers/iio/adc/mxs-lradc-adc.c index 2e60c10ee4ff..8c7b64e78dbb 100644 --- a/drivers/iio/adc/mxs-lradc-adc.c +++ b/drivers/iio/adc/mxs-lradc-adc.c @@ -724,7 +724,6 @@ static int mxs_lradc_adc_probe(struct platform_device *pdev) iio->dev.of_node = dev->parent->of_node; iio->info = &mxs_lradc_adc_iio_info; iio->modes = INDIO_DIRECT_MODE; - iio->masklength = LRADC_MAX_TOTAL_CHANS; if (lradc->soc == IMX23_LRADC) { iio->channels = mx23_lradc_chan_spec; From patchwork Thu Apr 25 15:03:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 13643472 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E9837C10F15 for ; Thu, 25 Apr 2024 15:04:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3Kuni48f6MRtx5BkhiVU16P5sVD0yInI+qDIhcZD2Sw=; b=uSsRn1ez5wUQj3 /kCqQCqkw9bNlnzCIFHJjwRDK09vST7TmkdlH8kUnZ9elvHl06rTANVZoIxh7/MNleVWnxgxZvbCH DA3iFr3AdF3odlz2jUREt+sI7gvBjC4iy36XIM6WEZWG10UL82k0Crllmtmt1FSubEzWfSnyynV8+ MxesYf/Xgp13GL86J6lKTBto8CoOkw4jqRCHV0gXO15Je3uLxm+1FxHIK3cmHvYm9s83M1Y5eZOm1 f8dgChNnGjFDVL1wMOWQ6WDHBiQ12cMP6cypbkhrxqE6f2GcFBEMw0ncWqItJl0sqQfVViEvq9kZV eVYW5PNJfgZSfeeql6SA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s00dn-000000090DF-18vZ; Thu, 25 Apr 2024 15:04:03 +0000 Received: from mail-oa1-x2e.google.com ([2001:4860:4864:20::2e]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s00dR-0000000903A-3XHL for linux-arm-kernel@lists.infradead.org; Thu, 25 Apr 2024 15:03:44 +0000 Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-23a9d3c9153so549837fac.1 for ; Thu, 25 Apr 2024 08:03:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1714057417; x=1714662217; darn=lists.infradead.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=ALDEBHn1/H2TDQekY233nOtWpDkhb+DBBbFG5htxIm8=; b=u0ox4cp81ffYdwbB0lCynZ7tsIGuXyczBFsM4IqpaS0shFyy8tpVFIiryoioH2aFNU sIvTD9fnOhsg6XrRSiNUiUkhustqzu7g8oJn3hHKHK/ppByhERQeF8GX/eDjwQ46zVLw mSnsU6T6tybOLsFHeiow8FGn2Mc/Cli/0Px0/dhiMK/7D9vopDIu5GNxOxoZyYjmlkQK LabHoepV1dXXrVJz23+LWxvA7+HeEqmWiyJhLtfTPt9hv/Eq8xXDp8uf3z6a9euWIFhu ckECl1isVe/3x9FbFow2bbxCHXw5C4wStl2OrZkKqdBa2RawSrGuQqrx2HzHNqoJP7+j CMGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714057417; x=1714662217; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ALDEBHn1/H2TDQekY233nOtWpDkhb+DBBbFG5htxIm8=; b=SPj1YOWDzOGFbq+fr34wHyMIxfcvt7wgzmvjHkDS8S9cbdQPwNH8Fr5XRBR/zg0inE /44pvqA5rLoz368gHZsp8OybWDvb/j5/+yu49aWYHksV2h6FJYk+SVlEYU8i35QWKXMM Y54NkItpr7L+kNytQ/ENfHSZt1TH163w+nJ6WH+BJJ4Ss1MR+arxxqlWZaMj5OUCKEsm MYy3DGLTCnxs53mMddhQipe0vTUFGJr/9po9cABcUyHaGBWgAKRq8XyVNgRAMLmuhSaO niismR2JA7fBsg50mGwfd+QnCjMT+pHHaRwvTcici8AV6EgtlTqazIkCaKM1BOAwVfOt hV3A== X-Forwarded-Encrypted: i=1; AJvYcCUL6HMBk9t3v6SqmPcjAu+OcCp+Sfortu6knZlDBJbT7l1ZFY9MZ2TjuV8UU5lwLG4XuHGayCUQrD6DQv74trlPgxQhUas2hfia5r336plLtoEbto0= X-Gm-Message-State: AOJu0YzSRhIP9uRtLlUf8ApHPIRKvlhtGmbSP+2DKIAtbAMaBXaE/kbG us7jXisk8GllseyOrlO7fyIft1wxa3SZKNvyHX6cUH9HCalQYMRUp9LMe0XSZeU= X-Google-Smtp-Source: AGHT+IF+ytB1gMG5gdlzfQf5qI8kdu3jxsrVIZyaQCoI1mcDdWPMWQNB0NwCuMDh4O5EGMwTLzBV2A== X-Received: by 2002:a05:6870:c394:b0:23b:8a59:f5b4 with SMTP id g20-20020a056870c39400b0023b8a59f5b4mr702248oao.2.1714057416777; Thu, 25 Apr 2024 08:03:36 -0700 (PDT) Received: from freyr.lechnology.com (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id mp2-20020a056871328200b0023b6d4723edsm166739oac.14.2024.04.25.08.03.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 08:03:36 -0700 (PDT) From: David Lechner To: Jonathan Cameron Cc: David Lechner , Lars-Peter Clausen , Michael Hennerich , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH 3/3] iio: buffer: initialize masklength accumulator to 0 Date: Thu, 25 Apr 2024 10:03:29 -0500 Message-ID: <20240425-b4-iio-masklength-cleanup-v1-3-d3d16318274d@baylibre.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240425-b4-iio-masklength-cleanup-v1-0-d3d16318274d@baylibre.com> References: <20240425-b4-iio-masklength-cleanup-v1-0-d3d16318274d@baylibre.com> MIME-Version: 1.0 X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240425_080341_966295_9EE933B4 X-CRM114-Status: GOOD ( 15.43 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Since masklength is marked as [INTERN], no drivers should assign it and the value will always be 0. Therefore, the local ml accumulator variable in iio_buffers_alloc_sysfs_and_mask() will always start out as 0. This changes the code to explicitly set ml to 0 to make it clear that drivers should not be trying to override the masklength field. Signed-off-by: David Lechner --- drivers/iio/industrialio-buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c index 1d950a3e153b..cec58a604d73 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c @@ -1744,7 +1744,7 @@ int iio_buffers_alloc_sysfs_and_mask(struct iio_dev *indio_dev) channels = indio_dev->channels; if (channels) { - int ml = indio_dev->masklength; + int ml = 0; for (i = 0; i < indio_dev->num_channels; i++) ml = max(ml, channels[i].scan_index + 1);