[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH V2 06/10] hw/sd.c: convert to QOM object
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH V2 06/10] hw/sd.c: convert to QOM object |
Date: |
Wed, 11 Apr 2012 14:17:24 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120312 Thunderbird/11.0 |
Am 11.04.2012 13:14, schrieb Igor Mitsyanko:
>
>
> On 04/11/2012 02:26 PM, Peter Maydell wrote:
>> On 5 April 2012 16:48, Igor Mitsyanko<address@hidden> wrote:
>>> A straightforward conversion of SD card implementation to a proper
>>> QEMU object.
>>>
>>> Signed-off-by: Igor Mitsyanko<address@hidden>
>>> ---
>>> hw/milkymist-memcard.c | 24 ++++++++++++++----------
>>> hw/omap_mmc.c | 28 ++++++++++++++++------------
>>> hw/pl181.c | 14 ++++++++------
>>> hw/pxa2xx_mmci.c | 22 ++++++++++++++--------
>>> hw/sd.c | 48
>>> +++++++++++++++++++++++++++++++++++++-----------
>>> hw/sd.h | 38 ++++++++++++++++++++++++++++++--------
>>> hw/ssi-sd.c | 11 ++++++-----
>>> 7 files changed, 125 insertions(+), 60 deletions(-)
>>>
>>> diff --git a/hw/milkymist-memcard.c b/hw/milkymist-memcard.c
>>> index 3515c3c..1d84d44 100644
>>> --- a/hw/milkymist-memcard.c
>>> +++ b/hw/milkymist-memcard.c
>>> @@ -97,7 +97,7 @@ static void
>>> memcard_sd_command(MilkymistMemcardState *s)
>>> req.crc = s->command[5];
>>>
>>> s->response[0] = req.cmd;
>>> - s->response_len = sd_do_command(s->card,&req, s->response+1);
>>> + s->response_len = SD_DO_COMMAND(s->card,&req, s->response + 1);
>> Does our object model really demand this kind of conversion to all-caps?
>> Seems kind of ugly and churny :-(
> I think it doesn't, it's just a response to Paolo's request to replace
> SD_GET_CLASS(s->card)->do_command(s->card, &req, s->response + 1) with
> something
> not so long.
Just do that as implementation detail in sd_do_command(). No need to
change the call sites then. :)
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
- [Qemu-devel] [PATCH V2 10/10] hw/sd.c: introduce SD card "image" property and allow SD hot-insert, (continued)
[Qemu-devel] [PATCH V2 08/10] SD card: introduce "spi_mode" property for SD card objects, Igor Mitsyanko, 2012/04/05
[Qemu-devel] [PATCH V2 06/10] hw/sd.c: convert to QOM object, Igor Mitsyanko, 2012/04/05
[Qemu-devel] [PATCH V2 02/10] hw/sd.c: convert binary variables to bool, Igor Mitsyanko, 2012/04/05
[Qemu-devel] [PATCH V2 04/10] hw/sd.c: make sd_wp_addr() return bool, Igor Mitsyanko, 2012/04/05
[Qemu-devel] [PATCH V2 09/10] SD card: make SD card a child of host controller, Igor Mitsyanko, 2012/04/05