Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp434368lqt; Thu, 6 Jun 2024 07:54:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUMk8IEFqHYMJwk8V9j8c1668muGrXllKHzxarYwUQr/ZIrP4qHBIfTTBvpildcwsF+JdEndVKyDDsUbzm4KOvW2Cm1rzWkM8HfEeE4Gw== X-Google-Smtp-Source: AGHT+IGKGONXgJpgavN50a0s57jo9wQz2qle0uq2PL+THL2SfTdiGarp5PwauPL/dV/sGJK7rZOf X-Received: by 2002:a17:90a:6d01:b0:2c2:53f:132e with SMTP id 98e67ed59e1d1-2c2999ba3dfmr3883813a91.13.1717685649804; Thu, 06 Jun 2024 07:54:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717685649; cv=pass; d=google.com; s=arc-20160816; b=Th27PGwMAyxAkqBZes7LmLyBn0WaxXYPyvoQB+9a599CsVfRx8nOZmS+JfXSchnOtP P9zEat0R+ihf77SjVxIOu3c9YUNwC3xwvYZN7JG2FLB8rHTPw4ByXvm0JYye6Oxt1VXw ZPf83D9ZgncfqihMVunG+dGNrNh9Vm+xaRVubB7+chIUWliMVMUnRyNWnWwlEvHd/k+V lm25MWiMcDUZ1TbxwmZP7DWbR6lLLzQKeHgxuCMyI4PgTaMyR8M9QwRStjqJy4pj5WL6 +uv3xarzf3tRafLUClU1wifl2s8H9uRGxV2dwNCeJUl3eQhJX4wxihpO4s51MtFxwvjc KpxA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=pvIjHUcLB13dE1l/pHcT1U9CkNcZCiBlbfYeqNc16DE=; fh=tPWS7IJQoH/Z6nc3KIXRxJVFAnnOK3vmdd54TLaMb7A=; b=iBzj1CjGb44o/FKZU6UisfUCx7mrDyjP5Fi1Q5q32BmTC04QlzJkD1yYTuE+7Bn/V1 T9lSSQUcXOFy3quhNP0D6e7TCXngRSQpyMFn3LJGGmhUTqJyGZl3anka7VWF3cTR2Qd1 hIQX8gx/X19CB4pKmJXq3QdGoKu0X97p9TLXleLcRLFQn44uv0P5ocHqwsQ50rVGX5kD tWAriKSCFVvGZO7nF2Iw0psodQrT64UajDCzUFMiix/keBZLTv8roRO240/hCJvc11HA t22Wo3P9sr5ENiANiK0OPMBqtUtOMLy7zyb0aZWry/lMcoDVYurPcBpXl1V1s11vVpso AJ6w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IpIGnw1o; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-204463-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204463-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c280632a55si3036324a91.20.2024.06.06.07.54.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 07:54:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204463-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IpIGnw1o; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-204463-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204463-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 833BD286A28 for ; Thu, 6 Jun 2024 14:53:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 650AA1AB530; Thu, 6 Jun 2024 14:27:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="IpIGnw1o" Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.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 DF69D19A2A9 for ; Thu, 6 Jun 2024 14:27:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684023; cv=none; b=Ch1a0dfyJbfa3+8aHf9gGcI/fIqOCi7IkcIjrAhI2FQz3hcdSfOG+fUqZwwg+NLZzzWtQc/DUG4Q168MywFY5eFrC3WhpBZXNsXcpFTFiBtmUNS2ON+0DYI66W1w73V/aX1/4iRQ36LCk71fIIT6hx8AEFxCswtJ6aPYRWKY3hs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684023; c=relaxed/simple; bh=pXJ5RZwaW0aGhveGyDMTsmks+pERpkQf7TD1iLAxrEk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=OfxiZBLgwPWSB+yfs5xDmLOrgBQYg9Gize/R3nL2W7gUNVfDE9j9t8NnfLnai1IM1MnKtWf94AwXKzjpqyMqeRiCEozNJ62+Vak0+mNUh/PofIbaUb1IrApNg8ezZTtty9hsCapZMN8VKuuMEEVqZ/MI4hBUvl7yjErB+i6mYCo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=IpIGnw1o; arc=none smtp.client-ip=209.85.128.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-42159283989so13351735e9.3 for ; Thu, 06 Jun 2024 07:27:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717684020; x=1718288820; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=pvIjHUcLB13dE1l/pHcT1U9CkNcZCiBlbfYeqNc16DE=; b=IpIGnw1oCaLlJl6EaGrfUqkZmh6bNpUuyUHrVIitEIlPD119lDMyyIrM52xoMJZyZZ 8S49O/v5EAhrRbVVhCXBaZhlTkCw6VbOFNCwkr+2ooTASd3r7tEdMfrdu8IpIxbNrPK5 cMUlYmB0B6ghEUT+geU/u/uMwJJcUkng+5bqoLlKyBRWrXJzoD+USnUvJ3zV6ysQBwKx LolPLVT4tmjJEukvUydQouqfQvpvCbF1DHb47oYcGp4+wIkV26slpBXmD6Hh+qV6nwnP GSb3Bq5xtcmyGGPKEn907J0Q6uq4FERFDfF8edcAH5OHHLCCafgWqNv5Dxfo25UiBQPj X7Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717684020; x=1718288820; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pvIjHUcLB13dE1l/pHcT1U9CkNcZCiBlbfYeqNc16DE=; b=uVKMHpIW5wJPVEv8Z8/tfHHgTkue/Fwd4A0ezSrgaHT5LfBBsEAQsgDwREkqkULklP MOsKcoT5XCBfh+Q3XuNFd8jKErFCZ5y7fZT33K0IimXxvaAv672puwNgelBe00Zy6C/t b2jSP9oLGWXzXOdR5RwDQAMyPQRWHJJ1qTG+JPJxcXbujFEynO7mLvv9CRp3LSbrSeIU QwZt7BiCfyHvTvGEdTWTGcac5Hasz59gGzHgrSCk62BzQ69XyffqgMvp7VCjAhU+SVa0 pJN7XIRFxYnRuYrzat0ASFjEp4w5AGndqEJGK9pUByigHkYUAjQO37lnaW8yET6wlUz3 8+LA== X-Forwarded-Encrypted: i=1; AJvYcCWlAOTEednRQ1DQg8y1M9tvmKrsje3+Xl9e8EqKP6ctnPMyZrrUV7Oou7In6EyzAMXS6qI8dyb6t1jwN8PEM5TtGu5VZjOZUeXRHBuh X-Gm-Message-State: AOJu0YzwhlQqaAzySX14KwnPG6vkir90Jh8fRNkEyk4hPLHrybijkSu/ gq94lTtRrnvqgW0YlcbP1jSZoOLe/7wMcHsNcDHh5ktiTXbzVXeSU3OebGXO1+U= X-Received: by 2002:a05:600c:458c:b0:41f:e7e6:7f27 with SMTP id 5b1f17b1804b1-4215633a0f5mr60502545e9.26.1717684020317; Thu, 06 Jun 2024 07:27:00 -0700 (PDT) Received: from [127.0.1.1] ([110.93.11.116]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42158110dfesm59158615e9.19.2024.06.06.07.26.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 07:26:59 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 06 Jun 2024 16:26:44 +0200 Subject: [PATCH 2/8] iio: accel: adxl355: simplify with spi_get_device_match_data() 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: 7bit Message-Id: <20240606-spi-match-data-v1-2-320b291ee1fe@linaro.org> References: <20240606-spi-match-data-v1-0-320b291ee1fe@linaro.org> In-Reply-To: <20240606-spi-match-data-v1-0-320b291ee1fe@linaro.org> To: Lucas Stankus , Lars-Peter Clausen , Michael Hennerich , Jonathan Cameron , Puranjay Mohan , Ramona Bolboaca , Oleksij Rempel , kernel@pengutronix.de, Cosmin Tanislav , Marius Cristea Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=971; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=pXJ5RZwaW0aGhveGyDMTsmks+pERpkQf7TD1iLAxrEk=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmYccq9Lg/xM8hW2vXu4Hb3pmm56fyp8TW5HfEL vIyLQ3YXV2JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZmHHKgAKCRDBN2bmhouD 1woFEACUyp4iynbgN1N3Aj/yRscdAtAupAgByc/F2itlyUnUF4paHlLIYasVOKclxHPPQGm8QRB UyYKY8R9Nhi5dYqteVzfocz8mF7ptw7egHjDyNRPoNtp8bzhghLH1k9neFJunB8njJdJA0bQHCQ lhhffs4KQAt+7G0AJ0Wys2SbbFrcVDc604+10R1VQ5Xk7o+K0Q5Dfkoj61DoBhaZ6gK5yiJi4ml CG1flp+3kSdkQJGg5AINg5rICMtMO/vvdTqadZzGi3ahr6217wFHPIV1WT3Pz1oOcZBbxenMmvN eu7UJv85lNTVDIIbcGjgsFMidg3/kYwSRfZtQnMbtCK1kp7nKvJpb7s3yWxABaCybHqgeQ64Wka C0shPsz/PCgYDDakt7BEXX2LtwadCr1YZ/E043qjR1YGP483dsYisHBpHC8e2X1Lc8nY9y5l2jT UaRA4uWHEAavaUNMVtYGYMh4kmiSs7stslG4XeIDi3h4GXdYMvHsM8l4+BFfPf8FgNMuEiyLUwP OR1zD/VfctsRLh3ZuttmLsmw14DNfRY0l8ofdiRlBUepJKiucUylx5SjEi80g1XPS/PwrfASfzL M9+fQAfbaaV8d9HEjxkmYVWd7lZHgrw/UkMzwg41eTtLcl1oO6cMcwj1Sy/35nOJYtXdw4mM/sI 2G//bG2H1mXj1RA== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B Use spi_get_device_match_data() helper to simplify a bit the driver. Signed-off-by: Krzysztof Kozlowski --- drivers/iio/accel/adxl355_spi.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/iio/accel/adxl355_spi.c b/drivers/iio/accel/adxl355_spi.c index fc99534d91ff..5153ac815e4b 100644 --- a/drivers/iio/accel/adxl355_spi.c +++ b/drivers/iio/accel/adxl355_spi.c @@ -28,13 +28,9 @@ static int adxl355_spi_probe(struct spi_device *spi) const struct adxl355_chip_info *chip_data; struct regmap *regmap; - chip_data = device_get_match_data(&spi->dev); - if (!chip_data) { - chip_data = (void *)spi_get_device_id(spi)->driver_data; - - if (!chip_data) - return -EINVAL; - } + chip_data = spi_get_device_match_data(spi); + if (!chip_data) + return -EINVAL; regmap = devm_regmap_init_spi(spi, &adxl355_spi_regmap_config); if (IS_ERR(regmap)) { -- 2.43.0