[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 12/13] hw/gpio/bcm2835_gpio: Isolate sdbus reparenting
From: |
Peter Maydell |
Subject: |
Re: [PATCH v5 12/13] hw/gpio/bcm2835_gpio: Isolate sdbus reparenting |
Date: |
Fri, 29 Nov 2019 19:05:46 +0000 |
On Fri, 18 Oct 2019 at 16:07, Damien Hedde <address@hidden> wrote:
>
> Split gpfsel_set() in 2 so that the sdbus reparenting is done
> in a dedicated function.
>
> Signed-off-by: Damien Hedde <address@hidden>
> ---
> Cc: Peter Maydell <address@hidden>
> Cc: Andrew Baumann <address@hidden>
> Cc: Philippe Mathieu-Daudé <address@hidden>
> Cc: address@hidden
> ---
> hw/gpio/bcm2835_gpio.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/hw/gpio/bcm2835_gpio.c b/hw/gpio/bcm2835_gpio.c
> index 91ce3d10cc..81fe07132f 100644
> --- a/hw/gpio/bcm2835_gpio.c
> +++ b/hw/gpio/bcm2835_gpio.c
> @@ -75,7 +75,10 @@ static void gpfsel_set(BCM2835GpioState *s, uint8_t reg,
> uint32_t value)
> s->fsel[index] = fsel;
> }
> }
> +}
>
> +static void gpfsel_update_sdbus(BCM2835GpioState *s)
> +{
> /* SD controller selection (48-53) */
> if (s->sd_fsel != 0
> && (s->fsel[48] == 0) /* SD_CLK_R */
> @@ -86,6 +89,7 @@ static void gpfsel_set(BCM2835GpioState *s, uint8_t reg,
> uint32_t value)
> && (s->fsel[53] == 0) /* SD_DATA3_R */
> ) {
> /* SDHCI controller selected */
> + sdbus_reparent_card(&s->sdbus, s->sdbus_sdhci);
> sdbus_reparent_card(s->sdbus_sdhost, s->sdbus_sdhci);
> s->sd_fsel = 0;> } else if (s->sd_fsel != 4
> @@ -97,6 +101,7 @@ static void gpfsel_set(BCM2835GpioState *s, uint8_t reg,
> uint32_t value)
> && (s->fsel[53] == 4) /* SD_DATA3_R */
> ) {
> /* SDHost controller selected */
> + sdbus_reparent_card(&s->sdbus, s->sdbus_sdhost);
> sdbus_reparent_card(s->sdbus_sdhci, s->sdbus_sdhost);
The commit message says it's just splitting the function in two,
but these two hunks are adding extra calls to sdbus_reparent_card().
Why do we need to call it twice ?
> s->sd_fsel = 4;
> }
thanks
-- PMM
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH v5 12/13] hw/gpio/bcm2835_gpio: Isolate sdbus reparenting,
Peter Maydell <=