From nobody Thu Apr 9 14:18:41 2026 Received: from mail-oa1-f43.google.com (mail-oa1-f43.google.com [209.85.160.43]) (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 3645512CD8B for ; Sat, 7 Mar 2026 21:54:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772920492; cv=none; b=Om4y8h91Ia2+wJWLXKarW+6jEIt83O8k8DKdXhUeqkDVK93ZXXIUBihDgU9AM5ykPcOHv8X8r3PYg8oFRWw/Z63q/Td2BWj8ous+Dgj+NmMxXaXFN6HVt029aP5DhLW1A6H3r2tuDXqHrc66ZAEeR7ycTlzZ0Xnromm3+i39cYM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772920492; c=relaxed/simple; bh=7W9Htn6SI5xO9kM5YPkmn3IM2laxLQhcsmV2bklo1CM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=lskqlhn2UZxjfRB85PA7NeOCaSlT649KcojCMqP6NyeRWXyJLAs8ZuWH837VrwB4JbLVhRlt2ntjTYHfOqNNUjmQtDlNHz8VioKs9OvJoItqElIGnGd3cXpDAAR/+2smX59oRSKwJA6aVBvkRFmHXntUpb/3v0eCvLDB5ZcNerA= 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=CctfMs0h; arc=none smtp.client-ip=209.85.160.43 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="CctfMs0h" Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-41708f6aa5fso386944fac.2 for ; Sat, 07 Mar 2026 13:54:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1772920489; x=1773525289; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=1Qy+ZGVfT393GLsoVsZBttTtwfSVBX+SuLwdTCMd3QM=; b=CctfMs0hEQPsUk7USjh6/XGK3OenXa/zECsKvd8zeVOHNK6TwfBOi0dDmmXDPQpAll yBSLVBE1mxy4GmB4a0Hz4igXyWwPNdVybaKzteou5MaiRWylVGr7S59zzoDQvdE//g10 C3/hqAvUPiUnFqkJ/t+ht1nbKwG5L9EOQnR3shl6Dwift27KXXTGBQJauDZAi7S2kvIU Ff/5e1/Za9mFvO8CgTdLaY3QTIMWnMQPawNp9AiEQs8GK/ze0KFGHooh9wNL0GsbVXCi eQXDnyvtlU9ClFmneRndRguYyxRyHtxJP24/oArSYlI8Rf1rWT69y1RliIRUGVHbEeMv iIAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772920489; x=1773525289; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1Qy+ZGVfT393GLsoVsZBttTtwfSVBX+SuLwdTCMd3QM=; b=gQbDOGWY5xgHMuLlXhgmr4N8mlvt8esTV/dEf0HDiL4Fb/eGaOmQQJzHZTU9O+NEB/ GnTKGrnTghsF0Kp++RCVu/A84DapqrQocRfPNoW6CayBX9NSH607T5SAYxH/PQYGxfBL 1yAFpidfBp3t/pN0CYocuS8orspgB361j90JJbZ7EyPycPqLanqJtoApX7b3zc0hZewc nDMB4emHqnSLYyky9e5i1mcRGKdJp/gFZ41zGNSN5G6XiM9WIFjD9O9LcbRy8+89KEo6 EbZDsU1IA+deYR90KrT+AYe+Cs0G+EepJsfph/KolqA6Psq/6MrlRn2S7N6anfuKEXT6 06jQ== X-Forwarded-Encrypted: i=1; AJvYcCUWs4Ayu1sYxSmmJky1oO67PoyTid3fDGfFDnH5o6fVxfEivKMHjRDSG7tvRsj/qcl9O7Yyg5q3BqzrYjM=@vger.kernel.org X-Gm-Message-State: AOJu0Yyq/pDqlMBjumlzOKN+Eq69yGnSrAIMN2RCRtuAYr03JHCZD4Dn ln4bvg+u3L0sCLpe4pGipmHrwM2ojBBF5Q8DZj2380yTyq8IkCfoVMLNPdlAFZY+yDkaBmhQwsw Kmx8h X-Gm-Gg: ATEYQzx2XQN+/NVrtUcDX14jGwQ+5/xuSLcQshee35SY+Bm4uZTdZvr+e/On7U0MSE+ HWXa49Y2qi/ySJcLzOS/qN9BLgpLjWYm+cM7s9VJe3WLfhQC3cPCKP/xR9YdzujS/UbEwEct1cS JijOHcubO4w0JRJeLYKCJcxDMGLed7F3KC6gggN2S1n98UFPdcuyvQqzIQS0POIDULGugzeUSaW 8HfkVpKOLiPKB79X8Kgfm2WmDMJ1hYXOn3pTAjvMj+JTJTRNqSNprQ8NZt2A25HkoctaypYyON+ 4LG1xIMZRFX3YBbmXg7emp4x6GILjnyaoetl9ZK3yHBoo/VS3eaUvkVzMxEAHGwfXtQgQLJA3IK 9V62BDEU24fbqQaKuX+DEnADevul+wH7spmNBGN4FRGv4HV55IqgzlWspMSMM3rgZNU3QDeNgkS yuTi4Kr65ZTmCKJQ5vBNk2ZkZ89oH7 X-Received: by 2002:a05:6870:b4ac:b0:3eb:7a44:744c with SMTP id 586e51a60fabf-416e3fa32c5mr3874633fac.21.1772920489077; Sat, 07 Mar 2026 13:54:49 -0800 (PST) Received: from [127.0.1.1] ([2600:8803:e7e4:500:cccf:5174:fa72:c520]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-416e6560e20sm4764219fac.4.2026.03.07.13.54.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Mar 2026 13:54:47 -0800 (PST) From: David Lechner Date: Sat, 07 Mar 2026 15:54:37 -0600 Subject: [PATCH] iio: adc: ti-ads7950: remove chip_info[] Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260307-iio-adc-ti-ads7950-no-info-array-v1-1-457f9dc64840@baylibre.com> X-B4-Tracking: v=1; b=H4sIAAAAAAAC/yWNQQ7CMAwEv1L5jKWQNkThK4hDmjpgDgmKWwSq+ vcaOK1mDzMrCDUmgXO3QqMXC9eicDx0kO6x3Ah5UgZr7Mn0xiNzxTglnFlHfHAGS0UuWe/W4ge Dy/0YfHSDTaCaZ6PM71/icv2zLOOD0vz1wrbtYsh6SYQAAAA= X-Change-ID: 20260307-iio-adc-ti-ads7950-no-info-array-95f3b97a542c To: Jonathan Cameron , =?utf-8?q?Nuno_S=C3=A1?= , Andy Shevchenko Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, David Lechner X-Mailer: b4 0.15-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=8599; i=dlechner@baylibre.com; h=from:subject:message-id; bh=7W9Htn6SI5xO9kM5YPkmn3IM2laxLQhcsmV2bklo1CM=; b=owEBbQGS/pANAwAKAcLMIAH/AY/AAcsmYgBprJ6fmTQel0v+bC26asG91rXAbv3qQjM1350fM bOdfE2HDeyJATMEAAEKAB0WIQTsGNmeYg6D1pzYaJjCzCAB/wGPwAUCaayenwAKCRDCzCAB/wGP wJ1bB/9eUnYPZQ2PtQEIvISIaxKht45NzQPaGTPzSNT73PjcClV5XtDCDMYbyUCj5q7fJOlSMsl AAHcj/fAKI/ANbr5IMqXySTqx99olw0s4pO794N2AimyXfHvTBx4+do5deHwmr5bnLnIFgAbVrc nwE2+wjme8FuIV6XKXUnimD1sL4UFg7Hez87T58G1eGFm20wLcsiKWOkJYVXr9BOJzW2l84BlvH Z72mBITMXVh+Cr+DQX4PRzO+wEgbgI1QINxdq448EcegDSXa/arp7L30GPv9D85oMepiyfHyyg9 x6GM8xpR5IX2+Q8tooPJHoVftMPnMo9FnpRsNSXqxM9DPfvH X-Developer-Key: i=dlechner@baylibre.com; a=openpgp; fpr=8A73D82A6A1F509907F373881F8AF88C82F77C03 Remove the chip_info[] array and related enum used for looking up chip- specific information. Instead, use individual structs directly in the module device tables. Also update to use spi_get_device_match_data() in case the devicetree table is ever used instead of the SPI device ID table. Signed-off-by: David Lechner --- Tested on LEGO MINDSTORMS EV3. This will probably have some fuzz when applying on top of some of the other patches for this driver currently in flight, but I don't think anything that will require a manual intervention. To be safe though, we can hold off on applying this until the other patches have landed. --- drivers/iio/adc/ti-ads7950.c | 172 +++++++++++++++++++++------------------= ---- 1 file changed, 83 insertions(+), 89 deletions(-) diff --git a/drivers/iio/adc/ti-ads7950.c b/drivers/iio/adc/ti-ads7950.c index bbe1ce577789..fa3b446495ec 100644 --- a/drivers/iio/adc/ti-ads7950.c +++ b/drivers/iio/adc/ti-ads7950.c @@ -118,21 +118,6 @@ struct ti_ads7950_chip_info { unsigned int num_channels; }; =20 -enum ti_ads7950_id { - TI_ADS7950, - TI_ADS7951, - TI_ADS7952, - TI_ADS7953, - TI_ADS7954, - TI_ADS7955, - TI_ADS7956, - TI_ADS7957, - TI_ADS7958, - TI_ADS7959, - TI_ADS7960, - TI_ADS7961, -}; - #define TI_ADS7950_V_CHAN(index, bits) \ { \ .type =3D IIO_VOLTAGE, \ @@ -225,55 +210,64 @@ static DECLARE_TI_ADS7950_8_CHANNELS(ti_ads7959, 8); static DECLARE_TI_ADS7950_12_CHANNELS(ti_ads7960, 8); static DECLARE_TI_ADS7950_16_CHANNELS(ti_ads7961, 8); =20 -static const struct ti_ads7950_chip_info ti_ads7950_chip_info[] =3D { - [TI_ADS7950] =3D { - .channels =3D ti_ads7950_channels, - .num_channels =3D ARRAY_SIZE(ti_ads7950_channels), - }, - [TI_ADS7951] =3D { - .channels =3D ti_ads7951_channels, - .num_channels =3D ARRAY_SIZE(ti_ads7951_channels), - }, - [TI_ADS7952] =3D { - .channels =3D ti_ads7952_channels, - .num_channels =3D ARRAY_SIZE(ti_ads7952_channels), - }, - [TI_ADS7953] =3D { - .channels =3D ti_ads7953_channels, - .num_channels =3D ARRAY_SIZE(ti_ads7953_channels), - }, - [TI_ADS7954] =3D { - .channels =3D ti_ads7954_channels, - .num_channels =3D ARRAY_SIZE(ti_ads7954_channels), - }, - [TI_ADS7955] =3D { - .channels =3D ti_ads7955_channels, - .num_channels =3D ARRAY_SIZE(ti_ads7955_channels), - }, - [TI_ADS7956] =3D { - .channels =3D ti_ads7956_channels, - .num_channels =3D ARRAY_SIZE(ti_ads7956_channels), - }, - [TI_ADS7957] =3D { - .channels =3D ti_ads7957_channels, - .num_channels =3D ARRAY_SIZE(ti_ads7957_channels), - }, - [TI_ADS7958] =3D { - .channels =3D ti_ads7958_channels, - .num_channels =3D ARRAY_SIZE(ti_ads7958_channels), - }, - [TI_ADS7959] =3D { - .channels =3D ti_ads7959_channels, - .num_channels =3D ARRAY_SIZE(ti_ads7959_channels), - }, - [TI_ADS7960] =3D { - .channels =3D ti_ads7960_channels, - .num_channels =3D ARRAY_SIZE(ti_ads7960_channels), - }, - [TI_ADS7961] =3D { - .channels =3D ti_ads7961_channels, - .num_channels =3D ARRAY_SIZE(ti_ads7961_channels), - }, +static const struct ti_ads7950_chip_info ti_ads7950_chip_info =3D { + .channels =3D ti_ads7950_channels, + .num_channels =3D ARRAY_SIZE(ti_ads7950_channels), +}; + +static const struct ti_ads7950_chip_info ti_ads7951_chip_info =3D { + .channels =3D ti_ads7951_channels, + .num_channels =3D ARRAY_SIZE(ti_ads7951_channels), +}; + +static const struct ti_ads7950_chip_info ti_ads7952_chip_info =3D { + .channels =3D ti_ads7952_channels, + .num_channels =3D ARRAY_SIZE(ti_ads7952_channels), +}; + +static const struct ti_ads7950_chip_info ti_ads7953_chip_info =3D { + .channels =3D ti_ads7953_channels, + .num_channels =3D ARRAY_SIZE(ti_ads7953_channels), +}; + +static const struct ti_ads7950_chip_info ti_ads7954_chip_info =3D { + .channels =3D ti_ads7954_channels, + .num_channels =3D ARRAY_SIZE(ti_ads7954_channels), +}; + +static const struct ti_ads7950_chip_info ti_ads7955_chip_info =3D { + .channels =3D ti_ads7955_channels, + .num_channels =3D ARRAY_SIZE(ti_ads7955_channels), +}; + +static const struct ti_ads7950_chip_info ti_ads7956_chip_info =3D { + .channels =3D ti_ads7956_channels, + .num_channels =3D ARRAY_SIZE(ti_ads7956_channels), +}; + +static const struct ti_ads7950_chip_info ti_ads7957_chip_info =3D { + .channels =3D ti_ads7957_channels, + .num_channels =3D ARRAY_SIZE(ti_ads7957_channels), +}; + +static const struct ti_ads7950_chip_info ti_ads7958_chip_info =3D { + .channels =3D ti_ads7958_channels, + .num_channels =3D ARRAY_SIZE(ti_ads7958_channels), +}; + +static const struct ti_ads7950_chip_info ti_ads7959_chip_info =3D { + .channels =3D ti_ads7959_channels, + .num_channels =3D ARRAY_SIZE(ti_ads7959_channels), +}; + +static const struct ti_ads7950_chip_info ti_ads7960_chip_info =3D { + .channels =3D ti_ads7960_channels, + .num_channels =3D ARRAY_SIZE(ti_ads7960_channels), +}; + +static const struct ti_ads7950_chip_info ti_ads7961_chip_info =3D { + .channels =3D ti_ads7961_channels, + .num_channels =3D ARRAY_SIZE(ti_ads7961_channels), }; =20 /* @@ -561,7 +555,7 @@ static int ti_ads7950_probe(struct spi_device *spi) =20 st->spi =3D spi; =20 - info =3D &ti_ads7950_chip_info[spi_get_device_id(spi)->driver_data]; + info =3D spi_get_device_match_data(spi); =20 indio_dev->name =3D spi_get_device_id(spi)->name; indio_dev->modes =3D INDIO_DIRECT_MODE; @@ -683,35 +677,35 @@ static void ti_ads7950_remove(struct spi_device *spi) } =20 static const struct spi_device_id ti_ads7950_id[] =3D { - { "ads7950", TI_ADS7950 }, - { "ads7951", TI_ADS7951 }, - { "ads7952", TI_ADS7952 }, - { "ads7953", TI_ADS7953 }, - { "ads7954", TI_ADS7954 }, - { "ads7955", TI_ADS7955 }, - { "ads7956", TI_ADS7956 }, - { "ads7957", TI_ADS7957 }, - { "ads7958", TI_ADS7958 }, - { "ads7959", TI_ADS7959 }, - { "ads7960", TI_ADS7960 }, - { "ads7961", TI_ADS7961 }, + { "ads7950", (kernel_ulong_t)&ti_ads7950_chip_info }, + { "ads7951", (kernel_ulong_t)&ti_ads7951_chip_info }, + { "ads7952", (kernel_ulong_t)&ti_ads7952_chip_info }, + { "ads7953", (kernel_ulong_t)&ti_ads7953_chip_info }, + { "ads7954", (kernel_ulong_t)&ti_ads7954_chip_info }, + { "ads7955", (kernel_ulong_t)&ti_ads7955_chip_info }, + { "ads7956", (kernel_ulong_t)&ti_ads7956_chip_info }, + { "ads7957", (kernel_ulong_t)&ti_ads7957_chip_info }, + { "ads7958", (kernel_ulong_t)&ti_ads7958_chip_info }, + { "ads7959", (kernel_ulong_t)&ti_ads7959_chip_info }, + { "ads7960", (kernel_ulong_t)&ti_ads7960_chip_info }, + { "ads7961", (kernel_ulong_t)&ti_ads7961_chip_info }, { } }; MODULE_DEVICE_TABLE(spi, ti_ads7950_id); =20 static const struct of_device_id ads7950_of_table[] =3D { - { .compatible =3D "ti,ads7950", .data =3D &ti_ads7950_chip_info[TI_ADS795= 0] }, - { .compatible =3D "ti,ads7951", .data =3D &ti_ads7950_chip_info[TI_ADS795= 1] }, - { .compatible =3D "ti,ads7952", .data =3D &ti_ads7950_chip_info[TI_ADS795= 2] }, - { .compatible =3D "ti,ads7953", .data =3D &ti_ads7950_chip_info[TI_ADS795= 3] }, - { .compatible =3D "ti,ads7954", .data =3D &ti_ads7950_chip_info[TI_ADS795= 4] }, - { .compatible =3D "ti,ads7955", .data =3D &ti_ads7950_chip_info[TI_ADS795= 5] }, - { .compatible =3D "ti,ads7956", .data =3D &ti_ads7950_chip_info[TI_ADS795= 6] }, - { .compatible =3D "ti,ads7957", .data =3D &ti_ads7950_chip_info[TI_ADS795= 7] }, - { .compatible =3D "ti,ads7958", .data =3D &ti_ads7950_chip_info[TI_ADS795= 8] }, - { .compatible =3D "ti,ads7959", .data =3D &ti_ads7950_chip_info[TI_ADS795= 9] }, - { .compatible =3D "ti,ads7960", .data =3D &ti_ads7950_chip_info[TI_ADS796= 0] }, - { .compatible =3D "ti,ads7961", .data =3D &ti_ads7950_chip_info[TI_ADS796= 1] }, + { .compatible =3D "ti,ads7950", .data =3D &ti_ads7950_chip_info }, + { .compatible =3D "ti,ads7951", .data =3D &ti_ads7951_chip_info }, + { .compatible =3D "ti,ads7952", .data =3D &ti_ads7952_chip_info }, + { .compatible =3D "ti,ads7953", .data =3D &ti_ads7953_chip_info }, + { .compatible =3D "ti,ads7954", .data =3D &ti_ads7954_chip_info }, + { .compatible =3D "ti,ads7955", .data =3D &ti_ads7955_chip_info }, + { .compatible =3D "ti,ads7956", .data =3D &ti_ads7956_chip_info }, + { .compatible =3D "ti,ads7957", .data =3D &ti_ads7957_chip_info }, + { .compatible =3D "ti,ads7958", .data =3D &ti_ads7958_chip_info }, + { .compatible =3D "ti,ads7959", .data =3D &ti_ads7959_chip_info }, + { .compatible =3D "ti,ads7960", .data =3D &ti_ads7960_chip_info }, + { .compatible =3D "ti,ads7961", .data =3D &ti_ads7961_chip_info }, { } }; MODULE_DEVICE_TABLE(of, ads7950_of_table); --- base-commit: 6f25a6105c41a7d6b12986dbe80ded396a5667f8 change-id: 20260307-iio-adc-ti-ads7950-no-info-array-95f3b97a542c Best regards, -- =20 David Lechner