Skip to content

Commit 16665b5

Browse files
mkjpopcornmix
authored andcommitted
Run Lindent to fix whitespace, fix braces
1 parent abf868b commit 16665b5

File tree

4 files changed

+165
-151
lines changed

4 files changed

+165
-151
lines changed

drivers/w1/masters/w1-gpio.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static int __init w1_gpio_probe(struct platform_device *pdev)
8686
if (w1_gpio_pullup)
8787
if (pdata->is_open_drain)
8888
printk(KERN_ERR "w1-gpio 'pullup' option "
89-
"doesn't work with open drain GPIO\n");
89+
"doesn't work with open drain GPIO\n");
9090
else
9191
master->bitbang_pullup = w1_gpio_bitbang_pullup;
9292

@@ -101,9 +101,9 @@ static int __init w1_gpio_probe(struct platform_device *pdev)
101101

102102
return 0;
103103

104-
free_gpio:
104+
free_gpio:
105105
gpio_free(pdata->pin);
106-
free_master:
106+
free_master:
107107
kfree(master);
108108

109109
return err;
@@ -153,10 +153,10 @@ static int w1_gpio_resume(struct platform_device *pdev)
153153

154154
static struct platform_driver w1_gpio_driver = {
155155
.driver = {
156-
.name = "w1-gpio",
157-
.owner = THIS_MODULE,
158-
},
159-
.remove = __exit_p(w1_gpio_remove),
156+
.name = "w1-gpio",
157+
.owner = THIS_MODULE,
158+
},
159+
.remove = __exit_p(w1_gpio_remove),
160160
.suspend = w1_gpio_suspend,
161161
.resume = w1_gpio_resume,
162162
};

drivers/w1/w1.h

Lines changed: 67 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,11 @@
2222
#ifndef __W1_H
2323
#define __W1_H
2424

