Skip to contentSkip to conversation

mmc: sdhci_f_sdh30: Staticize local functions

PATCH Applied Axel Lin 2 participants 4 messages Apr 24, 2015 – May 5, 2015

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/2 mmc: sdhci_f_sdh30: Staticize local functions

Make local functions static.

---
 drivers/mmc/host/sdhci_f_sdh30.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/mmc/host/sdhci_f_sdh30.c +3 -3
index 2fe8b91..5397e27 100644
@@ -49,7 +49,7 @@ struct f_sdhost_priv {
 	struct device *dev;
 };
 
-void sdhci_f_sdh30_soft_voltage_switch(struct sdhci_host *host)
+static void sdhci_f_sdh30_soft_voltage_switch(struct sdhci_host *host)
 {
 	struct f_sdhost_priv *priv = sdhci_priv(host);
 	u32 ctrl = 0;
@@ -77,12 +77,12 @@ void sdhci_f_sdh30_soft_voltage_switch(struct sdhci_host *host)
 	sdhci_writel(host, ctrl, F_SDH30_TUNING_SETTING);
 }
 
-unsigned int sdhci_f_sdh30_get_min_clock(struct sdhci_host *host)
+static unsigned int sdhci_f_sdh30_get_min_clock(struct sdhci_host *host)
 {
 	return F_SDH30_MIN_CLOCK;
 }
 
-void sdhci_f_sdh30_reset(struct sdhci_host *host, u8 mask)
+static void sdhci_f_sdh30_reset(struct sdhci_host *host, u8 mask)
 {
 	if (sdhci_readw(host, SDHCI_CLOCK_CONTROL) == 0)
 		sdhci_writew(host, 0xBC01, SDHCI_CLOCK_CONTROL);
Signature · 1 line
2.1.0
author
#1 lore raw

PATCH 2/2 mmc: sdhci_f_sdh30: Fix the size passed to sdhci_alloc_host

sdhci_alloc_host() takes priv_size rather than
sizeof(struct sdhci_host) + priv_size.

---
 drivers/mmc/host/sdhci_f_sdh30.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/host/sdhci_f_sdh30.c +1 -2
index 5397e27..983b8b3 100644
@@ -114,8 +114,7 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev)
 		return irq;
 	}
 
-	host = sdhci_alloc_host(dev, sizeof(struct sdhci_host) +
-						sizeof(struct f_sdhost_priv));
+	host = sdhci_alloc_host(dev, sizeof(struct f_sdhost_priv));
 	if (IS_ERR(host))
 		return PTR_ERR(host);
 
Signature · 1 line
2.1.0
Applied
#2 lore raw

Re: [PATCH 2/2] mmc: sdhci_f_sdh30: Fix the size passed to sdhci_alloc_host

Quoted 4 lines · Axel Lin

sdhci_alloc_host() takes priv_size rather than
sizeof(struct sdhci_host) + priv_size.

Thanks, applied!

Kind regards
Uffe

Quoted 23 lines
---
 drivers/mmc/host/sdhci_f_sdh30.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mmc/host/sdhci_f_sdh30.c +1 -3
index 5397e27..983b8b3 100644
@@ -114,8 +114,7 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev)
                return irq;
        }
 
-       host = sdhci_alloc_host(dev, sizeof(struct sdhci_host) +
-                                               sizeof(struct f_sdhost_priv));
+       host = sdhci_alloc_host(dev, sizeof(struct f_sdhost_priv));
        if (IS_ERR(host))
                return PTR_ERR(host);
 
--

2.1.0

Applied
#3 lore raw
In reply to Axel Lin
Quoted 3 lines · Axel Lin

Make local functions static.

Thanks, applied!

Kind regards
Uffe

Quoted 37 lines
---
 drivers/mmc/host/sdhci_f_sdh30.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/mmc/host/sdhci_f_sdh30.c +3 -4
index 2fe8b91..5397e27 100644
@@ -49,7 +49,7 @@ struct f_sdhost_priv {
        struct device *dev;
 };
 
-void sdhci_f_sdh30_soft_voltage_switch(struct sdhci_host *host)
+static void sdhci_f_sdh30_soft_voltage_switch(struct sdhci_host *host)
 {
        struct f_sdhost_priv *priv = sdhci_priv(host);
        u32 ctrl = 0;
@@ -77,12 +77,12 @@ void sdhci_f_sdh30_soft_voltage_switch(struct sdhci_host *host)
        sdhci_writel(host, ctrl, F_SDH30_TUNING_SETTING);
 }
 
-unsigned int sdhci_f_sdh30_get_min_clock(struct sdhci_host *host)
+static unsigned int sdhci_f_sdh30_get_min_clock(struct sdhci_host *host)
 {
        return F_SDH30_MIN_CLOCK;
 }
 
-void sdhci_f_sdh30_reset(struct sdhci_host *host, u8 mask)
+static void sdhci_f_sdh30_reset(struct sdhci_host *host, u8 mask)
 {
        if (sdhci_readw(host, SDHCI_CLOCK_CONTROL) == 0)
                sdhci_writew(host, 0xBC01, SDHCI_CLOCK_CONTROL);
--

2.1.0