Commit 393618510d5349e07d71dc28fb6fc49baf0d96a0

Authored by Adrian Bunk
Committed by Pierre Ossman
1 parent facba9179e

drivers/mmc/core/: make 3 functions static

This patch makes the following needlessly global functions static:
- sd_ops.c: mmc_app_cmd()
- core.c: __mmc_release_bus()
- core.c: mmc_start_request()

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>

Showing 4 changed files with 69 additions and 75 deletions Side-by-side Diff

drivers/mmc/core/core.c
... ... @@ -102,15 +102,7 @@
102 102  
103 103 EXPORT_SYMBOL(mmc_request_done);
104 104  
105   -/**
106   - * mmc_start_request - start a command on a host
107   - * @host: MMC host to start command on
108   - * @mrq: MMC request to start
109   - *
110   - * Queue a command on the specified host. We expect the
111   - * caller to be holding the host lock with interrupts disabled.
112   - */
113   -void
  105 +static void
114 106 mmc_start_request(struct mmc_host *host, struct mmc_request *mrq)
115 107 {
116 108 #ifdef CONFIG_MMC_DEBUG
... ... @@ -165,8 +157,6 @@
165 157 host->ops->request(host, mrq);
166 158 }
167 159  
168   -EXPORT_SYMBOL(mmc_start_request);
169   -
170 160 static void mmc_wait_done(struct mmc_request *mrq)
171 161 {
172 162 complete(mrq->done_data);
... ... @@ -472,6 +462,45 @@
472 462 }
473 463  
474 464 /*
  465 + * Cleanup when the last reference to the bus operator is dropped.
  466 + */
  467 +void __mmc_release_bus(struct mmc_host *host)
  468 +{
  469 + BUG_ON(!host);
  470 + BUG_ON(host->bus_refs);
  471 + BUG_ON(!host->bus_dead);
  472 +
  473 + host->bus_ops = NULL;
  474 +}
  475 +
  476 +/*
  477 + * Increase reference count of bus operator
  478 + */
  479 +static inline void mmc_bus_get(struct mmc_host *host)
  480 +{
  481 + unsigned long flags;
  482 +
  483 + spin_lock_irqsave(&host->lock, flags);
  484 + host->bus_refs++;
  485 + spin_unlock_irqrestore(&host->lock, flags);
  486 +}
  487 +
  488 +/*
  489 + * Decrease reference count of bus operator and free it if
  490 + * it is the last reference.
  491 + */
  492 +static inline void mmc_bus_put(struct mmc_host *host)
  493 +{
  494 + unsigned long flags;
  495 +
  496 + spin_lock_irqsave(&host->lock, flags);
  497 + host->bus_refs--;
  498 + if ((host->bus_refs == 0) && host->bus_ops)
  499 + __mmc_release_bus(host);
  500 + spin_unlock_irqrestore(&host->lock, flags);
  501 +}
  502 +
  503 +/*
475 504 * Assign a mmc bus handler to a host. Only one bus handler may control a
476 505 * host at any given time.
477 506 */
... ... @@ -518,18 +547,6 @@
518 547 mmc_power_off(host);
519 548  
520 549 mmc_bus_put(host);
521   -}
522   -
523   -/*
524   - * Cleanup when the last reference to the bus operator is dropped.
525   - */
526   -void __mmc_release_bus(struct mmc_host *host)
527   -{
528   - BUG_ON(!host);
529   - BUG_ON(host->bus_refs);
530   - BUG_ON(!host->bus_dead);
531   -
532   - host->bus_ops = NULL;
533 550 }
534 551  
535 552 /**
drivers/mmc/core/core.h
... ... @@ -27,28 +27,6 @@
27 27 void mmc_attach_bus(struct mmc_host *host, const struct mmc_bus_ops *ops);
28 28 void mmc_detach_bus(struct mmc_host *host);
29 29  
30   -void __mmc_release_bus(struct mmc_host *host);
31   -
32   -static inline void mmc_bus_get(struct mmc_host *host)
33   -{
34   - unsigned long flags;
35   -
36   - spin_lock_irqsave(&host->lock, flags);
37   - host->bus_refs++;
38   - spin_unlock_irqrestore(&host->lock, flags);
39   -}
40   -
41   -static inline void mmc_bus_put(struct mmc_host *host)
42   -{
43   - unsigned long flags;
44   -
45   - spin_lock_irqsave(&host->lock, flags);
46   - host->bus_refs--;
47   - if ((host->bus_refs == 0) && host->bus_ops)
48   - __mmc_release_bus(host);
49   - spin_unlock_irqrestore(&host->lock, flags);
50   -}
51   -
52 30 void mmc_set_chip_select(struct mmc_host *host, int mode);
53 31 void mmc_set_clock(struct mmc_host *host, unsigned int hz);
54 32 void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode);
drivers/mmc/core/sd_ops.c
... ... @@ -21,6 +21,35 @@
21 21 #include "core.h"
22 22 #include "sd_ops.h"
23 23  
  24 +static int mmc_app_cmd(struct mmc_host *host, struct mmc_card *card)
  25 +{
  26 + int err;
  27 + struct mmc_command cmd;
  28 +
  29 + BUG_ON(!host);
  30 + BUG_ON(card && (card->host != host));
  31 +
  32 + cmd.opcode = MMC_APP_CMD;
  33 +
  34 + if (card) {
  35 + cmd.arg = card->rca << 16;
  36 + cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
  37 + } else {
  38 + cmd.arg = 0;
  39 + cmd.flags = MMC_RSP_R1 | MMC_CMD_BCR;
  40 + }
  41 +
  42 + err = mmc_wait_for_cmd(host, &cmd, 0);
  43 + if (err != MMC_ERR_NONE)
  44 + return err;
  45 +
  46 + /* Check that card supported application commands */
  47 + if (!(cmd.resp[0] & R1_APP_CMD))
  48 + return MMC_ERR_FAILED;
  49 +
  50 + return MMC_ERR_NONE;
  51 +}
  52 +
