Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp434909lqt; Thu, 6 Jun 2024 07:55:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXcJflYCyHc/NHj+Sz0DSXiUu31TARnc23oeoVPiyqc7J7AvYohRGPQ7d9ci5oQl85pPN5NrfUgack96CNcPuIPjMHwfwxLtSlgEQ9BWg== X-Google-Smtp-Source: AGHT+IFNASWRO4o7j4KfCiU/ohdoM2G8//KJzKDxuLQLn8DrI5Q9a+3/T/s9zZDtcOua7VBaqH8E X-Received: by 2002:a05:6a20:3255:b0:1ad:3d93:b71e with SMTP id adf61e73a8af0-1b2b71a09e3mr5116340637.59.1717685707525; Thu, 06 Jun 2024 07:55:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717685707; cv=pass; d=google.com; s=arc-20160816; b=d4tfJUe89KNHNYyb5gKeOOwwhpx/0twY4/wWVNcugxZijqamXkfxcRC58xOI0yA4Yu dRIYgKs1fTJp9c78hJV915/Ar5UkRfrLL8mML+5DUIklIEV59qL01cRyc9nortFgVBgo quSr2pX/o0fMy0c0rn/YQTg9yyUZrOqCUKHXGvdj/oRx/KDjfVjrWrlFZy4KGsuTGxiD 6MB/ObURtxXathmaaglCfRTWY1LsztkOYKQHVR5iRKjTGFSoUUX7t6jRrQ+EBDxYaOaq BNhlTxex2k9h81PRbRa+AP7U4KhvsglgtykIFlmMoa5DL9HmuqcR7Tw4dzMQmxZfRwfq TjuQ== 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=h+ucwVrP9FqBPlEjc2qVzfZv7KjtrjoEsEhW3bQV3ZM=; fh=0Kvp+iQzlBoIdb5qgfjfMaPRobGUM9xZyKokYOprXeg=; b=i9vyIH054nOCakGJPT5u++ZhLwIZFbEWSRjLy9mBE4cH9GNe0fYxP+lyCGTu5YM2KH Cu9thmL0FxPwFfXYmki/A9eYVagur7McMORVEKjY1ZwosoQqNnhOUWUvRKMyoXUcd4Q8 /ZETG9r+gzrCCnywCdC+PrzZ1Gcp5IwMxgDhqn28Wq0W4mXigelTdBcjudhhx2CFW1P8 ca/M+o3n68Ym+1CZoZMfw6UZhdUgHYZ3B7H1zmeRi4TemZVlHU+R9nUI48Fhe4YdOQt1 +/QhDJSDnlmhNnF3mFtmBZ/jOzWf0lN4K6yooFF4s5NU3tRXr8qkiW8Ye26TiQhyRrMg 9NWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Bb3TOCBw; 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-204467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204467-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 41be03b00d2f7-6de29db0a5asi1359117a12.781.2024.06.06.07.55.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 07:55:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204467-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=Bb3TOCBw; 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-204467-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204467-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 AA8C0282C45 for ; Thu, 6 Jun 2024 14:54:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 717D61CBE9F; Thu, 6 Jun 2024 14:27:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Bb3TOCBw" 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 2B15C1AB917 for ; Thu, 6 Jun 2024 14:27:07 +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=1717684028; cv=none; b=GRedH8cD4qHdEQ0TlIiMdSt4uPem3iW7iw3LFjNuSa0wQzIvN3tm4dfHFgNl/6Nd2C9DxLwG4003rzcgBs98pBghxijDNjx79x7tW8A7LgN96QaLb9ihQ3/jHPH82gI5RtsQ7IBDAmjx8Mc8UbSnoeyFErvZ7UZsYUzQxZTr1eo= 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.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 Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4215b0c4b7dso11162935e9.0 for ; Thu, 06 Jun 2024 07:27:07 -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=OXU4ZPJY8yM+9DO6drn9ckHCOKssYBumZypK8g+rynD/zkviOIt7Le7FOp0QMe2xWf W6z+dLCkouHOGXFgub80YrYAKwjIdaXe6AgBiXrSFsoYncJxiLi999MxTL7f66pKXu+S JHfzzb8izh6pUdq73ZUKuQf1sseVtWddXBY0X+Ivmp0wr5UZYihyoiSj2bne9OJzKLwT d4/rWfzRCxY/jFSWo+EK5PL11PHRYkfM5W3nWnm8Asjbhh9AIuUVo1F152xvgeaxbLh2 Tam7NHO+AMLTprBn7SIev9FOYLSv41c82Tlwjrb2cbl3fRjROIDgkfCBskZWx3rgBgEe O3jw== X-Forwarded-Encrypted: i=1; AJvYcCXwaln3dK8tdiuI0t0SmVcJZYUBLum0uqigrSAr7/hHKhG4SBQEhkSQc+PxcgcRjlpglgpWFqGUd0Tr5mwkIpnMiqU1y0fzVNXBEGDB X-Gm-Message-State: AOJu0YyMAaF4Boz6MbeF4HNkkvG8HP2tBrZe/YBDg30JmwKjZdnklYnr NexRHj4pOwLnqZTYq4U36ws7dROqgEqgOhTW2rPhv9tXDqUh9MR+/XXKigVW6qbQxJhVfkttkpU 6ZtCsHA== 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-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-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); -- 2.43.0