Skip to content

Commit 8663f5c

Browse files
committed
backends: mark all functions as static
Now as each backend exports data structure, mark all functions as static. Signed-off-by: Dmitry Baryshkov <[email protected]>
1 parent 2014d2c commit 8663f5c

File tree

6 files changed

+28
-33
lines changed

6 files changed

+28
-33
lines changed

alpaca.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ struct alpaca {
5353
static int alpaca_device_power(struct alpaca *alpaca, int on);
5454
static int alpaca_usb_device_power(struct alpaca *alpaca, int on);
5555

56-
void *alpaca_open(struct device *dev)
56+
static void *alpaca_open(struct device *dev)
5757
{
5858
struct alpaca *alpaca;
5959

@@ -121,22 +121,22 @@ static int alpaca_power_off(struct device *dev)
121121
return 0;
122122
}
123123

124-
int alpaca_power(struct device *dev, bool on)
124+
static int alpaca_power(struct device *dev, bool on)
125125
{
126126
if (on)
127127
return alpaca_power_on(dev);
128128
else
129129
return alpaca_power_off(dev);
130130
}
131131

132-
void alpaca_usb(struct device *dev, bool on)
132+
static void alpaca_usb(struct device *dev, bool on)
133133
{
134134
struct alpaca *alpaca = dev->cdb;
135135

136136
alpaca_usb_device_power(alpaca, on);
137137
}
138138

139-
void alpaca_key(struct device *dev, int key, bool asserted)
139+
static void alpaca_key(struct device *dev, int key, bool asserted)
140140
{
141141
switch (key) {
142142
case DEVICE_KEY_FASTBOOT:

cdb_assist.c

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ static int cdb_ctrl_write(struct cdb_assist *cdb, const char *buf, size_t len)
273273
return write(cdb->control_tty, buf, len);
274274
}
275275

276-
void *cdb_assist_open(struct device *dev)
276+
static void *cdb_assist_open(struct device *dev)
277277
{
278278
struct cdb_assist *cdb;
279279
int ret;
@@ -295,7 +295,7 @@ void *cdb_assist_open(struct device *dev)
295295
return cdb;
296296
}
297297

298-
void cdb_assist_close(struct device *dev)
298+
static void cdb_assist_close(struct device *dev)
299299
{
300300
struct cdb_assist *cdb = dev->cdb;
301301

@@ -311,14 +311,14 @@ static void cdb_power(struct cdb_assist *cdb, bool on)
311311
cdb_ctrl_write(cdb, &cmd[on], 1);
312312
}
313313

314-
void cdb_vbus(struct cdb_assist *cdb, bool on)
314+
static void cdb_vbus(struct cdb_assist *cdb, bool on)
315315
{
316316
const char cmd[] = "vV";
317317

318318
cdb_ctrl_write(cdb, &cmd[on], 1);
319319
}
320320

321-
int cdb_assist_power(struct device *dev, bool on)
321+
static int cdb_assist_power(struct device *dev, bool on)
322322
{
323323
struct cdb_assist *cdb = dev->cdb;
324324

@@ -327,23 +327,18 @@ int cdb_assist_power(struct device *dev, bool on)
327327
return 0;
328328
}
329329

330-
void cdb_assist_usb(struct device *dev, bool on)
330+
static void cdb_assist_usb(struct device *dev, bool on)
331331
{
332332
cdb_vbus(dev->cdb, on);
333333
}
334334

335-
void cdb_gpio(struct cdb_assist *cdb, int gpio, bool on)
335+
static void cdb_gpio(struct cdb_assist *cdb, int gpio, bool on)
336336
{
337337
const char *cmd[] = { "aA", "bB", "cC" };
338338
cdb_ctrl_write(cdb, &cmd[gpio][on], 1);
339339
}
340340

341-
unsigned int cdb_vref(struct cdb_assist *cdb)
342-
{
343-
return cdb->vref;
344-
}
345-
346-
void cdb_assist_print_status(struct device *dev)
341+
static void cdb_assist_print_status(struct device *dev)
347342
{
348343
struct cdb_assist *cdb = dev->cdb;
349344
char buf[128];
@@ -371,7 +366,7 @@ static void cdb_set_voltage(struct cdb_assist *cdb, unsigned mV)
371366
cdb_ctrl_write(cdb, buf, n);
372367
}
373368

374-
void cdb_assist_key(struct device *dev, int key, bool asserted)
369+
static void cdb_assist_key(struct device *dev, int key, bool asserted)
375370
{
376371
struct cdb_assist *cdb = dev->cdb;
377372

conmux.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ static int conmux_data(int fd, void *data)
224224
return 0;
225225
}
226226

227-
void *conmux_open(struct device *dev)
227+
static void *conmux_open(struct device *dev)
228228
{
229229
struct addrinfo hints = {0}, *addrs, *addr;
230230
struct conmux_response resp = {};
@@ -297,7 +297,7 @@ void *conmux_open(struct device *dev)
297297
return conmux;
298298
}
299299

300-
int conmux_power_on(struct device *dev)
300+
static int conmux_power_on(struct device *dev)
301301
{
302302
struct conmux *conmux = dev->cdb;
303303
char sz[] = "~$hardreset\n";
@@ -317,22 +317,22 @@ static int conmux_power_off(struct device *dev)
317317
return write(conmux->fd, sz, sizeof(sz));
318318
}
319319

320-
int conmux_power(struct device *dev, bool on)
320+
static int conmux_power(struct device *dev, bool on)
321321
{
322322
if (on)
323323
return conmux_power_on(dev);
324324
else
325325
return conmux_power_off(dev);
326326
}
327327

328-
int conmux_write(struct device *dev, const void *buf, size_t len)
328+
static int conmux_write(struct device *dev, const void *buf, size_t len)
329329
{
330330
struct conmux *conmux = dev->cdb;
331331

332332
return write(conmux->fd, buf, len);
333333
}
334334

335-
void *conmux_console_open(struct device *dev)
335+
static void *conmux_console_open(struct device *dev)
336336
{
337337
return dev->cdb;
338338
}

console.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static int console_data(int fd, void *data)
5757
return 0;
5858
}
5959

60-
void *console_open(struct device *device)
60+
static void *console_open(struct device *device)
6161
{
6262
struct console *console;
6363

@@ -71,14 +71,14 @@ void *console_open(struct device *device)
7171
return console;
7272
}
7373

74-
int console_write(struct device *device, const void *buf, size_t len)
74+
static int console_write(struct device *device, const void *buf, size_t len)
7575
{
7676
struct console *console = device->console;
7777

7878
return write(console->console_fd, buf, len);;
7979
}
8080

81-
void console_send_break(struct device *device)
81+
static void console_send_break(struct device *device)
8282
{
8383
struct console *console = device->console;
8484

ftdi-gpio.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static void ftdi_gpio_parse_config(struct ftdi_gpio *ftdi_gpio, char *control_de
159159
}
160160
}
161161

162-
void *ftdi_gpio_open(struct device *dev)
162+
static void *ftdi_gpio_open(struct device *dev)
163163
{
164164
struct ftdi_gpio *ftdi_gpio;
165165
int ret;
@@ -224,21 +224,21 @@ static void ftdi_gpio_device_usb(struct ftdi_gpio *ftdi_gpio, bool on)
224224
ftdi_gpio_toggle_io(ftdi_gpio, GPIO_USB_DISCONNECT, on);
225225
}
226226

227-
int ftdi_gpio_power(struct device *dev, bool on)
227+
static int ftdi_gpio_power(struct device *dev, bool on)
228228
{
229229
struct ftdi_gpio *ftdi_gpio = dev->cdb;
230230

231231
return ftdi_gpio_device_power(ftdi_gpio, on);
232232
}
233233

234-
void ftdi_gpio_usb(struct device *dev, bool on)
234+
static void ftdi_gpio_usb(struct device *dev, bool on)
235235
{
236236
struct ftdi_gpio *ftdi_gpio = dev->cdb;
237237

238238
ftdi_gpio_device_usb(ftdi_gpio, on);
239239
}
240240

241-
void ftdi_gpio_key(struct device *dev, int key, bool asserted)
241+
static void ftdi_gpio_key(struct device *dev, int key, bool asserted)
242242
{
243243
struct ftdi_gpio *ftdi_gpio = dev->cdb;
244244

qcomlt_dbg.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct qcomlt_dbg {
5050
struct termios orig_tios;
5151
};
5252

53-
void *qcomlt_dbg_open(struct device *dev)
53+
static void *qcomlt_dbg_open(struct device *dev)
5454
{
5555
struct qcomlt_dbg *dbg;
5656

@@ -68,23 +68,23 @@ void *qcomlt_dbg_open(struct device *dev)
6868
return dbg;
6969
}
7070

71-
int qcomlt_dbg_power(struct device *dev, bool on)
71+
static int qcomlt_dbg_power(struct device *dev, bool on)
7272
{
7373
struct qcomlt_dbg *dbg = dev->cdb;
7474

7575
// fprintf(stderr, "qcomlt_dbg_power(%d)\n", on);
7676
return write(dbg->fd, &("pP"[on]), 1);
7777
}
7878

79-
void qcomlt_dbg_usb(struct device *dev, bool on)
79+
static void qcomlt_dbg_usb(struct device *dev, bool on)
8080
{
8181
struct qcomlt_dbg *dbg = dev->cdb;
8282

8383
// fprintf(stderr, "qcomlt_dbg_usb(%d)\n", on);
8484
write(dbg->fd, &("uU"[on]), 1);
8585
}
8686

87-
void qcomlt_dbg_key(struct device *dev, int key, bool asserted)
87+
static void qcomlt_dbg_key(struct device *dev, int key, bool asserted)
8888
{
8989
struct qcomlt_dbg *dbg = dev->cdb;
9090

0 commit comments

Comments
 (0)