From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.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 2A45F3BE17F for ; Thu, 7 May 2026 09:22:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778145728; cv=none; b=aaIPvNwOq6mPnsNIYaBzGZhOM7UYhAbCcJnc9ENVH44qizDx09PFK+SsznY70k3PJ+2f+z07W1WcyB5olapuSn/Zcp94ZRzZmp+wago4lMnGHwczPRenSRzRiVueOMjAeUuQsOfh4fphp+jXgeJO+wpHeHYAJ6fZ3pRBGLpFOi4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778145728; c=relaxed/simple; bh=l95NplvxAjRLCRg7ObjYoTtUO9SuMMlSFZQmdhBcyAQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=BZ3JZXsvCPjiS31f4EBuNeZupFFDQm0kGTNP0dpKfaKi6lmeUYoJlPRqBK8tW5+kpSD1rYJxg0JRQlfkkBUkR3jjMUkyYZhE/kSQN4KqeMbjWsRCGoakzKgCcOUBY38L19JsgEKPEnoqUmNN0jv9uJBpoNEVBCVxdX/64+6O9zU= 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=PgO7t9Di; arc=none smtp.client-ip=209.85.221.41 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="PgO7t9Di" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-43fe3e22e33so374281f8f.0 for ; Thu, 07 May 2026 02:22:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778145721; x=1778750521; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=6PYVMMAUvdqPUsNxyIec24Q2Cm7bDFnW2WKRqfA0TRY=; b=PgO7t9DisebRVg1iFmS/a7PjtJr7VVI6yt0MzH8UZ3DGwZ7TKfFujfVn5ZHEYNW90y JVL17H2K4mgOaT5oqUJtuEiVOBYlmofu76swsmZ+K5dGaMhiwwWUhZX1PYMPvhdWWCS+ wc1XGUzfFEL3gmXGNE8JrzfVPlvYWaBqdzMr4d8d7LUO3O8Z9Bqs0glQMQkD1yAqofWZ OJAHtG+8X3FvN/PmzUWtgcSyMdcKLN8dISmIpnc7Po2W0R3feNQ8q5rqTF6u6JvMd63e RpZ/kiSDpeahRcKy8IhpDVhVYNCRZJpDoxdfskh4wGLHU/Cd8qLiN4xyE1pEKgJ0wyQP Ytog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778145721; x=1778750521; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=6PYVMMAUvdqPUsNxyIec24Q2Cm7bDFnW2WKRqfA0TRY=; b=TzvQqCRkfb6IZ3qWlB/J3VB0Md+SFVh2qyTC1saoyM/Fu9kFulb8PgoTABZflh3HCl 4YkLFy2R+oe6sD3XgMfN9osO9luCkaSVkTlMyXf1ARbvwptfXTOaYO4q9OqgaagIPh8+ 2uKbPR3RJbtT3amxCVTrpgYbe3kYGEQRNihC8X1Epz5gK1nD/BH2utZOPNt9VDEsEilC +04FXx7wv0JZJA7Mo4LcG+qOqU+ROphJNWtjJzCwJf69zbhuqMuFXAK7rpxxuTTmvtZH HNp5vHNSZcNm0vQeE/w/khF37ljddbI/l9rhPZb6LwQpMyxs1U+gUN7I0Fh2ezLMHYzD Z1sA== X-Forwarded-Encrypted: i=1; AFNElJ/iQ6BeJPCApPLdJ1/un8CXmxcPvbsyZeFPgGEZAq3j4WDXHOZ0pA1pulqtMUWzr+Zo8n9ZakpVlnmKjs8=@vger.kernel.org X-Gm-Message-State: AOJu0Yw9h0l/jAEfhvwqqJIvQIxPw9HPxWkGCNRbGYdjdSfGv9rpQ1X8 mOpkIOj1l33hf/KtFxYh8Y75aN/Ef1hRw8F/1jdE+dzT+Xok5tqEl8mP X-Gm-Gg: AeBDievb+wPYTbBzCGHXYViJIaPEVC2TYCxSfwpqJeMPNPs5QQHgVk+6UCEQukkmAMN zkQYFr+mWp/n/sbUtJm1qHcaggXNF+6ONTq9THTlCpXGpG139piIPoD3Caedzw6vsahDg52sj4h yi/FubI+cEUspB4hnnWeTtXNrUWj8uon2urzKc9ZdIkGrI6JbnhCckwH81OK96/3+Wbuj/283DE F/2x/lh1Yi6sptqMA7IDUSgxkWIMnuX1FWIofJINs3SCoDv/rzyZyPqJZrEqCnuOW5u3Km9KvA6 jrEE2WWOFneeT/v5+k1dO1zcLW77mS2B/00cUSNShcBrOS/JA+AVwpEUmLZV7pB8b9Y93JqWXL7 01iJZQZol15+ioVoGYq813LM/PwfHl8UfoIXs6JZv+hHy98DhGCjex8dCZp2jyqdLoDC516i8aT EZDr+RA7GUh6u/cHaIfObVYNyIGRZ+9ig5u2w5VK0iBtjS5AqXbPa6v0TFq8YF X-Received: by 2002:a5d:5d10:0:b0:43d:7403:4b65 with SMTP id ffacd0b85a97d-4515a6c29ebmr11520027f8f.6.1778145720232; Thu, 07 May 2026 02:22:00 -0700 (PDT) Received: from localhost.localdomain ([196.235.181.147]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4505238e174sm19380331f8f.1.2026.05.07.02.21.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2026 02:21:59 -0700 (PDT) From: Salah Triki To: Jonathan Cameron , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Salah Triki Subject: [PATCH v6] iio: humidity: ens210: Simplify I2C functionality check Date: Thu, 7 May 2026 10:21:33 +0100 Message-ID: <20260507092133.8810-1-salah.triki@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Simplify the I2C functionality check by checking for I2C_FUNC_SMBUS_EMUL, which encompasses the SMBus operations required by the driver. Signed-off-by: Salah Triki --- Changes since v5: - Changed patch title from "Fix missing I2C functionality checks" to "Simplify I2C functionality check" to reflect the new approach. - Dropped the Fixes tag as the change is now considered hardening rather than a bug fix. - Replaced individual functionality checks with a single check for I2C_FUNC_SMBUS_EMUL as suggested by Jonathan Cameron. Changes since v4: - Fixed the alignment and indentation of the I2C functionality check per Andy's review. Changes since v3: - Fixed the alignment and indentation of the I2C functionality check per Andy's review. Changes since v2: - Fixed the alignment and indentation of the I2C functionality check per Maxime's review. Changes since v1: - Updated the I2C functionality test to check for both required native operations and SMBus emulation (`I2C_FUNC_SMBUS_EMUL`) drivers/iio/humidity/ens210.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/iio/humidity/ens210.c b/drivers/iio/humidity/ens210.c index 77418d97f30d..91c2f69fb6bf 100644 --- a/drivers/iio/humidity/ens210.c +++ b/drivers/iio/humidity/ens210.c @@ -201,10 +201,7 @@ static int ens210_probe(struct i2c_client *client) uint16_t part_id; int ret; - if (!i2c_check_functionality(client->adapter, - I2C_FUNC_SMBUS_WRITE_BYTE_DATA | - I2C_FUNC_SMBUS_WRITE_BYTE | - I2C_FUNC_SMBUS_READ_I2C_BLOCK)) { + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_EMUL)) { return dev_err_probe(&client->dev, -EOPNOTSUPP, "adapter does not support some i2c transactions\n"); } -- 2.43.0