From patchwork Thu Jun 6 14:26:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13688564 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 4EB49196434 for ; Thu, 6 Jun 2024 14:27:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684021; cv=none; b=gzeBVu0j81Dr7f4VCdMDsvdE7bd0ADPfQNYUpOfUlUZEzAJA6slvQF6ppW6f7+i/40iZSNWSzcNwf1VMJepB3fES4TQIh2LeDoK2blXvnBMKLDmZujnvAxHdW6I2nJI5xcMPCNmEgI8FxjS/qP/X7FU/5OaSqdCpG6RrosJmvxI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684021; c=relaxed/simple; bh=ouk3F+cKMwX5ogn8ACbnak02Gpi89OqUx3zLGy1oywE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=k6SKVUso+LrkU9IbzI6zuzchzED25bXfEn1TJssM4hMa7Q8Xsoh97wpS8Xp09ZgAe5iJYIMOUgBW4bpXic6qQhBqT56Rk+x6/ROoukeaP9HgN6tZ/f5Dw8LdpNaRaJ3y7khl+/akmCi48Ip0m3SGPgPt0Cu/TXhkb4gwBet9j2s= 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=yW66KuM6; arc=none smtp.client-ip=209.85.128.54 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="yW66KuM6" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-4214f52b810so13529025e9.1 for ; Thu, 06 Jun 2024 07:27:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717684018; x=1718288818; 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=jDK+z+BE20Ye7HSxPtyubObznbtw0Pl4ppmqVjNx6fw=; b=yW66KuM66NH2r6bn09pOISvxMWwEUbU/45/+UY1TX08fjVNDvZjvwIdpHL9WmurU6W db/KQhZHJqfV7COgxNvZ/CtU2Su4L6DLa0jDXTkGUy0hg4kqsVPURBoRbHzepcl7pjy0 HH6TqeIpCr+FLQ9jP4LG0bgm/jWbD/DMBpAp+OhYM+oXtWM2NiUoexqvipNInhG/vCW0 bFdYhPM4aM6zzRPEeKIiX/a7QovyICSyiuz1p33gD+qfDCpVqcxqQteDH358/D4BRjT2 ruKAQ/B45hl+5JH74dD7XhyX3DR+0qwEBnXnzTtgwcwFVCXxKsJ4hsGMj8xOYjtkcf7L fEbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717684018; x=1718288818; 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=jDK+z+BE20Ye7HSxPtyubObznbtw0Pl4ppmqVjNx6fw=; b=L6Vj0sjplc1UEGDYTlCkAWKwSoh82wE/aNw+rUQ7Wuf+7lIP11HWkpwBc7kqphGsxB +JKE+jwqlE934X0AMBq59HQ4KF/Ncypn/CHmFdMr6kFkPcy/w5vWcYJ6x9lZMouAvpc0 J8av54tf5cqFnd+C4VCjzge+XrbDWShEvlzltl/hkVx0a22nfg3w1DCn2dtnBrnR/bk8 1xYEjb3vetdVNx1T1CVr7/o3VYtlP7kN1NvhIpiQHaDcqPZyL3hhpTIHCBtcAthKZIEE RulGFuCE8Uqyig8zP/hm5XcPXzzA54mm+igjRSAAEyFvxF2zNeA4HmoBY5HjKKmk4wfg 3HUQ== X-Gm-Message-State: AOJu0YyV+Wo0Y/Wo5u5NDJxjvk+xc2MMiuVm7yDM8sZuAzIipG4yOBOn mVJxzH6rFVTl7DlhRHOevCrUR9Cj/wKQPz1um6MUmKV6C0743okVWyCaLNHW7F4= X-Google-Smtp-Source: AGHT+IHqQD6kE3Sn25NWW0JWMcICj8nLQOU+AAyrH3gprNKKI0oFxr4HW1z8KPG80qivMhGLHl+wuA== X-Received: by 2002:a05:600c:501e:b0:421:5d4a:7286 with SMTP id 5b1f17b1804b1-4215d4a7a35mr20202255e9.14.1717684018640; Thu, 06 Jun 2024 07:26:58 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 07:26:58 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 06 Jun 2024 16:26:43 +0200 Subject: [PATCH 1/8] iio: accel: adxl313: simplify with spi_get_device_match_data() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240606-spi-match-data-v1-1-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=965; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=ouk3F+cKMwX5ogn8ACbnak02Gpi89OqUx3zLGy1oywE=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmYccprjyS2LgwnVtWogEoBWpz6wTM8bKGrrNsv gyCXV4PYKyJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZmHHKQAKCRDBN2bmhouD 10+PD/0fnjJOmN3+DsIsgKEflH8Zhh5ToHHuYLzsKBz8wrBBGQhzGEv1YaZZd4EHycKRqe6DBgP gj/tyV62r4nWHIKpNyUIjwiQ35mshEEZC0QixeB58QyfYMqHVEmEDIPpU1rffMTRnhf+Fzon/l8 QiP5Gz6dKOIDbimfyX8FkrR4VK1MQ2upW3tM+UYCTRmAaycEl5K8Zg/hGQrFyvjyuAalbd17x+X SYllu7li8dAc5jJSvAASJWsMC8MOllcIMD2qmL7keQ/vUpUngukveGME1NFjq8beiQZJpSIBfJc FUvLkeovuNUjlwxrHurPaW51485yq5/Ia46Kn5b7UmdUbUBKh+ZuX8lzJfJxHVDmXMB8Fg5OOwg LH8+qj5uDc48GSxGUSYJQxl6B/M3wV9EycEXm03N5OxfcDk02IoZmTmulPrxhwfJtq/Q4176Oi/ DHFqKeuvhOzY5Kq/SWIT+6A8cw+a5NMQ5gfgxO+aq/cPIujM5Ifq/fw1HeqsmPu2+kY8d54YTL/ 0Y8Ow6BRgXafpVzPSzELW08b0adD8YK6vOA65htaqqm+00cs9b5p5+ezzANp+AiEK3k8kcUAwPL gOx24+rVtQjsmsRXBCs5kIPfepGET2ShMRAHXogg1lLz/AxsbqDxzu0yV3Pta/sAAIGYYdAWA5r OSW1FVLjh+UIY5g== 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/adxl313_spi.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/iio/accel/adxl313_spi.c b/drivers/iio/accel/adxl313_spi.c index b7cc15678a2b..6f8d73f6e5a9 100644 --- a/drivers/iio/accel/adxl313_spi.c +++ b/drivers/iio/accel/adxl313_spi.c @@ -72,13 +72,7 @@ static int adxl313_spi_probe(struct spi_device *spi) if (ret) return ret; - /* - * Retrieves device specific data as a pointer to a - * adxl313_chip_info structure - */ - chip_data = device_get_match_data(&spi->dev); - if (!chip_data) - chip_data = (const struct adxl313_chip_info *)spi_get_device_id(spi)->driver_data; + chip_data = spi_get_device_match_data(spi); regmap = devm_regmap_init_spi(spi, &adxl31x_spi_regmap_config[chip_data->type]); From patchwork Thu Jun 6 14:26:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13688565 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 DBE21197A90 for ; Thu, 6 Jun 2024 14:27:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684023; cv=none; b=brzded4kEy+M2e9yJX0+RNB+JixiZoMggiy+ky0wk4E8THq4qERcxQZLeKNfRHhEpxDqcyV78l7dLmrl9ACwHKYk/hjFRded9ChOXPHYsQ+1asrrGr0EgUg2o4NXtlzF3sZ7Q8U/8zC/8GH+olQPAWtnIGmvRLfqYd1AUVWDB7c= 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.50 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="IpIGnw1o" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4214f52b810so13529365e9.1 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=FGmO/JkM/RITSuWZ9qzZ04YBdeJNG/kiPyikP2gV4B95ULQpqrvx3sW9qKA35pzfX6 IyI5DyvUlkZEuhw4SCSl7w2gbh6cRoQ5JXVnY9JYEW2RAAPRV9IlRzBFeVVDg2Rxyh/I pu1ggjMbJ6eIbRroBrAP+aiUAi04vGrN1g+yD8b9245vBho0FjD7Y1BnDM0XMCweua1l tceUalkWg5bjTBie72/PJSecp7q7idf9dtogcD2HPCWLOUKnE8h24eFQo5j2f8bGeQ5F QTYfirzAPuT+xG1fJPpE0h+KWrWmOPHniEJqVAKsiI0843vv0iKgJycctEBPvISea7Qw 79Ag== X-Gm-Message-State: AOJu0Yx2we1Uk58L6ufJI+7fQt7HDLBxiE096+zcJwFtkJGShHG90bKq nGIYenI1egRhCO3pa3FwmGqaOPE/SGsGMyIaSK0jh6MeDeWhBrSwbRoJRyNv3ps= X-Google-Smtp-Source: AGHT+IEcvghZweS3aoi5Ny823x+zSiczIX+Km9CFgpCxtTdLm5kKam+O2awv4QmT7N28BO5AH8SW4w== 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-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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)) { From patchwork Thu Jun 6 14:26:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13688566 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 2540119A2AE for ; Thu, 6 Jun 2024 14:27:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684024; cv=none; b=Ak2jzBZeWV8NDUBN1/TdQuh13mxSFklYsFBjnPIjwUKy3RP1MpgdithkHb7fU5H2hIalU4o2mvY8ZiKgAu96xhcwLorrA3yf6W/+kH9E5eMX9L4Ka9UIxdIvhCEhwH9mdKhbH5fFqd6HtkyyK++6edKZcSlDjCEvgcGRbeRE5BQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684024; c=relaxed/simple; bh=GEQpZ/AnK0wMBcP0xVmMauOZlz+QTE3U8F59z75ODIs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=F637+mZLOlpRuPkm45fzQmJiLE9WoLyIxoMjNUk7yZQkxaPzX+JDgIhjhZcIvpMHa4vspjLk0SjNTgODGdOjCVXOVA4jdsY6Q/KvdBpFOH0cbd6fFRLFEDxzkcNu4kYTzLcqeLNssr3RtlyABNI2RcCdJA1dmu26XF+2H7X1fJI= 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=Wz1GnV2t; arc=none smtp.client-ip=209.85.128.52 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Wz1GnV2t" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-42155143cb0so13383365e9.2 for ; Thu, 06 Jun 2024 07:27:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717684021; x=1718288821; 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=L85NsvGoDUeQoY3YtE8+i2I/DxvNN1zDXSSC47EQKas=; b=Wz1GnV2t6HzlETKByCJK1yXnPY9uYtRIza67KgmSaQdp4fBaeV51kfpX9PxB7xgNjJ MTIKDm7hII3+SvfOcslbtvQ8dwLxJYAB2q0Enjn/ilDaBvevszIGUDdmg/MaEcWGHUxT CeTBMwxPnw3Gd9IP2+bNQeg0wn22w+9VyYss5VwYva/FcWCMYc65GUPplYFkq3dpAatO ujm+N+E+QKly3KN0LJug36/P1QecCp3/742BbxL+gyqQZNp7SvVUjUoL35yL2u2HB7/Q 5lrE9Sp87trQdJlJxTuNn90aQzbyoCmxvJCO9oOxLlJDEwIzewz4lZ3eYRBT1od9kHoz aqMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717684021; x=1718288821; 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=L85NsvGoDUeQoY3YtE8+i2I/DxvNN1zDXSSC47EQKas=; b=d4WWH+r+SWN6x64XOH92vWjSe7Lktp7lL8ESEOJozqnu3lJdxSj8FcLU6TWt/oBuRE BMDoNbRxZ4uFAGv4mmqCNscxuv6u4M8TCvrHONspmLKHkPuY51cEI6qHQ3C6FUfWRw/c viXHayLULTfXmEHrBbUPSMETltfWgGLbIdqv1CeFCrWC5l/lZlagO6qkjNgtZU4c9K1y oKin0PSUi8e1PYTNXNJ9NelahVuLdqYFldb0BomZC5VgJnQBUgGWUSPCwLhCuGqnJDJJ j+upYEew1KiB+5RFq9QvsejuQ6tO4m2Qiq6i/wZMg0R2AZJKvG97YlQh6pAQlKGS9iZw RKCQ== X-Gm-Message-State: AOJu0YxBQWdiC9iP4x6VACUxj6us46Teb6HY6StnAnicUx6l3V/x0WHe Va6PGFGpdXw+f1bg5gptcSlLtLcSk+8SRMJvjGI35BQPAr6uFqY4BoyOfQt3w5s2s0xYKFMegan EzV0RiQ== X-Google-Smtp-Source: AGHT+IGPHPpNN4o0qC5iIvAMx+8WRy9de4SpebOmvsz5WZTl87vb3I6wRJHkGRyu1jgTlcsISnsnFg== X-Received: by 2002:a05:600c:4f8e:b0:421:59b0:f364 with SMTP id 5b1f17b1804b1-42159b0f616mr41722905e9.40.1717684021630; Thu, 06 Jun 2024 07:27:01 -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.27.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 07:27:01 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 06 Jun 2024 16:26:45 +0200 Subject: [PATCH 3/8] iio: adc: max11205: simplify with spi_get_device_match_data() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240606-spi-match-data-v1-3-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=886; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=GEQpZ/AnK0wMBcP0xVmMauOZlz+QTE3U8F59z75ODIs=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmYccqs/TdFoQX8Hj7tD+FCm9HPlS2XvTzAWiZq DTX2QJspb+JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZmHHKgAKCRDBN2bmhouD 1zRbD/9AUW+4LTW3tPTMqOfojfkOFb8pejCotSDMTJFUxA4rjhhVexJHSt/jq+FpPtM7ZJgkK/O Q4cwSlOe0xuELztzpNuxrub3iNctxULPh4pJVGvtwh8haeb7PU+1MZXlqOzzUDnrQYVovEM6lJ/ esCjFMwcVn0943KaXwQ8YSO3DYgiCOOPTdlekz/n34YExOgIO+x8POhaSwbV0Sp/F6manata7as QkJmony+BOQkKtZHi14SpQpJcE8+yLsPYgBPKewSJi3zmXOd4SaJ2GMpNkNyAETY7XaeBKMzQZ0 D4cwv05n91l+s8NhKKT+rxYLYJKXIZwT+LNhbH2DaDwDqDFQu+1Apj2dd3GlocytKAiK7G0e0bd 4+H4Pe8LJsWLyjNJQz7575z6cdScFvduuhzHIPPvfWBvmEU5Zb9DsJAtD63Y5ToKSk6it9YIAQI ZZlk+upT/6fH0VkpEbHDQ7myQQeUW7opuRw2uICCPyB7l8G7uImtbR8uhAi+hpbyV82N8VLxFJV +vd7SSLJoMkX7zNxF8GzFSf4sQvWWX4ica4P/rUALWrjYqzxXGNPzzrbnl1+hTMNmnD7srYLV0R N2XvRvmHJtM5v3wBievswHHJEWdvB3QzcbNxQicbL896X5FfGGNmKgnglt3rxIISi6RvUROE851 mH7aNKr5pNd8Hdg== 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/adc/max11205.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/iio/adc/max11205.c b/drivers/iio/adc/max11205.c index 65fc32971ba5..9d8bc0b154dd 100644 --- a/drivers/iio/adc/max11205.c +++ b/drivers/iio/adc/max11205.c @@ -116,10 +116,7 @@ static int max11205_probe(struct spi_device *spi) ad_sd_init(&st->sd, indio_dev, spi, &max11205_sigma_delta_info); - st->chip_info = device_get_match_data(&spi->dev); - if (!st->chip_info) - st->chip_info = - (const struct max11205_chip_info *)spi_get_device_id(spi)->driver_data; + st->chip_info = spi_get_device_match_data(spi); indio_dev->name = st->chip_info->name; indio_dev->modes = INDIO_DIRECT_MODE; From patchwork Thu Jun 6 14:26:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13688567 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.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 85F681AB536 for ; Thu, 6 Jun 2024 14:27:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684026; cv=none; b=nFdIi4wCTI8AR7VvCidnEFN03fMs221UArceIUquB1+s48N9pTT+xXhXXq8sUFCmpbDQCtURcp7HwStbURyC0uE6UNeyObH+nsRyYkKoYgwV0kgoBDY5IMHIw4lPuJVQCOAXc7jPvDbryCJAoghiLUBTt0MQFZ/U3V2lm8fQaYA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684026; c=relaxed/simple; bh=YStrwMu9d0HF7v8g7UlEzFjEPSB04hbtpJeJ/x8+6Tg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Nq/X/ulUURn9iAaiBP+9Rw7Xjj4qDItprss8j/PR0ejX4B9KrszR6LcvRLoPTlcu6NbCeAfG1vR/530+WNx74Ldf+t5eI3RJ/lkI+sEBVZL87yKLIVy4ecY8u56ufBtJV5CBUBnxo786XBGIc7gHiOUP5emL87hbIRQSIa9pbCI= 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=be57IxCM; arc=none smtp.client-ip=209.85.128.42 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="be57IxCM" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4213b94b8b5so10993905e9.0 for ; Thu, 06 Jun 2024 07:27:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717684023; x=1718288823; 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=2/q5554CzENPlgyge011QeqaTXceaEzyntbYKINHAhg=; b=be57IxCMboKrqUOy5opXe7d6vt0ApjW8gU/fBV+0X4gQK76FUT/2fPTLX02HS0Jj9g uJJEQScCWRSkVxQ3EhBP+SSjMTA0QoGRvKGUtpKOloiQiqEvnuGTGXSRGaFeKV5zdF0l OFv1CcNu9QtXm8B/U8XwvtPkrzptpynWNTsWsC9vinHBinRNHA/wsEU0k4Ug0S1U+lcN 1ETfg05fBc7B1+66QRgUdZ4XrtftsMl1JnAyigoSbsatgeXnJi5qC3mTyBfZ8hKfwfAD 9B3dccIlksBQPqUMBTWQZH32OBuDReIiH1CCcv/h8zRmwBDEj+n9nalcEZuYnpKTTA3o t2XQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717684023; x=1718288823; 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=2/q5554CzENPlgyge011QeqaTXceaEzyntbYKINHAhg=; b=iP2kMkRX9zXkng5xojqezImKzanQyxuBio//bZhbYhekUV238oBcqNRL+KQXYiv+qp MT7kDfF7qitXvRIoXBMGzJzTtWgz0zx2W9x9AKNNtvInBDoRpmmsEkow+p12wVPJgVMj wIzTIwrNxoob3yQwBCD5V1hXUZfdUEOZfFL8oI7PZvy/Z+TsGeILUWymLmiX33zukevF Sfhm2w1myKJ04NVGu6HBR46VhniQnF+m/ERAVBB5NMImkZsBPE/HwsYgjwGmQGst0Bjv 0D+UOHWliJYwaju7lxOwCLoTl1R5ejojjX4p0q6D0J7tBhX0Y1YD4xhV+TwpAAz3aEt9 opKw== X-Gm-Message-State: AOJu0Ywzoh+yEy/YMkUEvBNStEjSOg6hpH5zgSKcIsViz+eDxqAWfvSC QhtTokVa/5QZzSXAYvS+UJ3hoUI02PVyFhUppMHDSsRj9uXZ+R5YGvNGq/Tfmqo= X-Google-Smtp-Source: AGHT+IFDSWmGgqEQxCdbD5qa+u6jKx3d4NBDe1bhg5CQycR2vrRLxkrkirLGTvw8Xk40Nv4dJ0kHhw== X-Received: by 2002:a05:600c:4f83:b0:41f:ed4c:b8b6 with SMTP id 5b1f17b1804b1-4215635859fmr42301955e9.38.1717684023003; Thu, 06 Jun 2024 07:27:03 -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.27.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 07:27:02 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 06 Jun 2024 16:26:46 +0200 Subject: [PATCH 4/8] iio: adc: ti-ads131e08: simplify with spi_get_device_match_data() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240606-spi-match-data-v1-4-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=811; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=YStrwMu9d0HF7v8g7UlEzFjEPSB04hbtpJeJ/x8+6Tg=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmYccrM2JPjmayiwY1qQnAIETB5ED1hb/J1fYj0 UoY7hXocZ+JAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZmHHKwAKCRDBN2bmhouD 16mPD/4s2zen2qL8Xyl5g8T7SvW51gO4ywnLwFj9Pg2kwfy1Cms39SBppTSUHv4L6PZA+7/J6TN BAdPfk7NPYWU3LUZbmnV2dnlooTg1lFwUlidyOthd6o9TyukGldMo6h+uzDzQPGjCLTryhozwR6 PFU5S8qzshkHrwEVmgHFt5pSDjvJzQZH6faicNtjfFm3Kcvb3bwxCDur+UD6CrCOvwa3RXU4kGo dQkBpJnk+PrbPHTdJigzvoE8bCCgAl3i7zyX3wdPWfgxfpupgHkOZl85yg5dZ4MzjJ+sw9grlvy 7qHC8PsfR9tsdpbiZMDILl4z7glqjv3D2Mu66KaGlDHQmIVns3vILDyGUSOzw5wzkT0JpJU9kDT WM5DgJEV2b6O0mGdyNpY2vhHh8qPaKFf4ifNM5eG8PBr1ipoD7xTATDpfj43uCqO8hJ8H0p0+xz 24sL6Tzsx0Wr6S0YpxOX6c+nQmolwCRcNOgWc2I20iw4D03AyhQffUguvOou8Buvzi6Yv645OPq p5RZoBQB6/5KRwxxsCLmAl67AmcdWfKQG23KIceWTU4FFwE+UpWFIILOk4oO/n7lKZHbWlPHOzX 7jqfnDFcutXKxGwBHoBFdjmHUtukhoYPWKBlPB1FNejm/TobmOTflZr2KZqCTrEATNi8UB7JLRl JlwUyDyEIp4P9ug== 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/adc/ti-ads131e08.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/iio/adc/ti-ads131e08.c b/drivers/iio/adc/ti-ads131e08.c index cb04a29b3dba..96dd9366f8ff 100644 --- a/drivers/iio/adc/ti-ads131e08.c +++ b/drivers/iio/adc/ti-ads131e08.c @@ -802,9 +802,7 @@ static int ads131e08_probe(struct spi_device *spi) unsigned long adc_clk_ns; int ret; - info = device_get_match_data(&spi->dev); - if (!info) - info = (void *)spi_get_device_id(spi)->driver_data; + info = spi_get_device_match_data(spi); if (!info) { dev_err(&spi->dev, "failed to get match data\n"); return -ENODEV; From patchwork Thu Jun 6 14:26:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13688568 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 BE42A1AB8F9 for ; Thu, 6 Jun 2024 14:27:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684027; cv=none; b=ouuJhOJcd3u17Q/8Lp4kouWaULhLS1Km0M2gm4tDTbiHQgboO4gXUOcefyLipDzdTb3zu954qWO83DpOFwKAzjQNfzvQahjrkw5pNSiNHQQ2FChu8aAeXyFbA3WXimOARoCnQ6p/ePbeRM984WdSKXU5Mrieo3aYRcKn8GaQ1sI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684027; c=relaxed/simple; bh=FBc8qGFzWnElA/PFQ9TDs3wAx45tlZ1u89JH2VfgkwE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=L8dORr1d2TtXTJOpnvMd5SOD87LRGqD10UTwjjFNruVkKrcUfwOagmGuaqPG/+nPOl/XZzYDVWaQWCBwhCvLq413bAY7dC0jToFKhLEfYADn+ctZKTlpEqMACmVa3uv3Xd2+6Orb970L3IFHe6RhorBUiMIfBkZ4wUMdfZCTixo= 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=ufORBg7h; arc=none smtp.client-ip=209.85.128.49 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ufORBg7h" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-42155143bb6so10836855e9.1 for ; Thu, 06 Jun 2024 07:27:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717684024; x=1718288824; 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=npuZ6pimIot2dk7Ox3pzVTiM/tsReKLWyZCaqFTENgE=; b=ufORBg7htAJkM1k26WybudmrclbVeO531Rgq6A1uFKviNtubozpnncBt/6G0ng1SBh /fHow0uJdLWxZ24rd/kLNEh3NPm1BeQbhv9KAMx65vt6RY31F4tJgr3RRpA5gAYpEQ7E OBZK8lWCWdYY/lmweT1HL5HbPh2MqxjD7nGu4YarVlhdOIC8MDLsIOEbpRrZYFYPfver oTyuPoXeeAjtfsrZiUoNG0pAolVWMk4989HveLuO722s7sEKrewk//a/vgOEMkMkV6to lLnaustJ1NfFVQEMQo5YcLrarrSUPTYeaPdm7Iipo8YjSHz8fxdCqTrrm5YQwpoexnX6 lteA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717684024; x=1718288824; 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=npuZ6pimIot2dk7Ox3pzVTiM/tsReKLWyZCaqFTENgE=; b=p+AfI02W7autVUE60janIcwdmavI7qm5XzweZFFcA0jw4PH9ZElmkn8lpVcNxdIrJ0 DVE45FjLtFRm9AUd53zal/1WvqFBXXNkKyKKBGQNMiqVeJ6vS4BF5XrBjnGtJTAshARg g+hgQ9WPqufboyDzLLHsayvBLByrJRWiKdGFtHTkq65//2qhfJv4blRV1ZhcgmoxK/IO I2nPfRqK8YRPVriQ9ViOWfLHR+ZVK/bq5fBCYb8atHnSVrTvdg4SIjPifk1sPgLtOSbP lOi15/IYhSJdzCasuvnaABSTuTJrtfkodjyK2fXLSqyfuhHktlFkUJuBnF654iVOQecQ 5txg== X-Gm-Message-State: AOJu0YyLYumvhrT4L4uc0DK5oRl9Gpwtc9cw/B/5kO6jmzg5nlPR9b2N 3U26MmzowstslgrEV2fHpixQHJhvo3hkKfLZ0+nWeZ7cuXUhhH8aNOdHGgFZUdsPXq4OMVCeknq WV/Q/gg== X-Google-Smtp-Source: AGHT+IH+OTxoo+vdqW8dWyBXEDyfH+yFNF/9AQ2PBeLJ6inJmCGFBR/bf01BEa9NMRz1IJNMYOk4ZA== X-Received: by 2002:a05:600c:4fc7:b0:416:88f9:f5ea with SMTP id 5b1f17b1804b1-42156f4b8c6mr49522825e9.34.1717684024331; Thu, 06 Jun 2024 07:27:04 -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.27.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 07:27:03 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 06 Jun 2024 16:26:47 +0200 Subject: [PATCH 5/8] iio: adc: ti-tsc2046: simplify with spi_get_device_match_data() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240606-spi-match-data-v1-5-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=808; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=FBc8qGFzWnElA/PFQ9TDs3wAx45tlZ1u89JH2VfgkwE=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmYccs927/di3mcm7oyt9XXcT2cHYL/pmf+UHsV ohH0QMR3wSJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZmHHLAAKCRDBN2bmhouD 19/3D/45osNDrzMrpzw50q9ybIhCEj6nXNeo5muXsRcYCgoMnOGCjKOEWPWsmImgoaOVaw0m7A/ S4hRRgVngbsMeEsNd1UpR5Z3os+dUOuVFFc4W3zKF4q9nyo+tiobJEwU0xNFGS1N7To8wLGmvmW v2hvCW8bvCGDUHAIJ/b2zyy4Z3p6gCbDNzID4apmKEci7FwmxzszE0hBkKuG7f9bBjr67cyxvTz 8SyGXBd9CvFPH+hm1zzZ/8l8H+KpudEcIKkCaH1Y0CRaIwssQP+lVbrVcT878svS6ZQ0gnBNLu1 595nde/uwPBjsAet+kfReYD8h9/jNF9zKFgojakZ0ItWE6TTMzmVWRv+oHdkxS6wHCIjf036qjP i0TfuYUqDnAjTGrJaEyylJA/ReeXPFkRvAtZBqByg92YeJ6/t0q95e0f1HDi3IMWKJkWW5LpVy5 B8UeFeEe7qOyZfPhxAhEFRiaz6ON4hCx1AN6ikH8roBlgxA3MDU3j2b4akqrziZlW3R+oWcNpEG ifIZmKqRdHo5OH5uw1l5pv165p1D5zJrUT4SL4jJ+9iKa7Y8bBBZV71jVO1p6lGk0ww2AQv09vF ZeUuNbE5uq8Iqd2niFKCiNou4a/LaFqD6qchnLHP6xTfisjqGTs1Cp3BAelAPevojKWne/qGaG0 hBE2y089c5l0IVg== 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/adc/ti-tsc2046.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/iio/adc/ti-tsc2046.c b/drivers/iio/adc/ti-tsc2046.c index 1bbb51a6683c..edcef8f11522 100644 --- a/drivers/iio/adc/ti-tsc2046.c +++ b/drivers/iio/adc/ti-tsc2046.c @@ -804,12 +804,7 @@ static int tsc2046_adc_probe(struct spi_device *spi) return -EINVAL; } - dcfg = device_get_match_data(dev); - if (!dcfg) { - const struct spi_device_id *id = spi_get_device_id(spi); - - dcfg = (const struct tsc2046_adc_dcfg *)id->driver_data; - } + dcfg = spi_get_device_match_data(spi); if (!dcfg) return -EINVAL; From patchwork Thu Jun 6 14:26:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13688569 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 1FD371AB916 for ; Thu, 6 Jun 2024 14:27:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684028; cv=none; b=jyWQgic1to47F+nSGE7Z/JiCTKdj0CRWLtbpxsNs3lIRCN16yJ+Cv7jmN5iIJAcA+oJWzH029dtAXAK/YS/hO44xdDPUPLjI8YFIXbGet9fMSDBfbb18MLTEqxU7/ZsQaqtLzadvV19ejKigJhtmsC7pHZdBzg6i3j74AG4VAds= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684028; c=relaxed/simple; bh=Hp0KsC5HwhKWjuU0rx+gepKEunDcg2mYhhVl5Vk2qUA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CErm4m8U/X5etY/fJzSpsLVEFrzHTGPzcra4JnHFIxXnqRFxMAoauedz9yFnHzSqpWZQ03lc1BLWnFHdkIn7NY0fPbqFMeNZL4qtUdChYcxRGvt8qiJDex6QzSrn+S8HmyvYFuACkNmFbEzO3BPYWR1zqGsoxmhmDB0gerEAMxk= 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=Bb3TOCBw; arc=none smtp.client-ip=209.85.128.52 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Bb3TOCBw" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-4214aa43a66so11535915e9.1 for ; Thu, 06 Jun 2024 07:27:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717684025; x=1718288825; 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=h+ucwVrP9FqBPlEjc2qVzfZv7KjtrjoEsEhW3bQV3ZM=; b=Bb3TOCBwmnRZ0PvwFhQFn6Vi7s73PiAu6Tdl14MfQV4XceMvHorandXT4ohB8gF08v WooNocXD1YLZLmm8pD99ygqS5YM838wrIvlA/dETVPZXB8V7y4iPdD/iD59LIqqAdvMf 1WqhA0DgPZeg2Mgd4Ea26yJS7xjKvqNjw3VQ1sQbUIKXVCzMiSCIlJADeylu/x/HJBfV ockSIUwIr7PgxjxrYwuDsNgf04r/K+LJMvcqsizRzEtCzukKHLWU82PovujRz/4a63ke kLwSmfxdGJICJc1xzuzUp4pJNgbkBQpqdrxIIBQqcf7qcFP4Rd6/UvxHiq8xe/2jEvhP y/jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717684025; x=1718288825; 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=h+ucwVrP9FqBPlEjc2qVzfZv7KjtrjoEsEhW3bQV3ZM=; b=TGlRpKIkZhCma/5XaMWrTv7k89XayReTY2lsYki+Iskd831yzmptU9I9Gjx3sGhzkv 3z3euqP2hmUf+w1Mg4/MIjxtDTLHmRtaMB7ysS8KOzPDwBclipGmAUNeU4Zzhg2bjmZB EbzmMYCgFPI2Ex2REmvnqYAejGi3H4e5EjvMZzQCCvMYNgSS/wVexpdkkJcSdg9sVRHP pM68rtaqIqu85aDq+VBZM+f2q/F9zBOILQ7MKL9ugiF4oQZ0TyaqoStPoD6jIg7Wx1A2 eWu31sZHVM9v4nfrVaNyijUURKGK1T/jJfqotx7wj1KEwjFnBkt2SwST7qLDCeA3rKvB Al8Q== X-Gm-Message-State: AOJu0Yw8pgoOWlUlVHUfW+ZryIt7n0GT13IQTY7wcZvGWJJTOrG5UAp9 nQ76oT/ksMfS6N6hT0MuBqmFYdVmBzvvA/rCPV2TYjnOdrg/eGYJfMs0C1l6NZ8= X-Google-Smtp-Source: AGHT+IHeRcRhmWeYcqfES9CowAT66RkX4rreoxVuN8gsEg8M2xfS1xjpanbOHWkrFb1iW4cWvwDxGg== X-Received: by 2002:a05:600c:4ed2:b0:421:20aa:6048 with SMTP id 5b1f17b1804b1-4215632d043mr45173115e9.26.1717684025715; Thu, 06 Jun 2024 07:27:05 -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.27.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 07:27:05 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 06 Jun 2024 16:26:48 +0200 Subject: [PATCH 6/8] iio: addac: ad74413r: simplify with spi_get_device_match_data() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240606-spi-match-data-v1-6-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=1016; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=Hp0KsC5HwhKWjuU0rx+gepKEunDcg2mYhhVl5Vk2qUA=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmYcct9AkNfOhrdv0aXgz8WbT8ItA0nYChb1IkG tQJHicxlJKJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZmHHLQAKCRDBN2bmhouD 1+8tD/9kGv0CRdyCorpxMDcIjlDugigaWQJF7veYJcxaXGNet5oxrENs39tNOSueTabB8gOVlFY EqPaSBiBGuUSxI57j4FJ6ZVgvhh4fa5t9sGsjO/vEGA31x58rnhlzJ5DkFjyVQSTnACQxjgHx7P zY52/H6bYjBQ6BmyJ2B93K51azN1RxkFbFf1/DRWYyeNL/dJqj2mgp4t1WD/OYcDCT9lqDPfEzE e8XDcxmIbC0zGwdOF/oRIhnebOz8U7sz5eJdqlkI8f8bg6qvcqRUs01Uz2YmuxmiCF2Ft+CrJ5Z AUZa6MdtvML2QwH5sCgnEgSzFxr/+GxJEcX6ajrdUfZ/7Ryo0F5ndepHJt3+LWHNvAev3Q28DGz dNd4GH1hJQGNAFzy+RhWixDNPGhFm/3MvIxtvmlguhrhMhnv7sSMm2Etr7mKTUGq4x74zGSc25R w6cX8cNdupXHTbyZe7UL0I2nuHhqVOFIW4w5ZoBmMd8y9LaJ9xsIq8RTD0PksazzEJua3ejSqsO PQPJnOk+dIjK9RTSCVlWnqydBPb7R0kog2XOiDVbAZeVSUNsBscuIqqYLI0X7CgVeltRDMgp1x1 Z1ASWW+lqLAkgsy8NqqLJALd3hwCIsFLpxOZoBFhbXDEv8aHrAFdBGm9aBFXL7icaGco/deAuwL N4NNec7gwA477ew== 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/addac/ad74413r.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/drivers/iio/addac/ad74413r.c b/drivers/iio/addac/ad74413r.c index cd26a16dc0ff..2410d72da49b 100644 --- a/drivers/iio/addac/ad74413r.c +++ b/drivers/iio/addac/ad74413r.c @@ -1365,16 +1365,9 @@ static int ad74413r_probe(struct spi_device *spi) st->spi = spi; st->dev = &spi->dev; - st->chip_info = device_get_match_data(&spi->dev); - if (!st->chip_info) { - const struct spi_device_id *id = spi_get_device_id(spi); - - if (id) - st->chip_info = - (struct ad74413r_chip_info *)id->driver_data; - if (!st->chip_info) - return -EINVAL; - } + st->chip_info = spi_get_device_match_data(spi); + if (!st->chip_info) + return -EINVAL; mutex_init(&st->lock); init_completion(&st->adc_data_completion); From patchwork Thu Jun 6 14:26:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13688570 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 83B591ABCB6 for ; Thu, 6 Jun 2024 14:27:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684030; cv=none; b=IP8XYFlFjP1YNvW4Jtlxi9Rakyos/ci19q2kdr79plIQ90HYgrw6Gz9uBLhvhl+b2np+xYx4tXZSCLQCLstadu/pKxSfaQ0fV0vFFMeCDIeHGoqV4e6LtROX+5Wq1OEAWpk8F2H7bclM0i4XrWthVBKCiRREDn82ycBRzobfU6Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684030; c=relaxed/simple; bh=CC5VrVQlrTO5Z/KVeJTa7No+6VHuZqxo+QMeYJcB7JQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Py4n1MtlUaXRvTTi/wwZRPKILVqByf3EXWGd8ip7ybveBJvzIbYfwCZ4QTS9xTE2rZQD99zKcQHy13jMn0+kGlW2r51s5HUM2zzMeJLCPlLhdHxLi0ByIRUsusvrOZ7N7URGOQnWnh9pKr9NVKk53mv6EW7LFtcJHQnZEzrk/F8= 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=TRI1MRzw; arc=none smtp.client-ip=209.85.128.49 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="TRI1MRzw" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-42155143bb6so10837355e9.1 for ; Thu, 06 Jun 2024 07:27:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717684027; x=1718288827; 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=4axVnQS/++Nc2i+YUJICxGzNngB4GBatJqXLma6H1do=; b=TRI1MRzwuXxen/ja6VVAZyz4GVSGfC+hcdk4D+X2lNz7ZKw/osWR9ofS87awfzDbza tSAE73pLNUeTtFN5paPnYGzqw2HYOylRRcmlpH1X7GQO2goVAPoUentBjz479Xm3QqVz Q6IcgakLsSIIJPTiPMFeiT/vEfBGN9B8p48Zn6hnjh630OhbVgwrNRU+cdIn/QMS39lj dwuV+ShQ+FW9ripKun3ryB7wYqctSMH5rwM3+FGJ7ROGo32BYePjM5Ch5VjI9W9iqFrb y5egFn0YcQvjmdEaIXxT6C8UPlFKWRLCNTIZSlVVrtQo4ZbCXyNWHBtnGDPNbGcEmVK8 PRTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717684027; x=1718288827; 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=4axVnQS/++Nc2i+YUJICxGzNngB4GBatJqXLma6H1do=; b=RaB2nfGS2j4oMKpPXRC7KWgAh6HTDCuutvNrSNn6Vyohqm1C45OoEaenFLEj0Gs8u8 n9tpkZtyA38NGBufWRpk+TlsZZHlKudGpCPF3KOd+ibbIEq4wX53wKA+IZsaXAbuhc6R 9i7bLSgzAot21Qt9LSPz1dAm2/V4IyfT+IDX55aPFToN2pfMhEDcDGignl4DvgDMn2eD CTQpAbyqvJIXNqiyq5asZPNOgt2bWVZcXO1qpWRWbcq1Q3Cpu9jgNRSWjicAV2IAdOr/ TQGnsg/0P8L1i5LmylfFWNwjrtSXcm0bUTQzvHlZJ33bh1GcX5OIpC724kKsc8ZM4KO5 lO9w== X-Gm-Message-State: AOJu0YwrfE/zHnWji1NGg5tKe02xuADJtb9Uz0FRgj2GXqbKLjiWdeMN bzS+GoNhcpt15pgYjtGk9kNusJXuREiRn6omQeQMqEgUnVjZbNUBZieoGbn0WpA= X-Google-Smtp-Source: AGHT+IEJuwTCqX5RmDMAu5H/s3UUPo/3WRLZMXx7hkYvhTFJQcrS94uqo4MpNpYTZie9aiFibV3T4Q== X-Received: by 2002:a05:600c:4fc7:b0:416:88f9:f5ea with SMTP id 5b1f17b1804b1-42156f4b8c6mr49523655e9.34.1717684027112; Thu, 06 Jun 2024 07:27:07 -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.27.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 07:27:06 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 06 Jun 2024 16:26:49 +0200 Subject: [PATCH 7/8] iio: dac: max5522: simplify with spi_get_device_match_data() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240606-spi-match-data-v1-7-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=1238; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=CC5VrVQlrTO5Z/KVeJTa7No+6VHuZqxo+QMeYJcB7JQ=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmYccu027SZwoUudm2dp63YPEyNKqqdVmF869JM n+uLe24iweJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZmHHLgAKCRDBN2bmhouD 1xObD/9qSysP2WI4q0hMcptlW7EFePOZrF++EfQ+AE/5yTeXHKbTaJkBvj+Kmcl/LLjKk/e1tUL g0uQzmz4uJbpSbitTdg41vQjan6IO0pbMG7jgsED2+FawWLIS8Yr9ezPNLhTbC43Pvam0z4FCbd Hg5uHWPGIcrCk/fp/a4QqiWZ+2e96Fvx2fiz4effSx/aNSNQIxfFGaafgOmsgulBshuLqLEZHBq 7WdU7sOqjhoTi1cqE6dMiFvox75AG8LBz61PB59cBaR6DnU10grrcbfkEVrTJB+p6M2qQWt+DTE jIvf6IUY5kkJHIky/lDT8XCRBZ+pqBQmAejuWkQUQyoL4npkhgj1BCJRdSFSORevWmd7Hih4Ia5 VIUF2ItM/bAgWt5vfpnXCyl3JOIysR8GrYK8Hl2FI3vYBy43nie/H4lwg1cK4TU1f9Ixp37/gdI UpReTNB9LulcYk/LUZsd/6sLJAhxPROIobDZXaN4zGnb6gNdS2C/4+c6NeP3M3cA3IXHEnIocpl DOC3k7CM63Y4Zequy3ms/9kgErj32ffPzfKwKFLGrbsuZYlvB6LtGy+OLBOITSuIB0wwG/bU0J6 zlCCef81qr9wI7zMcbNpE763rcsrzNHqHcvy+fHshDUafrHMEZZmTCrII3enFNMsIjVV2ZyeuPY gf+3ZElYe0SEYTA== 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/dac/max5522.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/iio/dac/max5522.c b/drivers/iio/dac/max5522.c index 05034a306597..9f72155dcbc7 100644 --- a/drivers/iio/dac/max5522.c +++ b/drivers/iio/dac/max5522.c @@ -132,7 +132,6 @@ static const struct regmap_config max5522_regmap_config = { static int max5522_spi_probe(struct spi_device *spi) { - const struct spi_device_id *id = spi_get_device_id(spi); struct iio_dev *indio_dev; struct max5522_state *state; int ret; @@ -144,13 +143,9 @@ static int max5522_spi_probe(struct spi_device *spi) } state = iio_priv(indio_dev); - state->chip_info = device_get_match_data(&spi->dev); - if (!state->chip_info) { - state->chip_info = - (struct max5522_chip_info *)(id->driver_data); - if (!state->chip_info) - return -EINVAL; - } + state->chip_info = spi_get_device_match_data(spi); + if (!state->chip_info) + return -EINVAL; state->vrefin_reg = devm_regulator_get(&spi->dev, "vrefin"); if (IS_ERR(state->vrefin_reg)) From patchwork Thu Jun 6 14:26:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13688571 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (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 D69F11CBEBB for ; Thu, 6 Jun 2024 14:27:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684032; cv=none; b=JTSsRtt720QvJgC7bLS58feQh3euHqLgI1JjPf5jtK6XKLMyX+/QYkxSKKlbbLlR3bmowTd6p5Zk7KEx8XFyRmBTHEMuKDQEaorbCzUUXjPmn4cYHuyCt7lkPo871M6iv0Xv5rxgBxSBKFo1pYLKZLpSFb9xZVsNdRz1vH+OxB4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717684032; c=relaxed/simple; bh=/Drt9DvPT3iPacr8BHFd0FnwQyhtB9dBAHbphjiKxpg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bNRClPZ44R4NRBG2Nmvpolpg5lx5tv0W5iZinOse6hK7qUZCWn3z9lJPr0xD9bIixdyr5AWnzkLWIYSqAmJl/txFKQz2w8CWvGjjTLlHVavuL8vWNo0XddzKOcFYOfPJQRP9FLJYZxVgiJlzgJ3PKMFqsNC9cbLbT2HOpJAaRS8= 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=bVYzO7F1; arc=none smtp.client-ip=209.85.128.45 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="bVYzO7F1" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-421208c97a2so10450595e9.1 for ; Thu, 06 Jun 2024 07:27:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717684028; x=1718288828; 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=3+ON/wkAKBmuxABFUuc+U89h1GiBlQq9gib75ECTHco=; b=bVYzO7F1Du7O1daD7RRXQ3THaYiLXy8YZEXQFEwJKBXJvG0A07An0FeUlIbBE0UVVX PBJh8V8DF/yf9Jw9a9avTbyfJ2sodRNj0cwZXK5oIEGq0Xtom1T9mCEpGCbnBRTM3IF5 SLLU4fJuHDGMddR5wTUvwp5XTxn0s1q4XDmbp837ok9kqkNCdhqQLUyqNebzzVZZQLWW xn4Tve2QojzRMxCc4hLP1cao7U153Nu+JWyoMAARlglfPfhMftQdVQ64JZyvN4h9TCxz 2ZdFDK1ASZEsJiPxB6D5XpGb6IA1FOc+9x96eMRhrbtL2sfa+kJIHxZz+sIaeyh2vVZM kF2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717684028; x=1718288828; 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=3+ON/wkAKBmuxABFUuc+U89h1GiBlQq9gib75ECTHco=; b=FFKTIBwnx0X/cBDTxUBnaiL7cCKpTEjh+THLJivhv/xZvu4ZwkjkWp7WJexqWsoDck T8frVo9snGRV/bcpxnyz/F4xhu0iQZfB9rUhRyHm75/bvtEKYiE1lz2L397l8JesKooQ rpZsTLfv7dxbsizEgHAPirSZ3SZw/6gq0XysrrbFSjYI3+1iog8dGrwH7Fq/FTR3Ylq4 pPeWptMC58ljJ8y1otyrYuT8hbS0D/bUDOU9mQddjQJ2PFe3ILD1hRumXDhG5Ud2f82E asMCUEUr03W8UZOYps9FK3FHJ+dK0SkJTFBXjaRXvkzXQUAKMg+JghU0zJK2mglCOBR1 w4oQ== X-Gm-Message-State: AOJu0Yx/ZlIaeRVBMZyq24RnivSN/0uMAmsC+BZsGYBAXmaRjNwGCZvT sVWwLtD8NIZxSJA0oNv5k0erfddAusZ1PP9cGN0JQVY1MVH1tPrqc8G5TC9G0hA= X-Google-Smtp-Source: AGHT+IHyBXsfWnnY+dpEOaBk06feEQHV0wQw4MfxmfB1QhpJtZsLeUZjAg5UoLph3AgS1uzeBqFuPA== X-Received: by 2002:a05:600c:3550:b0:421:5288:63df with SMTP id 5b1f17b1804b1-421562cf734mr52054265e9.11.1717684028385; Thu, 06 Jun 2024 07:27:08 -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.27.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 07:27:07 -0700 (PDT) From: Krzysztof Kozlowski Date: Thu, 06 Jun 2024 16:26:50 +0200 Subject: [PATCH 8/8] iio: adc: mcp3564: drop redundant open-coded spi_get_device_match_data() Precedence: bulk X-Mailing-List: linux-iio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240606-spi-match-data-v1-8-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=1323; i=krzysztof.kozlowski@linaro.org; h=from:subject:message-id; bh=/Drt9DvPT3iPacr8BHFd0FnwQyhtB9dBAHbphjiKxpg=; b=owEBbQKS/ZANAwAKAcE3ZuaGi4PXAcsmYgBmYccvHAlB7a2d3uml14VcNQVQcno4MG62juiap AWDoGyQoZKJAjMEAAEKAB0WIQTd0mIoPREbIztuuKjBN2bmhouD1wUCZmHHLwAKCRDBN2bmhouD 18N/D/4zmNIBRCfaS+X2Tbqwv0wbam22Rj0rrVINzmy+8LpDrghxyf08QLn/Y9TNBPqrBewXpZA 3b8NtJWnJT+9LWPcIijpn/z57vsqvUfsLOKG70OEjRPf2TUZoluuZCDmG8QYOJYoOe4TiknvtDi lpLbQBfz8g+wdBF8n0G5tVzpeJBA6ceAfVFjsDGCmfDDBP2otzWGeuaQJhz02T6UmRJC/6T3zzr suZiC1Qs/IwbkYq41nYtGwpuQQizBzphqP1iArF6Nj33n8uwFAdaSQCPc+y4y8H8DEj27KUu2gA r8MFvX2xp3lRAJQCG9P3hBPPA96q0I6MLH3SthtYQZdv05LiiS8dNQqPmHm3iZk342VbzgeaImC fhLryLpkM1zinqavJZK/A5P8xqD/0knwtT5G0jWxOUT+CTvNc/GwZlQtujMsR7CZm06IIt/MOx2 aga7/XXj0w6bJpejyytriRYraKR8qApQZR2SrS50n1DgAa/Pbzp5DShbAZnvTQd4c4407gNLJhW 3BfUjs+6vjqq95rT+fooFe/y/3nWnYrOevIfnLKVm1sjhTTEFDoRTLUow1splnX+QjcTfOCRKdJ ExdKlOLy6yNsQ6063IN+yWp/3mgv24eFF+xXmVqRpQfDhtDz3ajSw6OhRWYoCS0omqA3FG+3xOc 1z6rbxXttNnF6iw== X-Developer-Key: i=krzysztof.kozlowski@linaro.org; a=openpgp; fpr=9BD07E0E0C51F8D59677B7541B93437D3B41629B The driver calls spi_get_device_match_data() and on its failure calls again parts of it: spi_get_device_id() and getting driver data. This is entirely redundant, because it is part of spi_get_device_match_data(). Signed-off-by: Krzysztof Kozlowski --- drivers/iio/adc/mcp3564.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/iio/adc/mcp3564.c b/drivers/iio/adc/mcp3564.c index e2ae13f1e842..d83bed0e63d2 100644 --- a/drivers/iio/adc/mcp3564.c +++ b/drivers/iio/adc/mcp3564.c @@ -1114,7 +1114,6 @@ static int mcp3564_config(struct iio_dev *indio_dev) { struct mcp3564_state *adc = iio_priv(indio_dev); struct device *dev = &adc->spi->dev; - const struct spi_device_id *dev_id; u8 tmp_reg; u16 tmp_u16; enum mcp3564_ids ids; @@ -1212,11 +1211,6 @@ static int mcp3564_config(struct iio_dev *indio_dev) * try using fallback compatible in device tree to deal with some newer part number. */ adc->chip_info = spi_get_device_match_data(adc->spi); - if (!adc->chip_info) { - dev_id = spi_get_device_id(adc->spi); - adc->chip_info = (const struct mcp3564_chip_info *)dev_id->driver_data; - } - adc->have_vref = adc->chip_info->have_vref; } else { adc->chip_info = &mcp3564_chip_infos_tbl[ids];