qemu-arm
[Top][All Lists]
Advanced

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

Re: [Qemu-arm] [PATCH 03/10] hw/sd/sd.c: Convert sd_reset() function int


From: Peter Crosthwaite
Subject: Re: [Qemu-arm] [PATCH 03/10] hw/sd/sd.c: Convert sd_reset() function into Device reset method
Date: Sat, 19 Dec 2015 13:37:39 -0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Dec 11, 2015 at 04:37:04PM +0000, Peter Maydell wrote:
> Convert the sd_reset() function into a proper Device reset method.
> 
> Signed-off-by: Peter Maydell <address@hidden>

Reviewed-by: Peter Crosthwaite <address@hidden>

> ---
>  hw/sd/sd.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/sd/sd.c b/hw/sd/sd.c
> index 7c79217..b4a5a62 100644
> --- a/hw/sd/sd.c
> +++ b/hw/sd/sd.c
> @@ -393,8 +393,9 @@ static inline uint64_t sd_addr_to_wpnum(uint64_t addr)
>      return addr >> (HWBLOCK_SHIFT + SECTOR_SHIFT + WPGROUP_SHIFT);
>  }
>  
> -static void sd_reset(SDState *sd)
> +static void sd_reset(DeviceState *dev)
>  {
> +    SDState *sd = SD(dev);
>      uint64_t size;
>      uint64_t sect;
>  
> @@ -435,7 +436,7 @@ static void sd_cardchange(void *opaque, bool load)
>  
>      qemu_set_irq(sd->inserted_cb, blk_is_inserted(sd->blk));
>      if (blk_is_inserted(sd->blk)) {
> -        sd_reset(sd);
> +        sd_reset(DEVICE(sd));
>          qemu_set_irq(sd->readonly_cb, sd->wp_switch);
>      }
>  }
> @@ -677,7 +678,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd,
>  
>          default:
>              sd->state = sd_idle_state;
> -            sd_reset(sd);
> +            sd_reset(DEVICE(sd));
>              return sd->spi ? sd_r1 : sd_r0;
>          }
>          break;
> @@ -1783,8 +1784,6 @@ static void sd_realize(DeviceState *dev, Error ** errp)
>      if (sd->blk) {
>          blk_set_dev_ops(sd->blk, &sd_block_ops, sd);
>      }
> -
> -    sd_reset(sd);
>  }
>  
>  static Property sd_properties[] = {
> @@ -1804,6 +1803,7 @@ static void sd_class_init(ObjectClass *klass, void 
> *data)
>      dc->realize = sd_realize;
>      dc->props = sd_properties;
>      dc->vmsd = &sd_vmstate;
> +    dc->reset = sd_reset;
>  }
>  
>  static const TypeInfo sd_info = {
> -- 
> 1.9.1
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]