Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp475870lqt; Thu, 6 Jun 2024 08:58:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVlfzZ7OCCGUPJFV2K+bvp+ULVdZcokA4dDNH9ZA1DEAVtCIvvOPU93s3FsNcQlQYjru1PyKP0KlflbeXxAkcjAS0VpqQhavq8mSSUmMQ== X-Google-Smtp-Source: AGHT+IFXC6WlLBoChPBMfSXS16caQHkgfDPnTwSrD9tRLsJT2BSGq0vtGYlGfP3AJqAnj9fRDV4u X-Received: by 2002:a05:620a:c41:b0:795:1f06:f62 with SMTP id af79cd13be357-79523d458e9mr707349885a.31.1717689493464; Thu, 06 Jun 2024 08:58:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717689493; cv=pass; d=google.com; s=arc-20160816; b=vcd8/ZJh6yPUD5+W82EIItW9ZucfojI7xAsH8WHTIzRlVzW/1DjFIfsy+ruHZgCf4e kJ2Y4DAGs+xPkUa+wtA58BChr7MZu8f5wKcjDNFzIYiUZ0jq3jzoCNUv7aiVA1au41hO NY+8Jm2/WQ26Ms3ymFAyOwWQktjnqSP2dlhwdxOX4eXxWLVNinXfo5VH0NtEZ3sHDEap +b+7utz+N4vZQKZSpZ5Ue0LhEwGsGQwUcGQvJm1eIbEpYGhCtaHBGfJ6bo50LsVPce5M e0d7h2oo2ilrzLQRQYO22C0DGCE1ajXl7cnIvn49t2smA4eFSafiQZnlSz6TwnpHpSU7 DwEw== 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:from :content-language:references:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :sender:dkim-signature; bh=rIY0Sjutq2SY/qAhA7gEXlN2ObMxXgioEhBGlNvC0rk=; fh=SLr8UDUQG061WeoHx2aX4jPCTkE6zHm3AgqJ3j6LIRg=; b=AkCoMWRd4PHp2kumSSBL1zJJRloWekYV9fY6bdOXDDGRbK9FwgzHvO7YEsUtAzVz7X OuUVntjwFDJ1HXvvTQCtZx6uP5BQDFSv3IcSQ5efOi3yVllMpBSTA1DckwA0dgYHMj2S 7xSPFpG2iPZ8ooJ44f54QTLX1rVzixeXp7Tf+ylEgiTks7saE+y78W1CinzVLuwMvHvj /tK2A/yVdR0RBQLEp58yEtSHGHZ4ONZ0hbsT3RlmOGiGFskoygBF78n/QWRb52qpfYfd 7mx4DSRnv1vcd20meOIJ3/A+yXBuW8l7Fd6Utw5KUoSvBZ8bunzAE0ovtqs/BIsr2kq4 Rupg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BrlWybBZ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-204627-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204627-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-795331ca58fsi51028985a.314.2024.06.06.08.58.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 08:58:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-204627-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=BrlWybBZ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-204627-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-204627-linux.lists.archive=gmail.com@vger.kernel.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 135CF1C21F09 for ; Thu, 6 Jun 2024 15:58:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B0A0197A61; Thu, 6 Jun 2024 15:56:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BrlWybBZ" Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.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 9F43D19755C; Thu, 6 Jun 2024 15:56:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717689393; cv=none; b=IYEXUKl/wEvvSUQNvXJiIqY3w6+DkIArHMPy8GBfL7NsDp68xGekAYeJKbEjwW1HVRez7abV0ZLjvwBwdOIyt/Cq1nFLVfkbXh3kUNS4OudmAd+RUNtlDoY1vDugY7gyco+ZnwDZ7+X8eLAJg9FYZ1/wA6T+Jd7W0+d5+zts7L8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717689393; c=relaxed/simple; bh=aN7hkfedECxgkVE23qR9N+sYKz/S1B2IOFGhsAJmM2A=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=TJ6QJjyXA2k2F21uXOzG6nYejw7B87stChmxwa7DJZ7CsxmRytP6Dm+DnsR/38wpB849EgO39Q51BQBfq84bGDwNJK67ancOqCMtxy+ufnvb0AeCFIkQDOk9cheVLQciAED+c7qUdVoTP3wznPJwrR9M+4dJKDTrNHw+QOGTFgE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BrlWybBZ; arc=none smtp.client-ip=209.85.216.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-2c210d3dc6cso906302a91.3; Thu, 06 Jun 2024 08:56:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717689390; x=1718294190; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=rIY0Sjutq2SY/qAhA7gEXlN2ObMxXgioEhBGlNvC0rk=; b=BrlWybBZ4YXlJ37lAri8GzHrrAPk2/s9IMQPXdbH+bHMC97R0LrFc531g104aBPIZ3 GCC/7X12fZrNzsiA/NLWhFxTzQOmUDaDai0s4LccAO7PrlLMUu7HAQ4nxHZ7auYtI7WI 2Nlggq4d2ZKUmOkT7ICAvYrwHLGtQ0PQk6+7QCBp21PXIT4/q+vLbk/OkMli+IK+4soX 9QeG//t4EdoqGkzITqpai7hvbSV1EAQZIdPEsOVci9/9m3kLreGmO1amTO39JLmHF90Q BxyyQxD8B5FJADPXjO0lNYczcqqibH12XebaTXfY1FCB26AjmIgNyVSEq52kQZy3MMl2 p/lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717689390; x=1718294190; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:to:subject:user-agent:mime-version:date :message-id:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=rIY0Sjutq2SY/qAhA7gEXlN2ObMxXgioEhBGlNvC0rk=; b=m0xVJoiolVT5V37ds42399WJQEBC3tPfVn5LShP597sX5BHCA45mXBkuvsxOZQms2D Syd7I09is+mhUsQbjrdWihiynobTRQftUgCaWudiIL0BNc3pjArFcdR66g+0GnQQ5kR0 ddDH0YiQNW5r8Iz7L3fOnu2vQ4oymklb0C7RCA6Q/5UWC6MqXPR4CFjlUTK0PWD4hyj+ 8V01Svh9KpGWEWGT0bI9DlE7pAa7qu4aaHRncIVCNflJN+A91aQVCFwIgKpIHsoAtcsh L52+JL8KTd+bz0xc8raKesEKWL0mJwrmS8zBs5fh+xJyiCpNuvtbbQNZN4u2hP58b1NK 1jhA== X-Forwarded-Encrypted: i=1; AJvYcCXG6+1YV5FrAUTTBXYtkN/6hBpUKSIBIg5EkvQQm6njuLOPBvIEm6lSIKlgzNXgg3YUpdVhAWWlJKu2Eq1qu6w5zWNmswzfSt4pv+mx7flQAxstLCgxK3dC9C8/pu2uYHB/OtonAgXOvxM= X-Gm-Message-State: AOJu0YwNrd9UK0L0+vXBjNpeXpuZ8oHgyHSoO2sPTpwDCEWFRwcZD8bf jWGq31DVuSWzNKo1RK1mp7YxUmugZAmvc04HBJMPIBqYp6tGKl5O X-Received: by 2002:a17:90b:110e:b0:2bd:b091:bae1 with SMTP id 98e67ed59e1d1-2c27db18bb8mr6150891a91.25.1717689389379; Thu, 06 Jun 2024 08:56:29 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c28063a7fcsm3763521a91.7.2024.06.06.08.56.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Jun 2024 08:56:28 -0700 (PDT) Sender: Guenter Roeck Message-ID: <32a542a9-e338-4f8a-af24-a32c8426e619@roeck-us.net> Date: Thu, 6 Jun 2024 08:56:25 -0700 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] hwmon: lm70: simplify with spi_get_device_match_data() To: Krzysztof Kozlowski , Jean Delvare , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240606142515.132504-1-krzysztof.kozlowski@linaro.org> Content-Language: en-US From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/W8Vk BIsJMaWOhks//7d92Uf3EArDlDShwR2+D+AMon8NULuLBHiEUQARAQABzTJHdWVudGVyIFJv ZWNrIChMaW51eCBhY2NvdW50KSA8bGludXhAcm9lY2stdXMubmV0PsLBgQQTAQIAK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FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: <20240606142515.132504-1-krzysztof.kozlowski@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 6/6/24 07:25, Krzysztof Kozlowski wrote: > Use spi_get_device_match_data() helper to simplify a bit the driver. > Also kernel_ulong_t type is preferred for kernel code over uintptr_t > (needed for the cast). > > Signed-off-by: Krzysztof Kozlowski > --- > drivers/hwmon/lm70.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/drivers/hwmon/lm70.c b/drivers/hwmon/lm70.c > index 481e4e1f8f4f..0d5a250cb672 100644 > --- a/drivers/hwmon/lm70.c > +++ b/drivers/hwmon/lm70.c > @@ -169,11 +169,7 @@ static int lm70_probe(struct spi_device *spi) > struct lm70 *p_lm70; > int chip; > > - if (dev_fwnode(&spi->dev)) > - chip = (int)(uintptr_t)device_get_match_data(&spi->dev); > - else > - chip = spi_get_device_id(spi)->driver_data; > - > + chip = (kernel_ulong_t)spi_get_device_match_data(spi); > > /* signaling is SPI_MODE_0 */ > if ((spi->mode & SPI_MODE_X_MASK) != SPI_MODE_0) I'll apply this patch, but ... I take it that the earlier claims that driver_data must not be something like "(void *) LM70_CHIP_LM70", where LM70_CHIP_LM70 is 0, was wrong. I'll start reverting all patches which changed starting enum values from 0 to 1 based on that wrong claim. Guenter