Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp911717lqt; Fri, 7 Jun 2024 02:25:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUMtZsgNeSO8ryTE3DIT54l9i5dF8lfOw31yKy++eSctXgYK+PQV9m1bFWOYSlvlfvCrs/91Em4y6GBTluOErKfwSLYpYLlIJKTuk9jvg== X-Google-Smtp-Source: AGHT+IHhL24i76dKxfNB9XWClXlp4IfziExmtcOWsMei+x1Fj9bwAQvh1B/7/B7/HnYSu8PJmjmZ X-Received: by 2002:a17:90a:fa11:b0:2bd:47fe:6dec with SMTP id 98e67ed59e1d1-2c29996c181mr7147824a91.5.1717752331566; Fri, 07 Jun 2024 02:25:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717752331; cv=pass; d=google.com; s=arc-20160816; b=YONviT7rm5wl8RuYxneVO800rekJ2z48IUVB78IwG26KtVSt/z8zDAaVJFirtv4Tsd cXcmqhcHgU0uXki/5tRFXi8/yPEPXVmw8nOuHEuz/8TsW43cHokc6P5XHebOQqUdP+64 BKeT6ug27cNWTyLdhxwuAFzTyjLhq0ZaFRES1mbKEmubQD9XHhmJxXKVD5rsYD0yqh2u 3DUmB2fEQ5ZLPKxv8lWec477ZaWbHRA4JKq7XZ4da/j1GjVQpG93Cp0BpFHcU1EYbX6S vE+2ZjV7I02bWvq2OA01nGjGKlYA5/R9Dc+Ly3jcUWSq/HJc0v/SR17uW+u6Td5BlV+H dvyg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=IDOvdQG4G5HM3mc6kbrR9DttpzyvecPUDpSffGUSbyw=; fh=3TZXhfmAiuYl4R98lje3T+9mdejJeXikigfEtxjVIkE=; b=FY5W1zXyw+yqRePUOLwy9fKgvMuxtZz8iNi5JEUxA6VYY43F5Mr+XaXAq2TgXYHg99 9r6FS0VlAS5dbzTpFX684lhYigpUmusy5yZiWmG5LIqvITlEPwIu2Q63QP86jGQPU/Jm 5eeHDHikinX2t+SmDx8D55waKHbcX1zyC8EHWUoX9lEBJUb5r+b2BQ99c/oV+pR12kHC 62sqCFWA2qHhGGny3aZStwC8pBkesm9aMOrXteQv9f1GfmGhlm+NHMzBE4d5HPR5YalC e6NiistLuSpR9PyAMM2L/lXbKnWE+idE6TSl7tqajSyEXRGG9Y0CeU8wtEeg7CeB4kVh I0ag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Dj2f/I4S"; 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-205705-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205705-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c29c49e3b0si2680164a91.170.2024.06.07.02.25.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 02:25:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205705-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="Dj2f/I4S"; 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-205705-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205705-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 0E61FB21FE2 for ; Fri, 7 Jun 2024 09:19:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 519A415B551; Fri, 7 Jun 2024 09:19:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Dj2f/I4S" Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.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 AA80C13A40F for ; Fri, 7 Jun 2024 09:18:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717751940; cv=none; b=rUSlUWP8cFnFMyhlmTj0DONmS+Q7z+gj5L3GCe7caqxGTzEEkKXoBNkt8KwhGydBnSUFjbjRFcoz+39gSuDAvn81AL31qqSna4Yo8mMxQI2zWDVUvcbRUPGtQ1IALmazi7jb3bYBrfqNqCm1TNKoLl6muxU8QWydjpyX8JkAxVE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717751940; c=relaxed/simple; bh=GGBwkNwaKLuAZt/gpy69pFlBu9B1OahtS1M1l1qbKpw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=pkz17iPPSQTyZ5g7b0X2MkQWc0i1vShUOmqTxiUZJvXtQUG+jYPux3/OGGACZWiEpnKS4ffIAcXRpMG/FIql92wWPX3tpZEeyn2wtJ1DhJVSTDvzZaLDu0vfcjtKLPHBVb/YVcOwVQSJTmG9bb4v9BOkmIEad2klkD+29doZ+Bg= 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=Dj2f/I4S; arc=none smtp.client-ip=209.85.167.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-lf1-f41.google.com with SMTP id 2adb3069b0e04-52b840cfecdso2229032e87.3 for ; Fri, 07 Jun 2024 02:18:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717751937; x=1718356737; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=IDOvdQG4G5HM3mc6kbrR9DttpzyvecPUDpSffGUSbyw=; b=Dj2f/I4SPJUrM3xIIFU29m1RycEmZCvrXV5EmyYOyRUnJHBvM5ro3r+D8z93XJ5rIc XW2KJRaVcndz3mXukkeR0wu1KEGDoMtid1nGCYNZmuMtQDXouEN6DnmhxVbN0YDYxlWB HxGnitYgzRmumJmTqG2Jyh1oFji2EqHHmpRnw7dVtgisV/MuhKcDZtWzDiVfTN+1Jctf Mg5FstwStxRtIUQyDcjI2SHmY7Rh2YRGrN0+iVzF1BYuVTKc6ydi8WEGHicual3AjtiD 06pkHj6Ny5JbcIV/36vYi9sH8QAyJ/JEPblVNeNpqzQX6egcfBFa4N+ZjXfZlng4Ica9 oKcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717751937; x=1718356737; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IDOvdQG4G5HM3mc6kbrR9DttpzyvecPUDpSffGUSbyw=; b=eo+YIGi55Yk9fmPc5Gb0NHGKsdcl83DF4vgFg0fDM3YSZ4kEEWm1J5c3aZ+AmOW6qW huJohZbAc5WswANPTlKOhZsFo0BPGokfbcotaJZ7YRmpgQ7Y2NMSgUfcflaVRMftEH8d vXT4Gurya6Dt1659mABmkfqsBpKL9r7tpWSiay6OhiZ5QXjlBu1GXO9ORY75BPDEu00R C2OcbofJCQBtIUHHc066ipv6zTlFuC2hY5woqVmU5ZGllaOot9p9rQ7TKkDQ4XkyBviR 1zFXP7i0i0jWhX35GITU6dFHayRPzb/VHPx6UWKUGOdKf6YNoCdmhkIe5lAEymvxN2GW Yr5w== X-Forwarded-Encrypted: i=1; AJvYcCW6es4Uz2OAtTS/BK2fJ75xFYswt7SpHSVxUvMh2zP3pr3vMOFttaOA08sYXDusaGBqfICa3DFUF7WTLI+L1RfG04apDtEMi7mKIVbT X-Gm-Message-State: AOJu0Yw0QUCGMr5UPk+ow5aR3v6FTWQS3aZmCUVxVPxdIN6gbGxLHOCl OxEX+qrUQz4ZaTErv0dsO6PoUNP8G2kQSgCf8nuHxMLu/8x1c9QDcinNPhNOu0k= X-Received: by 2002:a05:6512:3c81:b0:523:da2d:6b8a with SMTP id 2adb3069b0e04-52bb9f7cdc4mr1563602e87.24.1717751936643; Fri, 07 Jun 2024 02:18:56 -0700 (PDT) Received: from [192.168.2.24] ([110.93.11.116]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4215c2cd247sm48597545e9.40.2024.06.07.02.18.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Jun 2024 02:18:56 -0700 (PDT) Message-ID: <69e1a5b1-e5ce-4bcc-a0c4-2d02e777c296@linaro.org> Date: Fri, 7 Jun 2024 11:18:54 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/8] iio: accel: adxl313: simplify with spi_get_device_match_data() To: =?UTF-8?Q?Nuno_S=C3=A1?= , 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 References: <20240606-spi-match-data-v1-0-320b291ee1fe@linaro.org> <20240606-spi-match-data-v1-1-320b291ee1fe@linaro.org> <7ecabb8e342b9bd4fc2552bce29dc8c7a98971ee.camel@gmail.com> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzysztof.kozlowski@linaro.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU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SJrvMJzPT/+u /oVmYDFZkbLlqs2XpWaVCo2jv8+iHxZZ9FL7F6AHFzqEFdqGnJQqmEApiRqH6b4jRBOgJ+cY qc+rJggwMQcJL9F+oDm3wX47nr6jIsEB5ZftdybIzpMZ5V9v45lUwmdnMrSzZVgC4jRGXzsU EViBQt2CopXtHtYfPAO5nAkIvKSNp3jmGxZw4aTc5xoAZBLo0OV+Ezo71pg3AYvq0a3/oGRG KQ06ztUMRrj8eVtpImjsWCd0bDWRaaR4vqhCHvAG9iWXZu4qh3ipie2Y0oSJygcZT7H3UZxq fyYKiqEmRuqsvv6dcbblD8ZLkz1EVZL6djImH5zc5x8qpVxlA0A0i23v5QvN00m6G9NFF0Le D2GYIS41Kv4Isx2dEFh+/Q== In-Reply-To: <7ecabb8e342b9bd4fc2552bce29dc8c7a98971ee.camel@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 07/06/2024 10:57, Nuno Sá wrote: > On Thu, 2024-06-06 at 16:26 +0200, Krzysztof Kozlowski wrote: >> 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); >>   > > I understand you're sticking with the original code but since you're doing this, > could we maybe add proper error checking for the call? Maybe Jonathan can even > tweak that while applying... > > (same comment for patch 3) I consider that a separate patch/work, because it would have functional impact. Best regards, Krzysztof