Skip to contentSkip to conversation

mmc: core: Fix start_signal_voltage_switch argument type

PATCH In review Fabio Estevam 2 participants 3 messages Feb 14, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: core: Fix start_signal_voltage_switch argument type

From: Fabio Estevam <[email protected]>

Since commit 3714f4315354 (mmc: sdhci: update signal voltage switch code) the second argument of start_signal_voltage_switch has 'int signal_voltage' type, so update mmc core and the mmc host struct definition accordingly.

Fix the following build warning:

drivers/mmc/host/sdhci.c:2044:2: warning: initialization from incompatible pointer type [enabled by default] drivers/mmc/host/sdhci.c:2044:2: warning: (near initialization for 'sdhci_ops.start_signal_voltage_switch') [enabled by default]

---
 drivers/mmc/core/core.c  |    2 +-
 include/linux/mmc/host.h |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/mmc/core/core.c +1 -1
index 08a3cf2..c346bc7 100644
@@ -1325,7 +1325,7 @@ int __mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage)
 	host->ios.signal_voltage = signal_voltage;
 	if (host->ops->start_signal_voltage_switch) {
 		mmc_host_clk_hold(host);
-		err = host->ops->start_signal_voltage_switch(host, &host->ios);
+		err = host->ops->start_signal_voltage_switch(host, signal_voltage);
 		mmc_host_clk_release(host);
 	}
 
include/linux/mmc/host.h +2 -1
index fd5fd5a..ad8b1a6 100644
@@ -129,7 +129,8 @@ struct mmc_host_ops {
 	/* optional callback for HC quirks */
 	void	(*init_card)(struct mmc_host *host, struct mmc_card *card);
 
-	int	(*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios);
+	int	(*start_signal_voltage_switch)(struct mmc_host *host,
+							int signal_voltage);
 
 	/* Check if the card is pulling dat[0:3] low */
 	int	(*card_busy)(struct mmc_host *host);
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 22 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Since commit 3714f4315354 (mmc: sdhci: update signal voltage switch code) the second argument of start_signal_voltage_switch has 'int signal_voltage' type, so update mmc core and the mmc host struct definition accordingly.

Fix the following build warning:

drivers/mmc/host/sdhci.c:2044:2: warning: initialization from incompatible pointer type [enabled by default] drivers/mmc/host/sdhci.c:2044:2: warning: (near initialization for 'sdhci_ops.start_signal_voltage_switch') [enabled by default]

---
 drivers/mmc/core/core.c  |    2 +-
 include/linux/mmc/host.h |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/mmc/core/core.c +0 -0
index 08a3cf2..c346bc7 100644

drivers/mmc/core/core.c int __mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage) · line 1328

Quoted 5 lines
drivers/mmc/core/core.c +1 -1
@@ -1325,7 +1325,7 @@ int __mmc_set_signal_voltage(struct mmc_host *host, int signal_voltage)
        host->ios.signal_voltage = signal_voltage;
        if (host->ops->start_signal_voltage_switch) {
                mmc_host_clk_hold(host);
-               err = host->ops->start_signal_voltage_switch(host, &host->ios);
+               err = host->ops->start_signal_voltage_switch(host, signal_voltage);

No. Fixup shall be done in SDHCI instead. Otherwise other host drivers will break instead.

Quoted 20 lines
drivers/mmc/core/core.c +0 -0
                mmc_host_clk_release(host);
        }
 
include/linux/mmc/host.h +2 -2
index fd5fd5a..ad8b1a6 100644
@@ -129,7 +129,8 @@ struct mmc_host_ops {
        /* optional callback for HC quirks */
        void    (*init_card)(struct mmc_host *host, struct mmc_card *card);
 
-       int     (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios);
+       int     (*start_signal_voltage_switch)(struct mmc_host *host,
+                                                       int signal_voltage);
 
        /* Check if the card is pulling dat[0:3] low */
        int     (*card_busy)(struct mmc_host *host);
--

1.7.9.5

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Kind regards
Ulf Hansson

#2 lore raw

Hi Ulf,

Quoted 2 lines · Ulf Hansson

No. Fixup shall be done in SDHCI instead. Otherwise other host drivers will break instead.

Do you mean like this?

drivers/mmc/host/sdhci.c +0 -0
@@ -1675,7 +1675,7 @@ static void sdhci_enable_sdio_irq(struct

mmc_host *mmc, int enable)
}

static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host,
- int signal_voltage)
+ struct mmc_ios *ios)

 {
        u16 ctrl;
        int ret;

@@ -1689,7 +1689,7 @@ static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host,

        ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2);

- switch (signal_voltage) {

+       switch (ios->signal_voltage) {
        case MMC_SIGNAL_VOLTAGE_330:
                /* Set 1.8V Signal Enable in the Host Control2 register to 0 */
                ctrl &= ~SDHCI_CTRL_VDD_180;

@@ -1762,7 +1762,7 @@ static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host,
}

static int sdhci_start_signal_voltage_switch(struct mmc_host *mmc,
- int signal_voltage)
+ struct mmc_ios *ios)

 {
        struct sdhci_host *host = mmc_priv(mmc);
        int err;
@@ -1770,7 +1770,7 @@ static int
sdhci_start_signal_voltage_switch(struct mmc_host *mmc,
        if (host->version < SDHCI_SPEC_300)
                return 0;
        sdhci_runtime_pm_get(host);
-       err = sdhci_do_start_signal_voltage_switch(host, signal_voltage);
+       err = sdhci_do_start_signal_voltage_switch(host, ios);
        sdhci_runtime_pm_put(host);
        return err;

}