aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1/w1_therm.c
diff options
context:
space:
mode:
authorEvgeniy Polyakov <johnpol@2ka.mipt.ru>2005-05-20 14:33:25 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-22 00:43:09 -0400
commit7785925dd8e0d2f389d4a9168f1683c6b249a552 (patch)
tree5772979184dc9e2b811503fab6ed1119f5c9f93a /drivers/w1/w1_therm.c
parent85e941cc9f10316080a16b121d24d329e5c2a65d (diff)
[PATCH] w1: cleanups.
- white space changes. - list_for_each_entry/list_for_each_entry_safe and reverse changes. - small coding style changes. - removed redundant NULL checks. - use attribute group and macros instead of direct device attributes. Patch is havily based on work from Adrian Bunk and Dmitry Torokhov, thanks guys. Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/w1/w1_therm.c')
-rw-r--r--drivers/w1/w1_therm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/w1/w1_therm.c b/drivers/w1/w1_therm.c
index 84e8043a4499..e52abca05070 100644
--- a/drivers/w1/w1_therm.c
+++ b/drivers/w1/w1_therm.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * w1_therm.c 2 * w1_therm.c
3 * 3 *
4 * Copyright (c) 2004 Evgeniy Polyakov <johnpol@2ka.mipt.ru> 4 * Copyright (c) 2004 Evgeniy Polyakov <johnpol@2ka.mipt.ru>
5 * 5 *
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
8 * it under the therms of the GNU General Public License as published by 8 * it under the therms of the GNU General Public License as published by
@@ -38,7 +38,7 @@ MODULE_AUTHOR("Evgeniy Polyakov <johnpol@2ka.mipt.ru>");
38MODULE_DESCRIPTION("Driver for 1-wire Dallas network protocol, temperature family."); 38MODULE_DESCRIPTION("Driver for 1-wire Dallas network protocol, temperature family.");
39 39
40static u8 bad_roms[][9] = { 40static u8 bad_roms[][9] = {
41 {0xaa, 0x00, 0x4b, 0x46, 0xff, 0xff, 0x0c, 0x10, 0x87}, 41 {0xaa, 0x00, 0x4b, 0x46, 0xff, 0xff, 0x0c, 0x10, 0x87},
42 {} 42 {}
43 }; 43 };
44 44
@@ -163,7 +163,7 @@ static int w1_therm_check_rom(u8 rom[9])
163static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, size_t count) 163static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, size_t count)
164{ 164{
165 struct w1_slave *sl = container_of(container_of(kobj, struct device, kobj), 165 struct w1_slave *sl = container_of(container_of(kobj, struct device, kobj),
166 struct w1_slave, dev); 166 struct w1_slave, dev);
167 struct w1_master *dev = sl->master; 167 struct w1_master *dev = sl->master;
168 u8 rom[9], crc, verdict; 168 u8 rom[9], crc, verdict;
169 int i, max_trying = 10; 169 int i, max_trying = 10;
@@ -198,7 +198,7 @@ static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, si
198 unsigned int tm = 750; 198 unsigned int tm = 750;
199 199
200 memcpy(&match[1], (u64 *) & sl->reg_num, 8); 200 memcpy(&match[1], (u64 *) & sl->reg_num, 8);
201 201
202 w1_write_block(dev, match, 9); 202 w1_write_block(dev, match, 9);
203 203
204 w1_write_8(dev, W1_CONVERT_TEMP); 204 w1_write_8(dev, W1_CONVERT_TEMP);
@@ -211,7 +211,7 @@ static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, si
211 211
212 if (!w1_reset_bus (dev)) { 212 if (!w1_reset_bus (dev)) {
213 w1_write_block(dev, match, 9); 213 w1_write_block(dev, match, 9);
214 214
215 w1_write_8(dev, W1_READ_SCRATCHPAD); 215 w1_write_8(dev, W1_READ_SCRATCHPAD);
216 if ((count = w1_read_block(dev, rom, 9)) != 9) { 216 if ((count = w1_read_block(dev, rom, 9)) != 9) {
217 dev_warn(&dev->dev, "w1_read_block() returned %d instead of 9.\n", count); 217 dev_warn(&dev->dev, "w1_read_block() returned %d instead of 9.\n", count);