25-
struct w1_reg_num
26-
{
25+
struct w1_reg_num {
2726
#if defined(__LITTLE_ENDIAN_BITFIELD)
28-
__u64 family:8,
29-
id:48,
30-
crc:8;
27+
__u64 family:8, id:48, crc:8;
3128
#elif defined(__BIG_ENDIAN_BITFIELD)
32-
__u64 crc:8,
33-
id:48,
34-
family:8;
29+
__u64 crc:8, id:48, family:8;
3530
#else
3631
#error "Please fix <asm/byteorder.h>"
3732
#endif
@@ -59,26 +54,24 @@ struct w1_reg_num
5954

6055
#define W1_SLAVE_ACTIVE 0
6156

62-
struct w1_slave
63-
{
64-
struct module *owner;
65-
unsigned char name[W1_MAXNAMELEN];
66-
struct list_head w1_slave_entry;
67-
struct w1_reg_num reg_num;
68-
atomic_t refcnt;
69-
u8 rom[9];
70-
u32 flags;
71-
int ttl;
72-
73-
struct w1_master *master;
74-
struct w1_family *family;
75-
void *family_data;
76-
struct device dev;
77-
struct completion released;
57+
struct w1_slave {
58+
struct module *owner;
59+
unsigned char name[W1_MAXNAMELEN];
60+
struct list_head w1_slave_entry;
61+
struct w1_reg_num reg_num;
62+
atomic_t refcnt;
63+
u8 rom[9];
64+
u32 flags;
65+
int ttl;
66+
67+
struct w1_master *master;
68+
struct w1_family *family;
69+
void *family_data;
70+
struct device dev;
71+
struct completion released;
7872
};
7973

80-
typedef void (*w1_slave_found_callback)(struct w1_master *, u64);
81-
74+
typedef void (*w1_slave_found_callback) (struct w1_master *, u64);
8275

8376
/**
8477
* Note: read_bit and write_bit are very low level functions and should only
@@ -87,19 +80,18 @@ typedef void (*w1_slave_found_callback)(struct w1_master *, u64);
8780
* Either define read_bit and write_bit OR define, at minimum, touch_bit and
8881
* reset_bus.
8982
*/
90-
struct w1_bus_master
91-
{
83+
struct w1_bus_master {
9284
/** the first parameter in all the functions below */
93-
void *data;
85+
void *data;
9486

9587
/**
9688
* Sample the line level
9789
* @return the level read (0 or 1)
9890
*/
99-
u8 (*read_bit)(void *);
91+
u8(*read_bit) (void *);
10092

10193
/** Sets the line level */
102-
void (*write_bit)(void *, u8);
94+
void (*write_bit) (void *, u8);
10395

10496
/**
10597
* touch_bit is the lowest-level function for devices that really
@@ -108,102 +100,103 @@ struct w1_bus_master
108100
* touch_bit(1) = write-1 / read cycle
109101
* @return the bit read (0 or 1)
110102
*/
111-
u8 (*touch_bit)(void *, u8);
103+
u8(*touch_bit) (void *, u8);
112104

113105
/**
114106
* Reads a bytes. Same as 8 touch_bit(1) calls.
115107
* @return the byte read
116108
*/
117-
u8 (*read_byte)(void *);
109+
u8(*read_byte) (void *);
118110

119111
/**
120112
* Writes a byte. Same as 8 touch_bit(x) calls.
121113
*/
122-
void (*write_byte)(void *, u8);
114+
void (*write_byte) (void *, u8);
123115

124116
/**
125117
* Same as a series of read_byte() calls
126118
* @return the number of bytes read
127119
*/
128-
u8 (*read_block)(void *, u8 *, int);
120+
u8(*read_block) (void *, u8 *, int);
129121

130122
/** Same as a series of write_byte() calls */
131-
void (*write_block)(void *, const u8 *, int);
123+
void (*write_block) (void *, const u8 *, int);
132124

133125
/**
134126
* Combines two reads and a smart write for ROM searches
135127
* @return bit0=Id bit1=comp_id bit2=dir_taken
136128
*/
137-
u8 (*triplet)(void *, u8);
129+
u8(*triplet) (void *, u8);
138130

139131
/**
140132
* long write-0 with a read for the presence pulse detection
141133
* @return -1=Error, 0=Device present, 1=No device present
142134
*/
143-
u8 (*reset_bus)(void *);
135+
u8(*reset_bus) (void *);
144136

145137
/**
146138
* Put out a strong pull-up pulse of the specified duration.
147139
* @return -1=Error, 0=completed
148140
*/
149-
u8 (*set_pullup)(void *, int);
141+
u8(*set_pullup) (void *, int);
150142

151143
/**
152144
* Turns the pullup on/off in bitbanging mode, takes an on/off argument.
153145
* @return -1=Error, 0=completed
154146
*/
155-
void (*bitbang_pullup)(void *, u8);
147+
void (*bitbang_pullup) (void *, u8);
156148

157149
/** Really nice hardware can handles the different types of ROM search
158150
* w1_master* is passed to the slave found callback.
159151
*/
160-
void (*search)(void *, struct w1_master *,
161-
u8, w1_slave_found_callback);
152+
void (*search) (void *, struct w1_master *,
153+
u8, w1_slave_found_callback);
162154
};
163155

164-
struct w1_master
165-
{
166-
struct list_head w1_master_entry;
167-
struct module *owner;
168-
unsigned char name[W1_MAXNAMELEN];
169-
struct list_head slist;
170-
int max_slave_count, slave_count;
171-
unsigned long attempts;
172-
int slave_ttl;
173-
int initialized;
174-
u32 id;
175-
int search_count;
176-
177-
atomic_t refcnt;
178-
179-
void *priv;
180-
int priv_size;
156+
struct w1_master {
157+
struct list_head w1_master_entry;
158+
struct module *owner;
159+
unsigned char name[W1_MAXNAMELEN];
160+
struct list_head slist;
161+
int max_slave_count, slave_count;
162+
unsigned long attempts;
163+
int slave_ttl;
164+
int initialized;
165+
u32 id;
166+
int search_count;
167+
168+
atomic_t refcnt;
169+
170+
void *priv;
171+
int priv_size;
181172

182173
/** 5V strong pullup enabled flag, 1 enabled, zero disabled. */
183-
int enable_pullup;
174+
int enable_pullup;
184175
/** 5V strong pullup duration in milliseconds, zero disabled. */
185-
int pullup_duration;
176+
int pullup_duration;
186177

187-
struct task_struct *thread;
188-
struct mutex mutex;
189-
struct mutex bus_mutex;
178+
struct task_struct *thread;
179+
struct mutex mutex;
180+
struct mutex bus_mutex;
190181

191-
struct device_driver *driver;
192-
struct device dev;
182+
struct device_driver *driver;
183+
struct device dev;
193184

194-
struct w1_bus_master *bus_master;
185+
struct w1_bus_master *bus_master;
195186

196-
u32 seq;
187+
u32 seq;
197188
};
198189

199190
int w1_create_master_attributes(struct w1_master *);
200191
void w1_destroy_master_attributes(struct w1_master *master);
201-
void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb);
202-
void w1_search_devices(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb);
192+
void w1_search(struct w1_master *dev, u8 search_type,
193+
w1_slave_found_callback cb);
194+
void w1_search_devices(struct w1_master *dev, u8 search_type,
195+
w1_slave_found_callback cb);
203196
struct w1_slave *w1_search_slave(struct w1_reg_num *id);
204197
void w1_slave_found(struct w1_master *dev, u64 rn);
205198
void w1_search_process_cb(struct w1_master *dev, u8 search_type,
206-
w1_slave_found_callback cb);
199+
w1_slave_found_callback cb);
207200
struct w1_master *w1_search_master_id(u32 id);
208201

209202
/* Disconnect and reconnect devices in the given family. Used for finding
@@ -226,17 +219,17 @@ int w1_reset_select_slave(struct w1_slave *sl);
226219
int w1_reset_resume_command(struct w1_master *);
227220
void w1_next_pullup(struct w1_master *, int);
228221

229-
static inline struct w1_slave* dev_to_w1_slave(struct device *dev)
222+
static inline struct w1_slave *dev_to_w1_slave(struct device *dev)
230223
{
231224
return container_of(dev, struct w1_slave, dev);
232225
}
233226

234-
static inline struct w1_slave* kobj_to_w1_slave(struct kobject *kobj)
227+
static inline struct w1_slave *kobj_to_w1_slave(struct kobject *kobj)
235228
{
236229
return dev_to_w1_slave(container_of(kobj, struct device, kobj));
237230
}
238231

239-
static inline struct w1_master* dev_to_w1_master(struct device *dev)
232+
static inline struct w1_master *dev_to_w1_master(struct device *dev)
240233
{
241234
return container_of(dev, struct w1_master, dev);
242235
}

0 commit comments

Comments
 (0)