From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) (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 00D2E33F5BE for ; Sun, 12 Jul 2026 20:25:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783887902; cv=none; b=S9tYl2upbvveTTlvR2Crv3gI61u9BlB8b5UfeRzYvFhu+aD6DNaBvOYXTpzo1nDUKZbWecECpUhR4ZUj5NvBcdaiNT3dtwHLFlST0/yQH5Y4XqMjJDdgLBsA7dDrEjcifhPFklOJYmO+zfPeYZOGY52uHbHM6SXr73yeDPzKXWs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783887902; c=relaxed/simple; bh=azXbfzTVmf5t/PthoB5eAnFnQztXSJqN2A7j8+7fovk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=XtSJRdBKb17+R3sujZzRESdXGkVu/TwNympX0mYDTmo9vmhXVfSqVEZkfZ+63bT8ectkY+cEC9YrHpc6FbceDddTEIMkHBCFiJeH32/hmm3N7DQRrrAuKbyHLAtiNzQp5eazOd2pp/4pw19nTWHAnh41xGw1VWV3Xuh2j296gDY= 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=Hsz2m+ql; arc=none smtp.client-ip=209.85.216.51 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="Hsz2m+ql" Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-383cb94f742so2086509a91.3 for ; Sun, 12 Jul 2026 13:25:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783887900; x=1784492700; 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:content-type; bh=XAJU2Ed0nDLZnCeUNFdR+RiOc3fXZSZtj+0nChoJKD4=; b=Hsz2m+qlM4zUYDkhf0Bu6wHXm5FUYp47ePmV0yB3fuksQJs/xOSym5zz6FSU8wk2pZ oOvz8aUtGNMwpUrVTAESyDrqieqj+qlDDF08uJblY9cpqZo8HHwgXCfiKfmbTTax1lvV m/d6Qy4J5L+ztaAvSbT8NkrKJ7rSFYQNKgdw8keYFUn/63reUkznzrnwjdevfqiM/YG4 JuhOSRF+aIYIreKCMPv1N543zk+wUESy4hlfD0hJZ8NW6vJuwqvp5uoevg8Fj/4Tad75 I43O5L2aKfl0RHoGZ8BJN7sk51F2jd94Q4/o6pYl/Djl4b1aVnxqxqqVIpWkklUw67Ot o4Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783887900; x=1784492700; 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:content-type; bh=XAJU2Ed0nDLZnCeUNFdR+RiOc3fXZSZtj+0nChoJKD4=; b=Z5rzgk++jpR0PE7XVy9/7FK8ZEYL3nUp2ATgMTE0RjYk2HVjB4s6yRPw7kGpuOT+7E ZtxkYRhat95QSRCHguUn2xTXl35x/ldY9eLPOKpSU5Bdq3lVzIbW7RXXwXP3ArHSrlHX 0I+G7A5BL5tfdYqSs5VKls6UFeVJbxXhN4Uxe5gkKoHsIgeJlpnIBcgl+bNc2EElZC9Q +RdZxD7wlppom+gy6AcRdJ4WEKyZSce1bOWDZupRPS7levwYy6oulcYwpFxUN58duyQw 5clnSFI637TuqSVPxzxH/1Lkal/IPfeD0bjMrvjdjygW1/+w0gXflxvPWjy6SQBzQ0nb +AXg== X-Forwarded-Encrypted: i=1; AHgh+RqDWEvtwBgyF5YIBpoPCDLS9JRSvFpGSqEmXDVcVL/0o5hM9Q7G/eKIRNpQGBzKiHewF+EmLY71PTJC7NU=@vger.kernel.org X-Gm-Message-State: AOJu0YykDYYYdhg2OBG+HhXCbRJIZ/fbrRxI4ZXz9i/pwgfDJo3cJK2Q Slh0t/wwphDViDVM7CVifzEZAbRRA8y8aJKkjjxXc9R57OzuU44Vel0= X-Gm-Gg: AfdE7clTT4F2R68/mWacTu51gP/YttqSpJewOYpAifAcQnNGp7zrmmCMltFd8xMQkQb /27+G8Tt/7rx7pSMvE9ou1jqHjgz7ebt2mScDDEqAbRwSznjggF8Zvx8qFBwkYpl9c+OQzGYJP6 iiMPHPuzWgIYfLzwIRzNkx6RYIsd36JPNQM65/EAtb2lIL8AoxdFwCWfaXPZ5xy+y8U4JNfGV1c oj24evOaZxrrBklVVR6eKArjc6SRjCmJAcF/oLzlwNBKYcTzcPbhSRTQT8mD2hbidkSBs91jEti fqi0RwYoWn+QR9285zisX6WWrPviNYwQW3IzbvjL3NQNrnrREiOPXvp2awRUIklpurSjUjHT07e My7ZOYcDTI3PGQ+lBoXckBN2DTQr6DYHRPgG/eeLbIQ2IA+sj0l9MLRIsSN3JjIf3HFFFAmxnTT um6zCfUKxW7ayL21vgMcAeYHkDqt2mA+Cz1ZNqBQVQilr2M39oe+h3 X-Received: by 2002:a05:6a20:c98b:b0:39b:d937:8020 with SMTP id adf61e73a8af0-3c110ad2d68mr7085610637.42.1783887900305; Sun, 12 Jul 2026 13:25:00 -0700 (PDT) Received: from localhost.localdomain ([101.0.63.154]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-311747f5975sm58833648eec.4.2026.07.12.13.24.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jul 2026 13:24:59 -0700 (PDT) From: Nikhil Gautam To: Jonathan Cameron Cc: David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Stefan Windfeldt-Prytz , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Nikhil Gautam Subject: [PATCH 0/4] iio: light: opt4001: Fixes from code review Date: Mon, 13 Jul 2026 01:54:47 +0530 Message-Id: <20260712202451.20822-1-nikhilgtr@gmail.com> X-Mailer: git-send-email 2.39.5 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi, This series fixes a number of issues found while reviewing the opt4001 driver. All of them date back to the initial submission of the driver in commit 9a9608418292 ("iio: light: Add support for TI OPT4001 light sensor"). I have not added Fixes: tags; happy to resend with them if preferred. Patch 1 fixes a read-modify-write in opt4001_power_down() that reads the device ID register instead of the control register, corrupting the CTRL configuration on the way to power down. Patch 2 fixes an incompatible pointer type passed as the remainder argument to div_u64_rem(), which takes a u32 * rather than an int *. Patch 3 makes opt4001_write_raw() reject integration time writes with a non-zero integer (seconds) part, which were previously accepted silently based on the microseconds part alone. Patch 4 fixes reversed GENMASK() arguments in the (currently unused) fault count mask definition and adds the _MASK suffix for consistency with the neighbouring defines. Datasheet: https://www.ti.com/lit/ds/symlink/opt4001.pdf Thanks, Nikhil Gautam Nikhil Gautam (4): iio: light: opt4001: Fix read-modify-write of wrong register in power down iio: light: opt4001: Fix incompatible pointer type passed to div_u64_rem() iio: light: opt4001: Reject integration times with a non-zero seconds part iio: light: opt4001: Fix reversed GENMASK() arguments in fault count mask drivers/iio/light/opt4001.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) -- 2.39.5