On 8 January 2013 10:42, Sachin Kamat <sachin.kamat@xxxxxxxxxx> wrote: > devm_regulator_get is device managed and saves some cleanup > and exit code. > > Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx> > --- > Compile tested against linux-next tree (20130108). > --- > drivers/mmc/host/mmci.c | 3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c > index 1507723..3ef9b1f 100644 > --- a/drivers/mmc/host/mmci.c > +++ b/drivers/mmc/host/mmci.c > @@ -1386,7 +1386,7 @@ static int mmci_probe(struct amba_device *dev, > > #ifdef CONFIG_REGULATOR > /* If we're using the regulator framework, try to fetch a regulator */ > - host->vcc = regulator_get(&dev->dev, "vmmc"); > + host->vcc = devm_regulator_get(&dev->dev, "vmmc"); This is not needed. Host drivers shall instead use mmc_regulator_get_supply API, which is already doing devm_regulator_get. A patch for mmci to use mmc_regulator_get_supply API has already been merged through Russell King's ARM tree. > if (IS_ERR(host->vcc)) > host->vcc = NULL; > else { > @@ -1587,7 +1587,6 @@ static int mmci_remove(struct amba_device *dev) > > if (host->vcc) > mmc_regulator_set_ocr(mmc, host->vcc, 0); > - regulator_put(host->vcc); > > mmc_free_host(mmc); > > -- > 1.7.4.1 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-mmc" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html Kind regards Ulf Hansson -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html