Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp583344pxj; Thu, 13 May 2021 11:49:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzo9djvwQ+9nsmUADpJkYTKEBzN/x2klmN5qf86xRstQO1bAwUQQ9GkS3yHiAY0CDG5C5qA X-Received: by 2002:a05:6830:2255:: with SMTP id t21mr36138133otd.271.1620931783472; Thu, 13 May 2021 11:49:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620931783; cv=none; d=google.com; s=arc-20160816; b=Ey0/nHJ0qTQfHHxOMYImr4gQCyN1XUQpXRXZFcR4rthKXLAdNvlXAQ6ReBo7Ol3U+H glaIG2AQql9i7Cwam4C+5YPbODnrG1U/bHvUbOftRDVm+h4pUgiVD88P2HTjRelqfzPB g/nSfpJiihq68xFV38rzAIwudI+gTsRU0hMUqZe02jlb5pPlA3uYi6u4k9xoC7as85lr Q3DqSCFLXrhDSXSEegnDXiImfnl34RU6CFCkz2E1Ej2e+szkvRTQkkuEp4RR+zp/Pf00 K2eCkfj8s8u4aOjobE+8hlLu4I4L8HGf8rqxQ+dLLjX8ubOt0evh4aPAwFp0DgujyRd8 nMPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=/q+s57F67pD/twDnWoAFb0ySoFRs7juRREvhDykgyhg=; b=p9PG2gmLvgRV05LOJlvTI3jtX5sCpje86kY3GF7kcLoP3VdtaFNNhZNYHDeIiokaQ5 /ziove1tRqK7WswOlsjJiPJmzno56psWHUtHHXVTgFbCyM0AQFdA47OCXNJyhTk4evdj icng+nSW74dbJVDJSw5bAUKLbq0GjVaxUMLiW7HEsIva89eBvN5/0sOqwgcojrz+2I8M ouiy0O6mCvoIy9ChbdvvLc0pngjkn5dt+TDvJhmqf2d+j6syzK7w7QGhUwfdy4TS+vMl RKCSnW/D6yM03N66vFY6BmI2kIH/JCjCI/7Ex3Z3j4tfNE8oU0MVrRBs7vKL1gdLaJXq u73w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b=OHdVmKJG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deviqon.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e2si4861631oth.14.2021.05.13.11.49.29; Thu, 13 May 2021 11:49:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b=OHdVmKJG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=deviqon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231690AbhEMLMH (ORCPT + 99 others); Thu, 13 May 2021 07:12:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230366AbhEMLME (ORCPT ); Thu, 13 May 2021 07:12:04 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF775C061574 for ; Thu, 13 May 2021 04:10:53 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id v5so19447480edc.8 for ; Thu, 13 May 2021 04:10:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=deviqon.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/q+s57F67pD/twDnWoAFb0ySoFRs7juRREvhDykgyhg=; b=OHdVmKJG3AY8kWYIsPPBdHN7CfQlhu1aVPg0R4/Hh9Xx7IAn5pz7BUcP8bKIwJ2IfD JJT427bh9K1jA3reM9KipQGGAcQkFzO6jmFLdrMjzJ8hG2hGF2I5wdU7GKXTG222gOu4 PQhfbABzWs6Uu2aBVvTm/+OPIL2DQwM9CqValwucdcb0GYaF+hDlKtZhBb6qskVMcAw3 YaJe7ROmGuJursaEc7fM1FdLqb21XB5WVe8M/INjBU8AwLY/mLAzET40NxkwPuGAAX6j xmvjSqhVSY9RMG8v35Pd8bjZLujjVFxn6BdyjaHh96LDKnSwisOcnQhx+UGiu+IH4Y2Q waAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/q+s57F67pD/twDnWoAFb0ySoFRs7juRREvhDykgyhg=; b=mHU9CPTuoR1jRUS3Kh2+7vEh8A+w70IvBEv6pOzRficF5NRuDPV27bbgvXC1eHzxVD eTv6qg325+EHphYrdRijzith0QXw0wOwl7CPR9+u2dRCE3vh+cUoukVmzTLhkMbmYtce XvzwwYngY9cC8xIOfzTu0Hwj/i6SYL3KqfN8G1ekhe4qu9nJOTo2ksSOCaXqFoIFekzy h05Ah7G3pxXZSJFWfNuvyraR0z5yFS125y1whk7K/631ZFLBsSCSo1zR4Z6gJvdBGgIY 3NdaOSIN7rAaRZ5WLhaWYSxYwymwNr8hgk9AOP4pBxC8M463jcjaFvwg0n/0sh4stCQy Ufqg== X-Gm-Message-State: AOAM533CRqGJmy13P9DP6P7CYGcYlI9E2WLJpn7NMkO0KmykvSU3osMO N2y9QtqjycU5k44cjR/R4cNtVg== X-Received: by 2002:a50:a446:: with SMTP id v6mr46914399edb.254.1620904252708; Thu, 13 May 2021 04:10:52 -0700 (PDT) Received: from neptune.. ([5.2.193.191]) by smtp.gmail.com with ESMTPSA id i19sm1590749ejd.114.2021.05.13.04.10.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 May 2021 04:10:52 -0700 (PDT) From: Alexandru Ardelean To: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: jic23@kernel.org, kernel@pengutronix.de, dmuprhy@ti.com, martenli@axis.com, alazar@startmail.com, tremyfr@yahoo.fr, linux@deviqon.com, Alexandru Ardelean Subject: [PATCH] iio: adc: remove unused private data assigned with spi_set_drvdata() Date: Thu, 13 May 2021 14:10:35 +0300 Message-Id: <20210513111035.77950-1-aardelean@deviqon.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These were usually used before the conversion to devm_ functions, so that the remove hook would be able to retrieve the pointer and do cleanups on remove. When the conversion happened, they should have been removed, but were omitted. Some drivers were copied from drivers that fit the criteria described above. In any case, in order to prevent more drivers from being used as example (and have spi_set_drvdata() needlessly set), this change removes it from the IIO ADC group. Signed-off-by: Alexandru Ardelean --- drivers/iio/adc/ad7476.c | 2 -- drivers/iio/adc/ad7766.c | 2 -- drivers/iio/adc/ad7768-1.c | 1 - drivers/iio/adc/ad7887.c | 1 - drivers/iio/adc/ad9467.c | 2 -- drivers/iio/adc/hi8435.c | 1 - drivers/iio/adc/max1027.c | 2 -- drivers/iio/adc/max1241.c | 2 -- drivers/iio/adc/ti-adc084s021.c | 3 --- drivers/iio/adc/ti-ads124s08.c | 2 -- drivers/iio/adc/ti-tsc2046.c | 2 -- 11 files changed, 20 deletions(-) diff --git a/drivers/iio/adc/ad7476.c b/drivers/iio/adc/ad7476.c index 9d5a71df02b0..a1e8b32671cf 100644 --- a/drivers/iio/adc/ad7476.c +++ b/drivers/iio/adc/ad7476.c @@ -389,8 +389,6 @@ static int ad7476_probe(struct spi_device *spi) if (IS_ERR(st->convst_gpio)) return PTR_ERR(st->convst_gpio); - spi_set_drvdata(spi, indio_dev); - st->spi = spi; indio_dev->name = spi_get_device_id(spi)->name; diff --git a/drivers/iio/adc/ad7766.c b/drivers/iio/adc/ad7766.c index 236a455aaa18..61184ef24140 100644 --- a/drivers/iio/adc/ad7766.c +++ b/drivers/iio/adc/ad7766.c @@ -273,8 +273,6 @@ static int ad7766_probe(struct spi_device *spi) return ret; } - spi_set_drvdata(spi, indio_dev); - ad7766->spi = spi; /* First byte always 0 */ diff --git a/drivers/iio/adc/ad7768-1.c b/drivers/iio/adc/ad7768-1.c index 41752777e96c..8615485490b3 100644 --- a/drivers/iio/adc/ad7768-1.c +++ b/drivers/iio/adc/ad7768-1.c @@ -610,7 +610,6 @@ static int ad7768_probe(struct spi_device *spi) st->mclk_freq = clk_get_rate(st->mclk); - spi_set_drvdata(spi, indio_dev); mutex_init(&st->lock); indio_dev->channels = ad7768_channels; diff --git a/drivers/iio/adc/ad7887.c b/drivers/iio/adc/ad7887.c index 9b3cbe1ddc6f..f64999714a4d 100644 --- a/drivers/iio/adc/ad7887.c +++ b/drivers/iio/adc/ad7887.c @@ -268,7 +268,6 @@ static int ad7887_probe(struct spi_device *spi) st->chip_info = &ad7887_chip_info_tbl[spi_get_device_id(spi)->driver_data]; - spi_set_drvdata(spi, indio_dev); st->spi = spi; indio_dev->name = spi_get_device_id(spi)->name; diff --git a/drivers/iio/adc/ad9467.c b/drivers/iio/adc/ad9467.c index 19a45dd43796..dbfc8517cb8a 100644 --- a/drivers/iio/adc/ad9467.c +++ b/drivers/iio/adc/ad9467.c @@ -434,8 +434,6 @@ static int ad9467_probe(struct spi_device *spi) mdelay(10); } - spi_set_drvdata(spi, st); - conv->chip_info = &info->axi_adc_info; id = ad9467_spi_read(spi, AN877_ADC_REG_CHIP_ID); diff --git a/drivers/iio/adc/hi8435.c b/drivers/iio/adc/hi8435.c index 074c30970465..8b353e26668e 100644 --- a/drivers/iio/adc/hi8435.c +++ b/drivers/iio/adc/hi8435.c @@ -483,7 +483,6 @@ static int hi8435_probe(struct spi_device *spi) gpiod_set_value_cansleep(reset_gpio, 1); } - spi_set_drvdata(spi, idev); mutex_init(&priv->lock); idev->name = spi_get_device_id(spi)->name; diff --git a/drivers/iio/adc/max1027.c b/drivers/iio/adc/max1027.c index e3c8ec107722..655ab02d03d8 100644 --- a/drivers/iio/adc/max1027.c +++ b/drivers/iio/adc/max1027.c @@ -430,8 +430,6 @@ static int max1027_probe(struct spi_device *spi) return -ENOMEM; } - spi_set_drvdata(spi, indio_dev); - st = iio_priv(indio_dev); st->spi = spi; st->info = &max1027_chip_info_tbl[spi_get_device_id(spi)->driver_data]; diff --git a/drivers/iio/adc/max1241.c b/drivers/iio/adc/max1241.c index 0cbbb3c56d08..b60f8448f21a 100644 --- a/drivers/iio/adc/max1241.c +++ b/drivers/iio/adc/max1241.c @@ -147,8 +147,6 @@ static int max1241_probe(struct spi_device *spi) adc->spi = spi; mutex_init(&adc->lock); - spi_set_drvdata(spi, indio_dev); - adc->vdd = devm_regulator_get(dev, "vdd"); if (IS_ERR(adc->vdd)) { dev_err(dev, "failed to get vdd regulator\n"); diff --git a/drivers/iio/adc/ti-adc084s021.c b/drivers/iio/adc/ti-adc084s021.c index 33aea961d850..ce3f5a3814f9 100644 --- a/drivers/iio/adc/ti-adc084s021.c +++ b/drivers/iio/adc/ti-adc084s021.c @@ -210,9 +210,6 @@ static int adc084s021_probe(struct spi_device *spi) adc = iio_priv(indio_dev); adc->spi = spi; - /* Connect the SPI device and the iio dev */ - spi_set_drvdata(spi, indio_dev); - /* Initiate the Industrial I/O device */ indio_dev->name = spi_get_device_id(spi)->name; indio_dev->modes = INDIO_DIRECT_MODE; diff --git a/drivers/iio/adc/ti-ads124s08.c b/drivers/iio/adc/ti-ads124s08.c index b4a128b19188..17d0da5877a9 100644 --- a/drivers/iio/adc/ti-ads124s08.c +++ b/drivers/iio/adc/ti-ads124s08.c @@ -327,8 +327,6 @@ static int ads124s_probe(struct spi_device *spi) ads124s_priv->chip_info = &ads124s_chip_info_tbl[spi_id->driver_data]; - spi_set_drvdata(spi, indio_dev); - ads124s_priv->spi = spi; indio_dev->name = spi_id->name; diff --git a/drivers/iio/adc/ti-tsc2046.c b/drivers/iio/adc/ti-tsc2046.c index 89a818b653b4..26c98b3d74f1 100644 --- a/drivers/iio/adc/ti-tsc2046.c +++ b/drivers/iio/adc/ti-tsc2046.c @@ -639,8 +639,6 @@ static int tsc2046_adc_probe(struct spi_device *spi) priv = iio_priv(indio_dev); priv->dcfg = dcfg; - spi_set_drvdata(spi, indio_dev); - priv->spi = spi; indio_dev->name = TI_TSC2046_NAME; -- 2.31.1