From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f53.google.com (mail-oo1-f53.google.com [209.85.161.53]) (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 71F652EBB84 for ; Sun, 2 Aug 2026 16:07:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785686852; cv=none; b=cUEq4+K2hVbB8SUowZOpFUYpdrnch683JZ9kW76Uslr/Q2nTATimyeUiPdRMIsRrAF0aeP1BA/VWr3qOBxjaHb5LhwmwNRm/RkH71w1VhG4ploXzN7aIwm0teQQjkELpUQwvoW1CibBHxT+MgF2Z2jmttw4k+qXd+Z6Q2/AqrQc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785686852; c=relaxed/simple; bh=UBPdsCxr/JCnW5FBHSIVkwAzSjCcMNbdBUUw+0OCw/w=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=N8fk2tjnljH5wcZwNmTSI69Fbi6FxtM7Mh7csGSA4Jcza/QSLW0L3f6rO9AeGtT+eaaF/G6AxUAZrCuVstO0Mi6lYMbPd9nIQw17M1Ylv8i9W0FjAQb+fo0x4NDQAmJ2MSwXIWEiZWqbGhETyCtDi+my8mCAYsEK3M+xaEB0Gow= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=Ybo5+GmB; arc=none smtp.client-ip=209.85.161.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="Ybo5+GmB" Received: by mail-oo1-f53.google.com with SMTP id 006d021491bc7-6ae4aff94c2so696741eaf.3 for ; Sun, 02 Aug 2026 09:07:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1785686849; x=1786291649; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=wcLf3H2Vtv+WaWlh5trUkd6eQsIi/+7/uByN3DGgnMg=; b=Ybo5+GmBNggzFJ0pX2a01TvXwoqio7HzARUy/nduLzWPNjzab6tPusSctdaCuORwcO QLjya3SJMrz3F5pvHUpA0Db3CjGpW1vQneqOn3njJmS0qvSGVRgeyg6jeNsYyzmsxMHs TdQhvcx5AwvBurxoe9FawxOczX2COXsZvGFjmBr9gHoY/lLB49tecWno+K1DcKUtUUU3 +YjhC6Fuwv7PA6E+148Y28LqDgzvZWIf81KsyUiQniYUCZIQWMJ62l4iV6hH49NnBQJ7 7aLlTnHobg5PmTAI4xPZSEgRnr+OWDwnUnqfpiCkzg2aNfuMkCRAHpeotI+GyTcprvLN qThA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785686849; x=1786291649; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=wcLf3H2Vtv+WaWlh5trUkd6eQsIi/+7/uByN3DGgnMg=; b=I5LTjRcYvVZkig+57lEJgWvRj6eusIejCqmCARyDZ3A5nQDbv6WqrGXVCxdMltw17K C0+ei6W2NeJVAKF3gmsjQc9tjxNjbfJqGCYl32byXa4UNmXgRFKOhF0Gu1J3XG+0MdLV VjKw/iFNUfTZ2czzS82uDY/ldHilR+eEFoi/DmnHypfNOOzd196iCcMY1lGrVyapNk4/ fHpa7ceCxgtGt3xnz2ry42MByyvp9kegpFfCchKWDjQrWsXbmtRVEmZxGxxhUIB38s5w XXgJP1u+vEhI7rWurgwY5mImtjsGAewQPasVbygKBASb3ABF+EsUMZ7UIyhuOXbtn3Mk iGww== X-Forwarded-Encrypted: i=1; AHgh+Rq7rsjPUE1S7875R9EouXbWbYq628cNlyPl8kBg6DGwEaj4AfbZfvGXF5/XW++kK2LK3Gfc4D7u+BkHgYU=@vger.kernel.org X-Gm-Message-State: AOJu0Yzl8JVtIL6cNgsoEjC38WlRXcsK4WAVO5dpmrEzZZM4hzID8e3m xdYzglXgC8RK2DQJkuosaUQqi5yfQZg0VdBTZvffU8EOoGB48hiGP/pqM3MJgqlJWaM= X-Gm-Gg: AR+sD1221d9y01C2P4Pkrpt9WVP0IwjA8wjyNcL/QmKdYjkT3kX2i0Ym0IjNd6ZuH9s 8hA2awc7KnzvSAS2XxYY0yaUdDtWhIlFcVxSbcz2bFqj/1c0Nin6ZknR7YxqJ5dXEtu8rMJf6WX KGRWeRtQJJaeARpqAG5tDN+cDJLZkp58zaaggdYO2rR2jyaeFPbNuUA9ziV3Pc+TB2zjUF7ZQtH aw4AgMPEcmOcpJuYeZGqLfROX80qo8p4u72WkI8Ldx5uWBXfVUR1/VsiHLeEp7Snb0ISCPq1Ris YzFasTryQjeqfLRwvDcPvOvJSO8E3YXM0jk+SlVg8ZpRiwtgkqX+galuw6n5P1bgB1VDyl00NeR bjwHrsNFUqQDkPK0dIfsrCEzi6megmm+9tYgAI0QOwRIZN5pPTGShOCqLEa//1aeGVA7EKKnRIA yIoWWFiw8fzFEADs737D2ayG/ACSgjAFqEQ1aEfAaOTO2/CPhG0KZArj/SxUIQYuCMdTr9P4m93 f2fQHvCSCQ6+FEIkCYkWuMkjmAhHJFWOtejmsY= X-Received: by 2002:a05:6820:83c2:10b0:6aa:ddf8:f17f with SMTP id 006d021491bc7-6ae43514968mr8221908eaf.23.1785686849225; Sun, 02 Aug 2026 09:07:29 -0700 (PDT) Received: from ?IPV6:2600:8803:e7e4:500:5487:2b6e:1057:d3d3? ([2600:8803:e7e4:500:5487:2b6e:1057:d3d3]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6ae3a0c724fsm4851976eaf.9.2026.08.02.09.07.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 02 Aug 2026 09:07:28 -0700 (PDT) Message-ID: <1555adce-4cce-45c5-b3bc-1898d1bab46b@baylibre.com> Date: Sun, 2 Aug 2026 11:07:27 -0500 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 v6 4/4] iio: flow: add Sensirion SLF3S liquid flow sensor driver To: Wadim Mueller , jonathan.cameron@oss.qualcomm.com, krzk+dt@kernel.org, robh@kernel.org, conor+dt@kernel.org, nuno.sa@analog.com, andy@kernel.org, maxwell@maxwelld.cc Cc: linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, marcelo.schmitt1@gmail.com, 455.rodrigo.alencar@gmail.com References: <20260728214943.29820-1-wafgo01@gmail.com> <20260728214943.29820-5-wafgo01@gmail.com> Content-Language: en-US From: David Lechner In-Reply-To: <20260728214943.29820-5-wafgo01@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 7/28/26 4:49 PM, Wadim Mueller wrote: > Add a driver for the Sensirion SLF3S family of digital > liquid-flow sensors on I2C. Currently supported variants are > SLF3S-0600F, SLF3S-1300F and SLF3S-4000B; they share the same > register map and differ only in flow-scale factor and calibrated > measurement range. The variant (and therefore the scale) is > auto-detected from the product-information register at probe time; > a sensor reporting an unknown sub-type falls back to the variant > named in the device tree / I2C table, so a drop-in replacement part > keeps working on a kernel that does not know its sub-type yet. > ... > +static bool slf3s_crc_valid(const struct slf3s_data *sf, const u8 *block) > +{ > + return crc8(sf->crc_table, block, 2, SLF3S_CRC8_INIT) == block[2]; > +} > + > +/* > + * Read the product-info block and pick the matching variant. The > + * sub-type byte returned by the sensor is the source of truth; a > + * DT-supplied compatible only seeds an initial guess and is overridden > + * on mismatch (with an informational message so misconfigured device > + * trees are easy to spot). In the past, Jonathan has always argued that the devicetree should be trusted more than what the device self-reports. This seems a departure from that. Why are we making an exception here? We have to trust that the devicetree is correct for everything else that can't self-detect anyway.