Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp320479pxj; Thu, 13 May 2021 05:50:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8qQ1cy166ZHu2P0hRpBuYxkAF4JUy6gnc9iOcT4PeuS2UfybjV4UnYGfCkb8bKJUNUOLb X-Received: by 2002:aa7:db94:: with SMTP id u20mr28592344edt.381.1620910253497; Thu, 13 May 2021 05:50:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620910253; cv=none; d=google.com; s=arc-20160816; b=tx+si6W0VrvbcMRklHP+mt3ty1LfzhDDCN0upwT6GtNNzt6+rRHZie87T04ZfKSzFW OWT4qWBJ5T0Yi0Y/gggfqwLECUuK4Tz6cd/CEC1m2aE0e4Ltv9HzxdwYb8VjNSgh2QPV ++nB5S+M85DvUL7dzVTFRDgCZgD0tbFB9i8kooQZPi8oIVqafMHOKRTy1VWIgJlApkjp 2iepJHXwM9QiQbAx8jn53PHo6YGu6pD1enWVOQMrHmB2c67iXcHXIfi2oXROhjQYu/fC fvpI8lg0PZL9o4G8zH+N7r5+/6Y2qOkEHfQzH9PLAYKIAyCCmX1oLubUCjJO516e0T/4 LvKg== 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=cpZpdAO1/PMI+7gumAxN/U6hYQSLUF5PVsfG5cbqn/k=; b=GIDibRafX6Yjp1djWipWMQOsmNOmNxtZGuCfF5Tav9kXeYqbi9OrJLqibIyA3/Gysc KDK7M/hM3fganwhNYYJ9zBE27XRPuV00rMSCeHQL7bOp/R50vexgZKW3oHEtwUD/7dW7 tlPfN6cqXqLbRCCVOc/lvR/sjhLxSqGV57T4QrDJqkfZPCVVolvx30trDUhdpULZy381 MEm4QsYzOBWfV2LuRDliR7HzqvcznUX+W6iEyysQY3W92ARBdEbnv0G1s8YpSoHbmEj7 BQdxyDIGYyVbO0SU4G5f8mdDROZtI4FAATeQKL8GCjNrrUS0JRrZ25FGqDCQ8a8VTRxY 2upg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@deviqon.com header.s=google header.b=V4WRwq8A; 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 m15si3065772eds.34.2021.05.13.05.50.29; Thu, 13 May 2021 05:50:53 -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=V4WRwq8A; 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 S232155AbhEMM1F (ORCPT + 99 others); Thu, 13 May 2021 08:27:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233591AbhEMM0j (ORCPT ); Thu, 13 May 2021 08:26:39 -0400 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 685ADC061763 for ; Thu, 13 May 2021 05:25:17 -0700 (PDT) Received: by mail-ed1-x533.google.com with SMTP id n25so30761722edr.5 for ; Thu, 13 May 2021 05:25:17 -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=cpZpdAO1/PMI+7gumAxN/U6hYQSLUF5PVsfG5cbqn/k=; b=V4WRwq8AczyqxazVuYZ5e4aAr/xAe1sdntbER5nBnMoPBY9hKDzzdcqJh4LejggFaX 00SjUtRlLaAPZLqOwwVokb3fj2ML/OGxrUKAIVOZjaiLRCQI1wjrim4woUZ8tjyiDrR0 rRqfw1CNtBQGx5/0qtmz19UdAbTlAknZ3syssxfaKSJcd0S2ytLgQBCBgbgqztCaYNOv A4nIhSdcW+5LdnTsXzVUivwYWnVDdWCQoQcn2fifQ0vAS6xSXs5luop9blwrnBdULgwy 5wD4vc3S+qjtuDVlTt1SnkZbJheizyiVfoFNMv05wlBMTaxXurT1v1n2lYmKJljSq3z7 3V9w== 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=cpZpdAO1/PMI+7gumAxN/U6hYQSLUF5PVsfG5cbqn/k=; b=Y7U6VMExT8H46ZKVnbAZUYAN4txFD5L/1YYOr5m+gEXAhXCu30yckXS4vTCf4rcF0N fddlVS2O1eIoqbpNnApUIchLGImy23XT9PxGb4dm35yFbOi8iKUiWpYAzxIHT5zoBGHA 8/MOst3xMmx4/cbobmtTkWuXGK48Iv8I7yEYluOKSDYA+LH+My6GEpa3lq8hkWbLjF2O jpOZ+j/HKkEY0ZDK1ky4HJ7D28yh4reWdk47Gxux91yBrZ9cO2p+20em8kdc0xgrQuaM j4CAQsi/cI2+kOO8YiWXzi5Dwkku1fZDEZRhNdZYrKJija1Va+4rps9E+HcdLBUabRQg q6TA== X-Gm-Message-State: AOAM530vcKJLnvVIdT65z1bOgir4LG9mMM6VfnNLvyTEfq9UtRo+tu+S tzq6fYcTzBiklkO5gER4xTX2aZjVJSxQT0hVHno= X-Received: by 2002:a50:fd14:: with SMTP id i20mr5444456eds.60.1620908716168; Thu, 13 May 2021 05:25:16 -0700 (PDT) Received: from neptune.. ([5.2.193.191]) by smtp.gmail.com with ESMTPSA id e23sm964211edr.80.2021.05.13.05.25.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 May 2021 05:25:15 -0700 (PDT) From: Alexandru Ardelean To: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: jic23@kernel.org, nuno.sa@analog.com, Alexandru Ardelean Subject: [PATCH] iio: imu: remove unused private data assigned with spi_set_drvdata() Date: Thu, 13 May 2021 15:25:12 +0300 Message-Id: <20210513122512.93187-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 IMU group. Signed-off-by: Alexandru Ardelean --- drivers/iio/imu/adis16400.c | 2 -- drivers/iio/imu/adis16460.c | 2 -- drivers/iio/imu/adis16475.c | 1 - drivers/iio/imu/adis16480.c | 2 -- 4 files changed, 7 deletions(-) diff --git a/drivers/iio/imu/adis16400.c b/drivers/iio/imu/adis16400.c index cb8d3ffab6fc..109b2360a54e 100644 --- a/drivers/iio/imu/adis16400.c +++ b/drivers/iio/imu/adis16400.c @@ -1164,8 +1164,6 @@ static int adis16400_probe(struct spi_device *spi) return -ENOMEM; st = iio_priv(indio_dev); - /* this is only used for removal purposes */ - spi_set_drvdata(spi, indio_dev); /* setup the industrialio driver allocated elements */ st->variant = &adis16400_chips[spi_get_device_id(spi)->driver_data]; diff --git a/drivers/iio/imu/adis16460.c b/drivers/iio/imu/adis16460.c index 73bf45e859b8..068d98780383 100644 --- a/drivers/iio/imu/adis16460.c +++ b/drivers/iio/imu/adis16460.c @@ -388,8 +388,6 @@ static int adis16460_probe(struct spi_device *spi) if (indio_dev == NULL) return -ENOMEM; - spi_set_drvdata(spi, indio_dev); - st = iio_priv(indio_dev); st->chip_info = &adis16460_chip_info; diff --git a/drivers/iio/imu/adis16475.c b/drivers/iio/imu/adis16475.c index 5654c0c15426..90aec3c9dbcb 100644 --- a/drivers/iio/imu/adis16475.c +++ b/drivers/iio/imu/adis16475.c @@ -1329,7 +1329,6 @@ static int adis16475_probe(struct spi_device *spi) return -ENOMEM; st = iio_priv(indio_dev); - spi_set_drvdata(spi, indio_dev); st->info = device_get_match_data(&spi->dev); if (!st->info) diff --git a/drivers/iio/imu/adis16480.c b/drivers/iio/imu/adis16480.c index f81b86690b76..c7dd1150780d 100644 --- a/drivers/iio/imu/adis16480.c +++ b/drivers/iio/imu/adis16480.c @@ -1279,8 +1279,6 @@ static int adis16480_probe(struct spi_device *spi) if (indio_dev == NULL) return -ENOMEM; - spi_set_drvdata(spi, indio_dev); - st = iio_priv(indio_dev); st->chip_info = &adis16480_chip_info[id->driver_data]; -- 2.31.1