Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Adrian Bunk and committed by
Pierre Ossman
39361851 facba917

+69 -75
+40 -23
drivers/mmc/core/core.c
··· 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 ··· 156 164 } 157 165 host->ops->request(host, mrq); 158 166 } 159 - 160 - EXPORT_SYMBOL(mmc_start_request); 161 167 162 168 static void mmc_wait_done(struct mmc_request *mrq) 163 169 { ··· 462 472 } 463 473 464 474 /* 475 + * Cleanup when the last reference to the bus operator is dropped. 476 + */ 477 + void __mmc_release_bus(struct mmc_host *host) 478 + { 479 + BUG_ON(!host); 480 + BUG_ON(host->bus_refs); 481 + BUG_ON(!host->bus_dead); 482 + 483 + host->bus_ops = NULL; 484 + } 485 + 486 + /* 487 + * Increase reference count of bus operator 488 + */ 489 + static inline void mmc_bus_get(struct mmc_host *host) 490 + { 491 + unsigned long flags; 492 + 493 + spin_lock_irqsave(&host->lock, flags); 494 + host->bus_refs++; 495 + spin_unlock_irqrestore(&host->lock, flags); 496 + } 497 + 498 + /* 499 + * Decrease reference count of bus operator and free it if 500 + * it is the last reference. 501 + */ 502 + static inline void mmc_bus_put(struct mmc_host *host) 503 + { 504 + unsigned long flags; 505 + 506 + spin_lock_irqsave(&host->lock, flags); 507 + host->bus_refs--; 508 + if ((host->bus_refs == 0) && host->bus_ops) 509 + __mmc_release_bus(host); 510 + spin_unlock_irqrestore(&host->lock, flags); 511 + } 512 + 513 + /* 465 514 * Assign a mmc bus handler to a host. Only one bus handler may control a 466 515 * host at any given time. 467 516 */ ··· 547 518 mmc_power_off(host); 548 519 549 520 mmc_bus_put(host); 550 - } 551 - 552 - /* 553 - * Cleanup when the last reference to the bus operator is dropped. 554 - */ 555 - void __mmc_release_bus(struct mmc_host *host) 556 - { 557 - BUG_ON(!host); 558 - BUG_ON(host->bus_refs); 559 - BUG_ON(!host->bus_dead); 560 - 561 - host->bus_ops = NULL; 562 521 } 563 522 564 523 /**
-22
drivers/mmc/core/core.h
··· 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);
+29 -29
drivers/mmc/core/sd_ops.c
··· 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 ··· 105 76 } 106 77 107 78 EXPORT_SYMBOL(mmc_wait_for_app_cmd); 108 - 109 - int mmc_app_cmd(struct mmc_host *host, struct mmc_card *card) 110 - { 111 - int err; 112 - struct mmc_command cmd; 113 - 114 - BUG_ON(!host); 115 - BUG_ON(card && (card->host != host)); 116 - 117 - cmd.opcode = MMC_APP_CMD; 118 - 119 - if (card) { 120 - cmd.arg = card->rca << 16; 121 - cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; 122 - } else { 123 - cmd.arg = 0; 124 - cmd.flags = MMC_RSP_R1 | MMC_CMD_BCR; 125 - } 126 - 127 - err = mmc_wait_for_cmd(host, &cmd, 0); 128 - if (err != MMC_ERR_NONE) 129 - return err; 130 - 131 - /* Check that card supported application commands */ 132 - if (!(cmd.resp[0] & R1_APP_CMD)) 133 - return MMC_ERR_FAILED; 134 - 135 - return MMC_ERR_NONE; 136 - } 137 79 138 80 int mmc_app_set_bus_width(struct mmc_card *card, int width) 139 81 {
-1
drivers/mmc/core/sd_ops.h
··· 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);