Skip to content

Commit 89afccf

Browse files
mihailescu2mmdrjr
authored andcommitted
[PATCH 2/2] w1: skip CRC and only output the temperature
1 parent 6ffdec4 commit 89afccf

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

drivers/w1/slaves/w1_therm.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,19 +244,12 @@ static ssize_t w1_therm_read(struct device *device,
244244
break;
245245
}
246246

247-
for (i = 0; i < 9; ++i)
248-
c -= snprintf(buf + PAGE_SIZE - c, c, "%02x ", rom[i]);
249-
c -= snprintf(buf + PAGE_SIZE - c, c, ": crc=%02x %s\n",
250-
crc, (verdict) ? "YES" : "NO");
251247
if (verdict)
252248
memcpy(sl->rom, rom, sizeof(sl->rom));
253249
else
254250
dev_warn(device, "18S20 doesn't respond to CONVERT_TEMP.\n");
255251

256-
for (i = 0; i < 9; ++i)
257-
c -= snprintf(buf + PAGE_SIZE - c, c, "%02x ", sl->rom[i]);
258-
259-
c -= snprintf(buf + PAGE_SIZE - c, c, "t=%d\n",
252+
c -= snprintf(buf + PAGE_SIZE - c, c, "%d\n",
260253
w1_convert_temp(rom, sl->family->fid));
261254
mutex_unlock(&dev->mutex);
262255

0 commit comments

Comments
 (0)