Linus Walleij <linus.walleij@xxxxxxxxxx> writes: Hi Linus, > static struct gpiod_lookup_table cmx270_mci_gpio_table = { > @@ -293,6 +291,8 @@ static struct gpiod_lookup_table cmx270_mci_gpio_table = { > .table = { > /* Card detect on GPIO 83 */ > GPIO_LOOKUP("gpio-pxa", 83, "cd", GPIO_ACTIVE_LOW), > + /* Power on GPIO 105 */ > + GPIO_LOOKUP("gpio-pxa", 105, "power", GPIO_ACTIVE_LOW), > { }, > }, > }; No magic numbers please. > static struct gpiod_lookup_table mioa701_mci_gpio_table = { > @@ -408,6 +407,8 @@ static struct gpiod_lookup_table mioa701_mci_gpio_table = { > GPIO_LOOKUP("gpio-pxa", 15, "cd", GPIO_ACTIVE_LOW), > /* Write protect on GPIO 78 */ > GPIO_LOOKUP("gpio-pxa", 78, "wp", GPIO_ACTIVE_LOW), > + /* Power on GPIO 91 */ > + GPIO_LOOKUP("gpio-pxa", 91, "power", GPIO_ACTIVE_HIGH), > { }, > }, > }; Ditto. > @@ -101,16 +102,13 @@ static inline int pxamci_set_power(struct pxamci_host *host, > { > struct mmc_host *mmc = host->mmc; > struct regulator *supply = mmc->supply.vmmc; > - int on; > > if (!IS_ERR(supply)) > return mmc_regulator_set_ocr(mmc, supply, vdd); > > - if (host->pdata && > - gpio_is_valid(host->pdata->gpio_power)) { > - on = ((1 << vdd) & host->pdata->ocr_mask); > - gpio_set_value(host->pdata->gpio_power, > - !!on ^ host->pdata->gpio_power_invert); > + if (host->power) { > + bool on = !!((1 << vdd) & host->pdata->ocr_mask); Ah a declaration within a block, not at a function begin ... I don't like that very much, but that's just a matter of taste. Cheers. -- Robert