Skip to content

Commit b63ad39

Browse files
Benjamin CabéChromeos LUCI
authored andcommitted
drivers: sensor: tsl2540: fix channel validation logic in attr_set
Use && instead of & in channel validation logic to ensure channel is either CHAN_IR or CHAN_LIGHT. (cherry picked from commit 9b1e05b) Original-Signed-off-by: Benjamin Cabé <[email protected]> GitOrigin-RevId: 9b1e05b Cr-Build-Id: 8711840798614211969 Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8711840798614211969 Copybot-Job-Name: zephyr-main-copybot-downstream Change-Id: I4859aedecedd4ce833db6bb93557b8ae64693a89 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/6650444 Reviewed-by: Yuval Peress <[email protected]> Commit-Queue: Yuval Peress <[email protected]> Tested-by: ChromeOS Copybot <[email protected]> Tested-by: Yuval Peress <[email protected]>
1 parent f024a1c commit b63ad39

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/sensor/ams/tsl2540/tsl2540.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static int tsl2540_attr_set(const struct device *dev, enum sensor_channel chan,
156156
uint8_t temp;
157157
double it;
158158

159-
if ((chan != SENSOR_CHAN_IR) & (chan != SENSOR_CHAN_LIGHT)) {
159+
if ((chan != SENSOR_CHAN_IR) && (chan != SENSOR_CHAN_LIGHT)) {
160160
return -ENOTSUP;
161161
}
162162

0 commit comments

Comments
 (0)