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: 13643458 Received: from mail-oa1-f51.google.com (mail-oa1-f51.google.com [209.85.160.51]) (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 C09B31EB36 for ; Thu, 25 Apr 2024 15:03:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714057418; cv=none; b=IMUF5qxRs9snAUIX94UhXmAQJWCkJ5BlN+b3D3GH4V8l8+VaZUY/Y1gMveSMuR0FRh5KwtWLOTUgI5ALzILoQ303Y4cH187Z2GNOelnIHkXJjBWg/5vPZgKWNlcgoFs5PgkV5m6GgLtBkkK0NvAKTKUCKcnSmRBtnmMxN7KAwbs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714057418; c=relaxed/simple; bh=Tsa8/Wzig6FNUfuFlRIUELjsQKPsOH3Pulp9FrfGw6Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LkBa+Gsb0VnQvWNpP7O49tfIhGkqeC0i+EDrKMKv5u3WYhxTCHzmamqJXh/6FJd+tSoKqVx6pW4QPC3REGrNhIsSS/Kpd4brGQeHmAuWrhDtEqETsaMJo21SGRNfCYrFPMW+p/SnqFwQ3vPzBvRFaoi2lRAqSBxQtGP90wDWQh0= 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=SmiKmF2S; arc=none smtp.client-ip=209.85.160.51 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="SmiKmF2S" Received: by mail-oa1-f51.google.com with SMTP id 586e51a60fabf-233f389a61eso483836fac.3 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=vger.kernel.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=SmiKmF2SkD/BZUvZPccQMXBK9J0xIYh+u5CHbb32k7yqi7ZmCoj2/LHiJEqVra2gps 7BQWKXF3v7ADpENGe8PPrsop4Z2PnzphPt1pKsQaJcEgY/aJxhzY5AIwfiMD95XFuBdc t4Mf/VWCw9yANI2ZEsVHuQCdp1mAuPPnzxJ4eB3T2VszzpbrxdCqHuShQ6Ssa3G1BBGi PMleiFcNjz9CL137aYOGJeULxmwHxRWWphSyi1ZfFV4SjoGTXxTFnWSH9045L5FOD82k QJG943vaJemk0Br/BrEKYNifCtjZ6FOpMTW0SrhN2j4aUK5yPYKs0jb7ta5k6FV7/mE3 KvIg== 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=KN2eojT1Zw0OK3WcP5H338ODyLPp7R3S55w0RxNQmw+tpBP/wqx03QLMDSponhFVcc 3sbTbxBfW1C8p3hRu2gOycAxVfnoG/aWaw4CTN2V8yAMlxycntXzyq+lmp2HjXoshsma IOtrMbrBb/UJXxur7lM98TjcAo0q82e2gWKVvX8fjbyZGCqtXXvTKAalA3XrojNf/I/2 yrtA6g2JHHuJIhHFC2eZIQRGfuwNkvsl+v/DsXJYngPiEbuu4VSipt3d07rdZsioCAij PbcrmwWeN+xpfaldAZGg/AcE0sXthBMt5cRlRgO+pA7j2/FWW95y33vu+zMYaBQ9lyKw dZfA== X-Forwarded-Encrypted: i=1; AJvYcCUaD9FkUY4RIEb9EqszInA7uH8THHt6Lg/ZlfICouU/fF8l7LCJWeFDVqW8RTaF0AlCe4V4LhSb5g2IcFnphIiM6/ZPwMtSZj/m X-Gm-Message-State: AOJu0YwFcLGyk8vT5TDeu5DRAQBovsaXwDtfh7fXouhctpQ9RsPzCAc+ Rrc3QflvCStH5BT8vcTUgz4IU1RAsW1/Q1u71idmhn4bdWgLuESM7/acl0k56yk= 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> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mailer: b4 0.12.4 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: 13643459 Received: from mail-oa1-f41.google.com (mail-oa1-f41.google.com [209.85.160.41]) (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 67C8C14A4F4 for ; Thu, 25 Apr 2024 15:03:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714057418; cv=none; b=dEyBz8B/JD2Hjt2QM006Tq7Q8/NXRWQRjb799FwMKUXxUIcjL2k73YeljEa9qOoWKeQKo/sG6nG2qY0XDR4Nm/ZoJIAsOOAlwlBhUmnPUKVH0/JaGWd4zS9xprMR+cujwMJ9Tc0lQWofTiMmv5x67M9GGbWgtB7JA6c98zrC4Tk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714057418; c=relaxed/simple; bh=c0UVqkjMuNtarShlxI0bIDMYPsBOuAUJ6QeQyiAWEuY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=i7J+7WOQY+2tdd1YWOSzNE4ec0CDpoAFxPQ83ztNVyLTTMrB+cGaw/vHzSqMIc954DlPg+R8/KQ+IFB9XfBT47vVy1TXU6dsuv5x6L7qI58mcYkBlBJGKPDmizK10hK484B/FOK5MckpEPTY0MtvNd1GMzQlxs80sAv0TrcpQ08= 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=lYm5AtCr; arc=none smtp.client-ip=209.85.160.41 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="lYm5AtCr" Received: by mail-oa1-f41.google.com with SMTP id 586e51a60fabf-238fd648224so438830fac.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=vger.kernel.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=lYm5AtCr7ClXsH4zVnZ7RefhauWfTi6b3MRzk5sA9543gVL5jRqOaiUiUffW0Tcstt /dciL2CXA9/9BOvD3xvt9/ODK+pyoK6MSI/I0jaCQ8BhDBiVHAwR3oM71QiHVEPU11Kj 61XRfoylO6ui1TM8dl+dCj6U+nPQqm+NgnmxD+O98aKihv65YvXji0oJHRweIy3ugACJ oC+sWjqiXHxQpE7WreUN10iv6LZ3Iv9FDIqrkqjcQzBstPS/VaWykDWt+G7fmx7cYDjl rzM9icX9Oka5gT0ugLLIZV3pnf64nuWWxO8U15BqSF7by2iWlod9mcyTrkWbZMZi3JKw k0Zg== 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=Lur5Xcs/n9vpuKkDw2czeqZPIXv27Lw0w424GYMXhdynC9ab62kEMui14Xcwvppotc DHFEkA19zBKlOT/H2e55qf6F9Xym/eLlA1Lm3WrZFr4i0i04Z7tDdqD5d2cPZ38RzNrL rv4WuDuu/T5Ma9uELOYYDinsKGShcsjQHDV/HcBrU0KEke6ZDm8HTKfZO1Qh7SeZylLY 6wwDQiNxnJFg/4W+jK1PfK3e3Ww+A1gbx/WzsW4a4FTo0zWzNxZlUNz9lt0fDO+IRSrD 1zFDt8/H7rt8HMlR+j5hpPtNxLQhidYLNeZelLU9+KZy1LaLn4NdrrWt49A3GaTWBPO1 DIsw== X-Forwarded-Encrypted: i=1; AJvYcCWAqKA54T+54mL8VphRsrgkhoXto+P95JoQbQ7+2xbsMIAtAki5FTm9s3Fp8aNrfVkDzjz2lM4//o8I0XnWRX0zdW6FPrgnLBVO X-Gm-Message-State: AOJu0YyR+4vAoTZH9RP1+MhwKR6SOohkM9XPUuM96G83zhu8Ye2GQKhp 8gB+MUXJ4TEKLTXGFeUHFD1yk/KjoD8ypErnyXpPQvquJInEw/donjvFZU1EhrYFj9R5UIBb0JL F 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> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mailer: b4 0.12.4 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: 13643460 Received: from mail-oa1-f42.google.com (mail-oa1-f42.google.com [209.85.160.42]) (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 D2BE114A61B for ; Thu, 25 Apr 2024 15:03:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714057419; cv=none; b=jhCrC2Fbkhn9fZ9dWON4gNgCtaAuPAPjSXOgU4QAuXZ/VdEN6AtVOjhpU9D7ffjHVhh99pYGT3Kr+dgu2SspsOZpok86owoNDtxAxwISawUXsdzTMbFINqM8ukGplNAWtbgNW9ZSHTtAfu5Az1TGbbdqnKYwHHS1KzqwclfXCr8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714057419; c=relaxed/simple; bh=InEifnlaJ03rA8QgNLlhw6s+Q05Y2oXvccfChwmxIgw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Olmdw8aJM1qwwpgK8LGNWHzaSoMzMhoFrbVzF1sFvbCDpfNKh+81MW/uaZ24BpZlffVLF+ar1E9o7ZjMUmzNCrmUqouM27nipdQmW1q3vHDsd4QyQ4zD4og8hx3LyZiEwSgCYbyBFmp/S9lyjwzJ4lvxGQq98+ar6mpIoHvZbMQ= 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=TIpy5pPs; arc=none smtp.client-ip=209.85.160.42 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="TIpy5pPs" Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-23a9d3c9153so549838fac.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=vger.kernel.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=TIpy5pPseRhnmR9FLqscjBFlJRI02XbEEfKOTANAFpAwSn6p5pHfYOVnIiUP4/lVR0 SCKs5RJgvLEh3rRb0B81op9pcu46ZfsUXwvYnuS/MC5NRTuIvi0+tQ6XV9UL/J1LXUyz aWgVBNUa7mk1f9YLIeCFlhmG9O7et2EdzgopMH5N6yIib3QkFUp+2cAWo5GrSVDJkfW9 xEHr32rfuW2DbAQj9sh2djMryNRaUOhRwCptyrPdiVnzNK7xIdemr8RwDenECAQVIwp9 AYMicp9POLOtRaLRBcTCcgxqMNXjL86AXoWRMsEe+5/QwdH8VBM5fBvfzA6BY7RHhl0f 3bKQ== 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=NLM2okxJDkdVyz2S3aW7z4anWI+5qTZjyVJWm4FemXMzowUTimrQe4dLB5MucQfEA3 uO38s2zIv5nt6NNrnYE2b+7Fs9dG+IpOgAEZO4czPVCwWKqJFr7GoT+RtXyWhYiEbG6Y rBbGS2nHu+keyNHSOX3FHbjv97sP+vfL69uPQ03/AaJPFrClr9ssLuPYTm93nhVqmzl6 bHnnt1oLyYGoMinYQrR1FSVxF+lw38VtBDi9brrKKAcncMaO8+y+NguaIBQGC6efSob8 RQ6KrqKNUGAa3ewArJPRZgECIl5Mo1U8CvbRgrch1bSOXo+DVCa6am71h1L53b2gO6BC NxXw== X-Forwarded-Encrypted: i=1; AJvYcCXYU76bhu559FP4yvv4385nd+NZU7gWsZ6uxOmfURs6Rmwey1OYbJmjuFOxP9fZC8DeMVZG55rJbJWF+gSepicgnP4fpyV3VK69 X-Gm-Message-State: AOJu0YzwTAzQv6YxpBToXFLGfm1sQy36F3GZqlouvjuoixsV4DqIdY99 EoodltF1VRU6CPR3ic1wEOApx4h0tgYhj5HiU4T5ku39uGXjHsnZZBssh/Fm6hg= 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> Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mailer: b4 0.12.4 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);