24 53 /**
25 54 * mmc_wait_for_app_cmd - start an application command and wait for
26 55 completion
... ... @@ -76,35 +105,6 @@
76 105 }
77 106  
78 107 EXPORT_SYMBOL(mmc_wait_for_app_cmd);
79   -
80   -int mmc_app_cmd(struct mmc_host *host, struct mmc_card *card)
81   -{
82   - int err;
83   - struct mmc_command cmd;
84   -
85   - BUG_ON(!host);
86   - BUG_ON(card && (card->host != host));
87   -
88   - cmd.opcode = MMC_APP_CMD;
89   -
90   - if (card) {
91   - cmd.arg = card->rca << 16;
92   - cmd.flags = MMC_RSP_R1 | MMC_CMD_AC;
93   - } else {
94   - cmd.arg = 0;
95   - cmd.flags = MMC_RSP_R1 | MMC_CMD_BCR;
96   - }
97   -
98   - err = mmc_wait_for_cmd(host, &cmd, 0);
99   - if (err != MMC_ERR_NONE)
100   - return err;
101   -
102   - /* Check that card supported application commands */
103   - if (!(cmd.resp[0] & R1_APP_CMD))
104   - return MMC_ERR_FAILED;
105   -
106   - return MMC_ERR_NONE;
107   -}
108 108  
109 109 int mmc_app_set_bus_width(struct mmc_card *card, int width)
110 110 {
drivers/mmc/core/sd_ops.h
... ... @@ -12,7 +12,6 @@
12 12 #ifndef _MMC_SD_OPS_H
13 13 #define _MMC_SD_OPS_H
14 14  
15   -int mmc_app_cmd(struct mmc_host *host, struct mmc_card *card);
16 15 int mmc_app_set_bus_width(struct mmc_card *card, int width);
17 16 int mmc_send_app_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr);
18 17 int mmc_send_if_cond(struct mmc_host *host, u32 ocr);