Skip to contentSkip to conversation

mmci: drop superfluous regulator #ifdef

PATCH New Linus Walleij 4 participants 7 messages Dec 2, 2010 – Dec 19, 2010

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

PATCH 1/1 mmci: drop superfluous regulator #ifdef

The regulator and MMC frameworks provide the proper stub functions for the regulator functions anyway, get rid of this.

---
 drivers/mmc/host/mmci.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/mmc/host/mmci.c +1 -2
index 3709ab3..7567872 100644
@@ -844,7 +844,6 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id)
 		mmc->f_max = min(host->mclk, fmax);
 	dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max);
 
-#ifdef CONFIG_REGULATOR
 	/* If we're using the regulator framework, try to fetch a regulator */
 	host->vcc = regulator_get(&dev->dev, "vmmc");
 	if (IS_ERR(host->vcc))
@@ -863,7 +862,7 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id)
 				 "(using regulator instead)\n");
 		}
 	}
-#endif
+
 	/* Fall back to platform data if no regulator is found */
 	if (host->vcc == NULL)
 		mmc->ocr_avail = plat->ocr_mask;
Signature · 1 line
1.7.3.2
#1 lore raw

PATCH 1/1 mmci: drop superfluous regulator #ifdef

Quoted 2 lines · Linus Walleij

The regulator and MMC frameworks provide the proper stub functions for the regulator functions anyway, get rid of this.

It's more that the regulator API stubs have been changed to match what MMC is doing (there always were stubs) but that doesn't make any material difference.

Quoted 1 line
#2 lore raw

PATCH 1/1 mmci: drop superfluous regulator #ifdef

In reply to Linus Walleij

Hi Linus,

Quoted 21 lines · Linus Walleij

The regulator and MMC frameworks provide the proper stub functions for the regulator functions anyway, get rid of this.

---
 drivers/mmc/host/mmci.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/mmc/host/mmci.c +0 -1
index 3709ab3..7567872 100644
@@ -844,7 +844,6 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id)
 		mmc->f_max = min(host->mclk, fmax);
 	dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max);
 
-#ifdef CONFIG_REGULATOR
 	/* If we're using the regulator framework, try to fetch a regulator */
 	host->vcc = regulator_get(&dev->dev, "vmmc");
 	if (IS_ERR(host->vcc))

drivers/mmc/host/mmci.c static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id) · line 868

Quoted 8 lines
drivers/mmc/host/mmci.c +1 -1
@@ -863,7 +862,7 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id)
 				 "(using regulator instead)\n");
 		}
 	}
-#endif
+
 	/* Fall back to platform data if no regulator is found */
 	if (host->vcc == NULL)
 		mmc->ocr_avail = plat->ocr_mask;

Thanks, pushed to mmc-next for .38.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
#3 lore raw

PATCH 1/1 mmci: drop superfluous regulator #ifdef

Quoted 19 lines · Chris Ball

Hi Linus,

Quoted 16 lines · Linus Walleij

The regulator and MMC frameworks provide the proper stub functions for the regulator functions anyway, get rid of this.

---
 drivers/mmc/host/mmci.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/mmc/host/mmci.c +0 -0
index 3709ab3..7567872 100644
@@ -844,7 +844,6 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id)
 		mmc->f_max = min(host->mclk, fmax);
 	dev_dbg(mmc_dev(mmc), "clocking block at %u Hz\n", mmc->f_max);
 
Quoted 15 lines

drivers/mmc/host/mmci.c static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id) · line 868

Quoted 13 lines
drivers/mmc/host/mmci.c +1 -2
-#ifdef CONFIG_REGULATOR
 	/* If we're using the regulator framework, try to fetch a regulator */
 	host->vcc = regulator_get(&dev->dev, "vmmc");
 	if (IS_ERR(host->vcc))
@@ -863,7 +862,7 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id)
 				 "(using regulator instead)\n");
 		}
 	}
-#endif
+
 	/* Fall back to platform data if no regulator is found */
 	if (host->vcc == NULL)
 		mmc->ocr_avail = plat->ocr_mask;

Thanks, pushed to mmc-next for .38.

Also queued in the ARM tree.

#4 lore raw

PATCH 1/1 mmci: drop superfluous regulator #ifdef

[Russell]

Quoted 5 lines

[Chris]

Quoted 1 line

Thanks, pushed to mmc-next for .38.

Also queued in the ARM tree.

Chris, Russell is listed as maintainer for this driver so he probably prefers to take in changes to it through the ARM tree, can you take this patch out of the mmc tree?

Yours,
Linus Walleij

#5 lore raw

PATCH 1/1 mmci: drop superfluous regulator #ifdef

Hi,

Quoted 7 lines · Linus WALLEIJ
Quoted 3 lines
Quoted 1 line

Thanks, pushed to mmc-next for .38.

Also queued in the ARM tree.

Chris, Russell is listed as maintainer for this driver so he probably prefers to take in changes to it through the ARM tree, can you take this patch out of the mmc tree?

Oops, my apologies, didn't think of that. Removed from mmc-next, thanks.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
#6 lore raw

PATCH 1/1 mmci: drop superfluous regulator #ifdef

In reply to Linus Walleij
Quoted 2 lines · Linus Walleij

The regulator and MMC frameworks provide the proper stub functions for the regulator functions anyway, get rid of this.

I'm dropping this patch - it's wrong, because on platforms without regulator support, it stamps over the provided platform values:

mmci-pl18x mb:mmci: Provided ocr_mask/setpower will not be used (using regulator instead)

# CONFIG_REGULATOR is not set

So the ifdefs have to stay until some other solution for this is found. Maybe the:

        if (IS_ERR(host->vcc))
                host->vcc = NULL;
        else {

should be:

        if (IS_ERR(host->vcc) || host->vcc == NULL)
                host->vcc = NULL;
        else {

or maybe:

        if (IS_ERR(host->vcc))
                host->vcc = NULL;
        else if (host->vcc) {