diff options
author | Evgeniy Polyakov <johnpol@2ka.mipt.ru> | 2005-05-20 14:33:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-22 00:43:09 -0400 |
commit | 7785925dd8e0d2f389d4a9168f1683c6b249a552 (patch) | |
tree | 5772979184dc9e2b811503fab6ed1119f5c9f93a /drivers/w1/w1.h | |
parent | 85e941cc9f10316080a16b121d24d329e5c2a65d (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.h')
-rw-r--r-- | drivers/w1/w1.h | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/drivers/w1/w1.h b/drivers/w1/w1.h index abbddaf3f8e2..90a2e737d2ca 100644 --- a/drivers/w1/w1.h +++ b/drivers/w1/w1.h | |||
@@ -1,8 +1,8 @@ | |||
1 | /* | 1 | /* |
2 | * w1.h | 2 | * w1.h |
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 terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
@@ -25,9 +25,9 @@ | |||
25 | struct w1_reg_num | 25 | struct w1_reg_num |
26 | { | 26 | { |
27 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 27 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
28 | __u64 family:8, | 28 | __u64 family:8, |
29 | id:48, | 29 | id:48, |
30 | crc:8; | 30 | crc:8; |
31 | #elif defined(__BIG_ENDIAN_BITFIELD) | 31 | #elif defined(__BIG_ENDIAN_BITFIELD) |
32 | __u64 crc:8, | 32 | __u64 crc:8, |
33 | id:48, | 33 | id:48, |
@@ -74,11 +74,11 @@ struct w1_slave | |||
74 | int ttl; | 74 | int ttl; |
75 | 75 | ||
76 | struct w1_master *master; | 76 | struct w1_master *master; |
77 | struct w1_family *family; | 77 | struct w1_family *family; |
78 | struct device dev; | 78 | struct device dev; |
79 | struct completion dev_released; | 79 | struct completion dev_released; |
80 | 80 | ||
81 | struct bin_attribute attr_bin; | 81 | struct bin_attribute attr_bin; |
82 | struct device_attribute attr_name, attr_val; | 82 | struct device_attribute attr_name, attr_val; |
83 | }; | 83 | }; |
84 | 84 | ||
@@ -90,16 +90,16 @@ struct w1_bus_master | |||
90 | 90 | ||
91 | u8 (*read_bit)(unsigned long); | 91 | u8 (*read_bit)(unsigned long); |
92 | void (*write_bit)(unsigned long, u8); | 92 | void (*write_bit)(unsigned long, u8); |
93 | 93 | ||
94 | u8 (*read_byte)(unsigned long); | 94 | u8 (*read_byte)(unsigned long); |
95 | void (*write_byte)(unsigned long, u8); | 95 | void (*write_byte)(unsigned long, u8); |
96 | 96 | ||
97 | u8 (*read_block)(unsigned long, u8 *, int); | 97 | u8 (*read_block)(unsigned long, u8 *, int); |
98 | void (*write_block)(unsigned long, u8 *, int); | 98 | void (*write_block)(unsigned long, u8 *, int); |
99 | 99 | ||
100 | u8 (*touch_bit)(unsigned long, u8); | 100 | u8 (*touch_bit)(unsigned long, u8); |
101 | 101 | ||
102 | u8 (*reset_bus)(unsigned long); | 102 | u8 (*reset_bus)(unsigned long); |
103 | 103 | ||
104 | void (*search)(unsigned long, w1_slave_found_callback); | 104 | void (*search)(unsigned long, w1_slave_found_callback); |
105 | }; | 105 | }; |
@@ -123,21 +123,20 @@ struct w1_master | |||
123 | 123 | ||
124 | int need_exit; | 124 | int need_exit; |
125 | pid_t kpid; | 125 | pid_t kpid; |
126 | struct semaphore mutex; | 126 | struct semaphore mutex; |
127 | 127 | ||
128 | struct device_driver *driver; | 128 | struct device_driver *driver; |
129 | struct device dev; | 129 | struct device dev; |
130 | struct completion dev_released; | 130 | struct completion dev_released; |
131 | struct completion dev_exited; | 131 | struct completion dev_exited; |
132 | 132 | ||
133 | struct w1_bus_master *bus_master; | 133 | struct w1_bus_master *bus_master; |
134 | 134 | ||
135 | u32 seq, groups; | 135 | u32 seq, groups; |
136 | struct sock *nls; | 136 | struct sock *nls; |
137 | }; | 137 | }; |
138 | 138 | ||
139 | int w1_create_master_attributes(struct w1_master *); | 139 | int w1_create_master_attributes(struct w1_master *); |
140 | void w1_destroy_master_attributes(struct w1_master *); | ||
141 | void w1_search(struct w1_master *dev); | 140 | void w1_search(struct w1_master *dev); |
142 | 141 | ||
143 | #endif /* __KERNEL__ */ | 142 | #endif /* __KERNEL__ */ |