lkml.org 
[lkml]   [2016]   [Oct]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mmc: core: Check regulator pointer
Hi,

On Tue, Oct 18, 2016 at 11:03:02AM +0200, Ulf Hansson wrote:
> On 18 October 2016 at 10:43, Maxime Ripard
> <maxime.ripard@free-electrons.com> wrote:
> > mmc_regulator_get_supply might silently fail if the regulators are not
> > found, which is the right thing to do since both these regulators are
> > optional.
> >
> > However, the drivers then have no way to know whether or not they should
> > proceed and call mmc_regulator_set_ocr. And since this function doesn't
>
> Host drivers should check "if (!IS_ERR(mmc->supply.vmmc))" before
> invoking mmc_regulator_set_ocr(). I wasn't aware that some didn't.

Ok, so the sunxi one definitely doesn't:
http://lxr.free-electrons.com/source/drivers/mmc/host/sunxi-mmc.c#L735

> My point is, that in some cases the regulator is optional, then a host
> driver need to take other actions to power on/off the card.

What are those actions? Just power up the card through some other
mean, or is it more tied to the MMC protocol?

Also, I'm wondering if VMMC is actually optional at all. In all cases
I can think of, it would be represented as a regulator anyway.

Thanks,
Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2016-10-18 11:48    [W:0.377 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site