From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f182.google.com (mail-yw1-f182.google.com [209.85.128.182]) (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 DDF58492182 for ; Tue, 5 May 2026 17:33:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778002421; cv=none; b=TnO/4N6s67sckbP34/1BI1Ok1pX4K/EEV5xL88npfiUJNdIY5hkRy3H7xcg+cXTNWWCzB1H3RkRJB6u8a1evuXvpNdc3Ze4PYUf83IldPkKac5OByzj7tZWWmz3sPc+gy/tCW00Ji9L7hgHORHZVdJ9JrKQ3nYpSQKxN6iNcCno= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778002421; c=relaxed/simple; bh=uoR2gEbxq22hMAQZCudxu9N6ovIXDpq4hy3MyYXNJbk=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=CcEREYf55+OWONbQYMWHFOsjW1FxYReae54l8qag+mbFtQul3stwIFTOAr91EPHDPsu2VGwium/agDZZdt85NxUoRzb8YikV9xWTig0gCoIg42sLt7FyXCaykM6cdytQN6/wwcR55qE4Ce0290+GAqw/af+9yAWOq3gBk3y1cQo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ItT00jjT; arc=none smtp.client-ip=209.85.128.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ItT00jjT" Received: by mail-yw1-f182.google.com with SMTP id 00721157ae682-7bd4c61765dso60809847b3.3 for ; Tue, 05 May 2026 10:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778002418; x=1778607218; darn=vger.kernel.org; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=rnRe7KjU8veD5ZITTDKx3xTk0GWaGR/EUMVANxzWmCg=; b=ItT00jjTqrnjZjm1tvXJD0SR5CA7ryf4Tyw7Lm9JathECfj49+KEsCYup+0VvXiZ+a j3awoNSmHlcKe65fW82z0aWlcZXIVkOs0HhYtfE810rOIEPqzCCbm7NvxlbC2uZY8/2Y kiibfPUxHmfEvdseV4wXD0pgV0mPXC4OhmK3XA4iMc4/UTcTXs44T3MaOS6nHrWLT89u 0kZnffb4ymUlhQVv+Qhg7xnVWj0RNEesSyIUB9Fv4ut3gRz+oOVwnR+AZ+zu8f/IWSrz Lqz1rtA4/xeAgl9gs5js90s9H/ICN6A0PClehM1xGF9yokV3PRSv2fErZhRlOekeH45P 5grA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778002418; x=1778607218; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=rnRe7KjU8veD5ZITTDKx3xTk0GWaGR/EUMVANxzWmCg=; b=g/GnB8NQm734qLDGmi1fpkgyVy4eDSCHPkqaAEKuj+levSi+wn9eOpPFedTFnXjVwh 9nZwVJc8fAAsEL1nsu+Aqww1oVWSOFNEpSglOAUA0Jig+G/Vn2Md2oHX9tJtyGUgP+Fc Fu/byq6KTpVf+apLQ+Q3dbrvTXyN/nHiSXryqrQeyN34VaFUIJbZmqevmB4EpPMQqrid B5qMoZCDQ51pUSZ8l1mmrpMPN+/7vXghff+cEH2m1XBS8YQ4Gr44xuZ0HJz+4iPseFPo bMchfln6h5YJ8z4xQVe8/AGIbI8aWKgjjPfgDrR8XrhD3YxnOzuOun3JN3uuRKGemP1+ MYsA== X-Forwarded-Encrypted: i=1; AFNElJ8NiLaqe7/Ovgj3HJ/90AJo5nd0X5XhYAZKeBKokPJaspFbICcHmPXeZjWfQX7Uw3DPxO0s3685rHukYMc=@vger.kernel.org X-Gm-Message-State: AOJu0YyuNaNF5Dhdzuvi/BX7xuN4FMcYWzD9lT6H+iFZFnRI4pH+JIK5 DslWEDlbE7enAZuhlloPAHv53v0whn4/BqdTkm8f8LPfXQ0KrYIXsfqE X-Gm-Gg: AeBDiev5V3NU3je4ozpSUcm6Dc/mQ0CqdCLLaHKBtT9lGO6QbIjcCMQK62GJHW7NL6R w1Lgm/KygZb1u30xNJrdis7Jx2IZo3rx5HGOvrsHpDaJAC69RNnfRIwd9X3d8zcq/oTvMoJuhIF CMaV7q2alIdJPLcn6w/JbrwHzTBhnUUGhxfB1b/UR9KX/h3Dx//2TR3kZxH0fYizy8cdTOvXQ2E oSVNYKkZd+OUu9HclTn62baKFD781pFC4/VreWq60VYDora3vrApP0EUO3eRlB8FjmTEiDc7970 7XVR0990h3DLn5QNiem3KM3N6LF2YyUXHWBdU5sYr+Uh+qx5OPGoF4mwSeZ6UuoTxhCB0zAbIlV ZEDqRCkXakGg0VOKTqc4F4euBa9+dIkEl6Wo2onQIlPPVIdI9rvDXeyP6ObJdU9tBOwG3spHvlI NpAiyd8S1bz/EYsM69iL4X9q2uITi27c7Z5LS6YQArWFchJ/9d X-Received: by 2002:a05:690c:dd4:b0:7b8:f152:7545 with SMTP id 00721157ae682-7bdf5d8014fmr1543767b3.9.1778002417748; Tue, 05 May 2026 10:33:37 -0700 (PDT) Received: from localhost ([208.185.137.148]) by smtp.gmail.com with ESMTPSA id 00721157ae682-7bd6685d0cbsm66174187b3.35.2026.05.05.10.33.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 May 2026 10:33:37 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Tue, 05 May 2026 12:33:36 -0500 Message-Id: Cc: , Subject: Re: [PATCH v2] iio: humidity: ens210: Fix missing I2C functionality checks From: "Maxwell Doose" To: "Salah Triki" , "Jonathan Cameron" , "David Lechner" , =?utf-8?q?Nuno_S=C3=A1?= , "Andy Shevchenko" X-Mailer: aerc 0.21.0 References: <20260505172246.90892-1-salah.triki@gmail.com> In-Reply-To: <20260505172246.90892-1-salah.triki@gmail.com> On Tue May 5, 2026 at 12:22 PM CDT, Salah Triki wrote: > The ENS210 driver uses SMBus transactions (such as byte, word, and block > data reads/writes) during the probe and measurement phases. However, the > initial functionality check only validated a subset of these capabilities= , > which could lead to loading failures on adapters requiring SMBus > emulation or native-only controllers. > > To ensure compatibility across a wide range of I2C adapters, modify the > functionality check to verify if the adapter supports the required native > operations or, failing that, supports the SMBus emulation layer. > > Fixes: c524fbca672e ("iio: humidity: Add support for ENS210") > Signed-off-by: Salah Triki > --- > drivers/iio/humidity/ens210.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > [snip] > if (!i2c_check_functionality(client->adapter, > - I2C_FUNC_SMBUS_WRITE_BYTE_DATA | > - I2C_FUNC_SMBUS_WRITE_BYTE | > - I2C_FUNC_SMBUS_READ_I2C_BLOCK)) { > + I2C_FUNC_SMBUS_WRITE_BYTE_DATA | > + I2C_FUNC_SMBUS_WRITE_BYTE | > + I2C_FUNC_SMBUS_READ_BYTE_DATA | > + I2C_FUNC_SMBUS_READ_WORD_DATA | > + I2C_FUNC_SMBUS_READ_I2C_BLOCK) && > + !i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_EMUL)) { > return dev_err_probe(&client->dev, -EOPNOTSUPP, > "adapter does not support some i2c transactions\n"); > } This alignment doesn't look right. Probably should be something like: if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WRITE_BYTE_DATA | I2C_FUNC_SMBUS_WRITE_BYTE | I2C_FUNC_SMBUS_READ_BYTE_DATA | I2C_FUNC_SMBUS_READ_WORD_DATA | I2C_FUNC_SMBUS_READ_I2C_BLOCK) && !i2c_check_functionality(client->adapter,=20 I2C_FUNC_SMBUS_EMUL)) { best regards, max