diff options
| author | Evgeniy Polyakov <johnpol@2ka.mipt.ru> | 2006-04-24 02:46:14 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-22 14:22:50 -0400 |
| commit | 70d484bff43013e9b08f5d970b1c5941e9d98e16 (patch) | |
| tree | 1d5fdc87b7cdfe45b4ae745aef0310c256bd50f7 | |
| parent | 2c5bfdac33607a618d8cf1532ef235ca9eccd49e (diff) | |
[PATCH] W1: possible cleanups
This patch contains the following possible cleanups:
- the following file did't #include the header with the prototypes for
it's global functions:
- w1_int.c
- #if 0 the following unused global function:
- w1_family.c: w1_family_get()
- make the following needlessly global functions static:
- w1_family.c: __w1_family_put()
- w1_io.c: w1_delay()
- w1_io.c: w1_touch_bit()
- w1_io.c: w1_read_8()
- remove the following unused EXPORT_SYMBOL's:
- w1_family.c: w1_family_put
- w1_family.c: w1_family_registered
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| -rw-r--r-- | drivers/w1/w1.h | 3 | ||||
| -rw-r--r-- | drivers/w1/w1_family.c | 18 | ||||
| -rw-r--r-- | drivers/w1/w1_family.h | 2 | ||||
| -rw-r--r-- | drivers/w1/w1_int.c | 1 | ||||
| -rw-r--r-- | drivers/w1/w1_io.c | 6 | ||||
| -rw-r--r-- | drivers/w1/w1_io.h | 3 |
6 files changed, 12 insertions, 21 deletions
diff --git a/drivers/w1/w1.h b/drivers/w1/w1.h index 3828f39b22eb..c90a92879bc7 100644 --- a/drivers/w1/w1.h +++ b/drivers/w1/w1.h | |||
| @@ -187,11 +187,8 @@ struct w1_slave *w1_search_slave(struct w1_reg_num *id); | |||
| 187 | void w1_search_process(struct w1_master *dev, u8 search_type); | 187 | void w1_search_process(struct w1_master *dev, u8 search_type); |
| 188 | struct w1_master *w1_search_master_id(u32 id); | 188 | struct w1_master *w1_search_master_id(u32 id); |
| 189 | 189 | ||
| 190 | void w1_delay(unsigned long); | ||
| 191 | u8 w1_touch_bit(struct w1_master *, int); | ||
| 192 | u8 w1_triplet(struct w1_master *dev, int bdir); | 190 | u8 w1_triplet(struct w1_master *dev, int bdir); |
| 193 | void w1_write_8(struct w1_master *, u8); | 191 | void w1_write_8(struct w1_master *, u8); |
| 194 | u8 w1_read_8(struct w1_master *); | ||
| 195 | int w1_reset_bus(struct w1_master *); | 192 | int w1_reset_bus(struct w1_master *); |
| 196 | u8 w1_calc_crc8(u8 *, int); | 193 | u8 w1_calc_crc8(u8 *, int); |
| 197 | void w1_write_block(struct w1_master *, const u8 *, int); | 194 | void w1_write_block(struct w1_master *, const u8 *, int); |
diff --git a/drivers/w1/w1_family.c b/drivers/w1/w1_family.c index 0e32c114f906..a3c95bd6890a 100644 --- a/drivers/w1/w1_family.c +++ b/drivers/w1/w1_family.c | |||
| @@ -107,6 +107,12 @@ struct w1_family * w1_family_registered(u8 fid) | |||
| 107 | return (ret) ? f : NULL; | 107 | return (ret) ? f : NULL; |
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | static void __w1_family_put(struct w1_family *f) | ||
| 111 | { | ||
| 112 | if (atomic_dec_and_test(&f->refcnt)) | ||
| 113 | f->need_exit = 1; | ||
| 114 | } | ||
| 115 | |||
| 110 | void w1_family_put(struct w1_family *f) | 116 | void w1_family_put(struct w1_family *f) |
| 111 | { | 117 | { |
| 112 | spin_lock(&w1_flock); | 118 | spin_lock(&w1_flock); |
| @@ -114,19 +120,14 @@ void w1_family_put(struct w1_family *f) | |||
| 114 | spin_unlock(&w1_flock); | 120 | spin_unlock(&w1_flock); |
| 115 | } | 121 | } |
| 116 | 122 | ||
| 117 | void __w1_family_put(struct w1_family *f) | 123 | #if 0 |
| 118 | { | ||
| 119 | if (atomic_dec_and_test(&f->refcnt)) | ||
| 120 | f->need_exit = 1; | ||
| 121 | } | ||
| 122 | |||
| 123 | void w1_family_get(struct w1_family *f) | 124 | void w1_family_get(struct w1_family *f) |
| 124 | { | 125 | { |
| 125 | spin_lock(&w1_flock); | 126 | spin_lock(&w1_flock); |
| 126 | __w1_family_get(f); | 127 | __w1_family_get(f); |
| 127 | spin_unlock(&w1_flock); | 128 | spin_unlock(&w1_flock); |
| 128 | |||
| 129 | } | 129 | } |
| 130 | #endif /* 0 */ | ||
| 130 | 131 | ||
| 131 | void __w1_family_get(struct w1_family *f) | 132 | void __w1_family_get(struct w1_family *f) |
| 132 | { | 133 | { |
| @@ -135,8 +136,5 @@ void __w1_family_get(struct w1_family *f) | |||
| 135 | smp_mb__after_atomic_inc(); | 136 | smp_mb__after_atomic_inc(); |
| 136 | } | 137 | } |
| 137 | 138 | ||
| 138 | EXPORT_SYMBOL(w1_family_get); | ||
| 139 | EXPORT_SYMBOL(w1_family_put); | ||
| 140 | EXPORT_SYMBOL(w1_family_registered); | ||
| 141 | EXPORT_SYMBOL(w1_unregister_family); | 139 | EXPORT_SYMBOL(w1_unregister_family); |
| 142 | EXPORT_SYMBOL(w1_register_family); | 140 | EXPORT_SYMBOL(w1_register_family); |
diff --git a/drivers/w1/w1_family.h b/drivers/w1/w1_family.h index 22a9d52c94f3..1e2ac40c2c14 100644 --- a/drivers/w1/w1_family.h +++ b/drivers/w1/w1_family.h | |||
| @@ -57,10 +57,8 @@ struct w1_family | |||
| 57 | 57 | ||
| 58 | extern spinlock_t w1_flock; | 58 | extern spinlock_t w1_flock; |
| 59 | 59 | ||
| 60 | void w1_family_get(struct w1_family *); | ||
| 61 | void w1_family_put(struct w1_family *); | 60 | void w1_family_put(struct w1_family *); |
| 62 | void __w1_family_get(struct w1_family *); | 61 | void __w1_family_get(struct w1_family *); |
| 63 | void __w1_family_put(struct w1_family *); | ||
| 64 | struct w1_family * w1_family_registered(u8); | 62 | struct w1_family * w1_family_registered(u8); |
| 65 | void w1_unregister_family(struct w1_family *); | 63 | void w1_unregister_family(struct w1_family *); |
| 66 | int w1_register_family(struct w1_family *); | 64 | int w1_register_family(struct w1_family *); |
diff --git a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c index 475996cd1b7d..357a2e0f637a 100644 --- a/drivers/w1/w1_int.c +++ b/drivers/w1/w1_int.c | |||
| @@ -27,6 +27,7 @@ | |||
| 27 | #include "w1.h" | 27 | #include "w1.h" |
| 28 | #include "w1_log.h" | 28 | #include "w1_log.h" |
| 29 | #include "w1_netlink.h" | 29 | #include "w1_netlink.h" |
| 30 | #include "w1_int.h" | ||
| 30 | 31 | ||
| 31 | static u32 w1_ids = 1; | 32 | static u32 w1_ids = 1; |
| 32 | 33 | ||
diff --git a/drivers/w1/w1_io.c b/drivers/w1/w1_io.c index 3253bb0d0826..30b6fbf83bd4 100644 --- a/drivers/w1/w1_io.c +++ b/drivers/w1/w1_io.c | |||
| @@ -50,7 +50,7 @@ static u8 w1_crc8_table[] = { | |||
| 50 | 116, 42, 200, 150, 21, 75, 169, 247, 182, 232, 10, 84, 215, 137, 107, 53 | 50 | 116, 42, 200, 150, 21, 75, 169, 247, 182, 232, 10, 84, 215, 137, 107, 53 |
| 51 | }; | 51 | }; |
| 52 | 52 | ||
| 53 | void w1_delay(unsigned long tm) | 53 | static void w1_delay(unsigned long tm) |
| 54 | { | 54 | { |
| 55 | udelay(tm * w1_delay_parm); | 55 | udelay(tm * w1_delay_parm); |
| 56 | } | 56 | } |
| @@ -61,7 +61,7 @@ static u8 w1_read_bit(struct w1_master *dev); | |||
| 61 | /** | 61 | /** |
| 62 | * Generates a write-0 or write-1 cycle and samples the level. | 62 | * Generates a write-0 or write-1 cycle and samples the level. |
| 63 | */ | 63 | */ |
| 64 | u8 w1_touch_bit(struct w1_master *dev, int bit) | 64 | static u8 w1_touch_bit(struct w1_master *dev, int bit) |
| 65 | { | 65 | { |
| 66 | if (dev->bus_master->touch_bit) | 66 | if (dev->bus_master->touch_bit) |
| 67 | return dev->bus_master->touch_bit(dev->bus_master->data, bit); | 67 | return dev->bus_master->touch_bit(dev->bus_master->data, bit); |
| @@ -177,7 +177,7 @@ u8 w1_triplet(struct w1_master *dev, int bdir) | |||
| 177 | * @param dev the master device | 177 | * @param dev the master device |
| 178 | * @return the byte read | 178 | * @return the byte read |
| 179 | */ | 179 | */ |
| 180 | u8 w1_read_8(struct w1_master * dev) | 180 | static u8 w1_read_8(struct w1_master * dev) |
| 181 | { | 181 | { |
| 182 | int i; | 182 | int i; |
| 183 | u8 res = 0; | 183 | u8 res = 0; |
diff --git a/drivers/w1/w1_io.h b/drivers/w1/w1_io.h index 232860184a29..9a76d2ad69c5 100644 --- a/drivers/w1/w1_io.h +++ b/drivers/w1/w1_io.h | |||
| @@ -24,11 +24,8 @@ | |||
| 24 | 24 | ||
| 25 | #include "w1.h" | 25 | #include "w1.h" |
| 26 | 26 | ||
| 27 | void w1_delay(unsigned long); | ||
| 28 | u8 w1_touch_bit(struct w1_master *, int); | ||
| 29 | u8 w1_triplet(struct w1_master *dev, int bdir); | 27 | u8 w1_triplet(struct w1_master *dev, int bdir); |
| 30 | void w1_write_8(struct w1_master *, u8); | 28 | void w1_write_8(struct w1_master *, u8); |
| 31 | u8 w1_read_8(struct w1_master *); | ||
| 32 | int w1_reset_bus(struct w1_master *); | 29 | int w1_reset_bus(struct w1_master *); |
| 33 | u8 w1_calc_crc8(u8 *, int); | 30 | u8 w1_calc_crc8(u8 *, int); |
| 34 | void w1_write_block(struct w1_master *, const u8 *, int); | 31 | void w1_write_block(struct w1_master *, const u8 *, int); |
