Re: [PATCH 08/11 v3] ARM: pxa/pcamci: Delete platform data for CD/WP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Robert,

On Mon, Nov 26, 2018 at 9:37 PM Robert Jarzmik <robert.jarzmik@xxxxxxx> wrote:

> > -     if (machine_is_em_x270()) {
> > -             err = gpio_request(GPIO95_MMC_WP, "MMC WP");
> > -             if (err) {
> > -                     dev_err(dev, "can't request MMC write protect: %d\n",
> > -                             err);
> > -                     goto err_gpio_wp;
> > -             }
> > -             gpio_direction_input(GPIO95_MMC_WP);
> > -     } else {
> > +     if (!machine_is_em_x270()) {
>
> Euh why the "not" in the condition ?

Because since I am deleting the first arm of the if()
condition, this is the else {} clause, so since I am switching
an else for an if, I need to invert the condition.

> > +     if (!machine_is_em_x270())
> >               gpio_free(GPIO38_SD_PWEN);
>
> Ditto.

Same reason.

> > @@ -775,8 +775,6 @@ static struct pxamci_platform_data magician_mci_info = {
> >       .ocr_mask               = MMC_VDD_32_33|MMC_VDD_33_34,
> >       .init                   = magician_mci_init,
> >       .exit                   = magician_mci_exit,
> > -     .gpio_card_detect       = -1,
> > -     .gpio_card_ro           = EGPIO_MAGICIAN_nSD_READONLY,
> >       .gpio_card_ro_invert    = 1,
>
> Shouldn't the gpio_card_ro_invert be removed as well here ?

This has to be done later. The reason is that this is used in
to set up the inversion flag for the *host* from <mmc/host.h>:
#define MMC_CAP2_CD_ACTIVE_HIGH (1 << 10)       /* Card-detect signal
active high */
#define MMC_CAP2_RO_ACTIVE_HIGH (1 << 11)       /* Write-protect
signal active high */

If you think these flags are just adding to the confusion we
already have you are right, so in a follow-on patch series
I am trying to get rid of them.

In a way this host flag has no semantic effect after these
patches, but it is a different "technical step" so it needs
to be another patch.

Yours,
Linus Walleij



[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux