lkml.org 
[lkml]   [2012]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] MMC/omap_hsmmc: handle failure of regulator_get better.
    On Monday 30 July 2012 05:42 AM, NeilBrown wrote:
    >
    > 1/ if regulator_get fails, return an error. This is important
    > if it failed with EPROBE_DEFER, as the probe needs to be
    > deferred.
    >
    > 2/ Don't set .set_power until the regulator has been found, or
    > the deferred probe will not bother calling omap_hsmmc_reg_get().

    I am not very sure, but aren't the data structures re-allocated on a
    re-probe (after it was deferred) causing .set_power to be lost anyway?

    >
    > Signed-off-by: NeilBrown<neilb@suse.de>
    >
    > diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
    > index 389a3ee..f052c29 100644
    > --- a/drivers/mmc/host/omap_hsmmc.c
    > +++ b/drivers/mmc/host/omap_hsmmc.c
    > @@ -299,12 +299,12 @@ static int omap_hsmmc_reg_get(struct omap_hsmmc_host *host)
    > struct regulator *reg;
    > int ocr_value = 0;
    >
    > - mmc_slot(host).set_power = omap_hsmmc_set_power;
    > -
    > reg = regulator_get(host->dev, "vmmc");
    > if (IS_ERR(reg)) {
    > dev_dbg(host->dev, "vmmc regulator missing\n");
    > + return PTR_ERR(reg);
    > } else {
    > + mmc_slot(host).set_power = omap_hsmmc_set_power;
    > host->vcc = reg;
    > ocr_value = mmc_regulator_get_ocrmask(reg);
    > if (!mmc_slot(host).ocr_mask) {



    \
     
     \ /
      Last update: 2012-07-30 08:01    [W:0.025 / U:0.128 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site