All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Liviu Ionescu <ilg@livius.net>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Peter Crosthwaite <peter.crosthwaite@xilinx.com>,
	QEMU Developers <Qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [RFC] QDev explicit constructors & destructors
Date: Wed, 24 Jun 2015 15:50:43 +0200	[thread overview]
Message-ID: <558AB5B3.7080005@suse.de> (raw)
In-Reply-To: <04BD2F65-DACC-4865-9C16-2936F84220FD@livius.net>

Am 24.06.2015 um 11:29 schrieb Liviu Ionescu:
> the machine init code now looks like this:
> 
> static void stm32_h103_board_init_callback(MachineState *machine)
> {
>     cm_board_greeting(machine);
> 
>     {
>         /* Create the MCU */
>         DeviceState *mcu = cm_create(TYPE_STM32F103RB);
> 
>         qdev_prop_set_ptr(mcu, "machine", machine);
> 
>         /* Set the board specific oscillator frequencies. */
>         qdev_prop_set_uint32(mcu, "hse-freq-hz", 8000000); /* 8.0 MHz */
>         qdev_prop_set_uint32(mcu, "lse-freq-hz", 32768); /* 32 KHz */
> 
>         cm_realize(mcu);
>     }
> 
>     {
>         /* Create the board LED */
>         DeviceState *led = cm_create(TYPE_GPIO_LED);
> 
>         /* STM32-H103 Green LED, GPIOC[12], active low */
>         qdev_prop_set_bit(led, "active-low", true);
>         qdev_prop_set_string(led, "on-message", "[Green LED On]\n");
>         qdev_prop_set_string(led, "off-message", "[Green LED Off]\n");
> 
>         gpio_led_connect(led, "/machine/stm32/gpio[c]", 12);
> 
>         cm_realize(led);
>     }
> }
> 
> I hope it is better now.

You're still doing the {...} thing I asked you not to do.

static ...
{
    DeviceState *mcu, *led;

    mcu = ...
    ...

    led = ...
    ...
}

Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton; HRB
21284 (AG Nürnberg)

  parent reply	other threads:[~2015-06-24 13:50 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-15 10:48 [Qemu-devel] [RFC] QDev explicit constructors & destructors Liviu Ionescu
2015-06-15 11:13 ` Liviu Ionescu
2015-06-15 13:35 ` Liviu Ionescu
2015-06-22 20:48   ` Liviu Ionescu
2015-06-23  7:47     ` Markus Armbruster
2015-06-23  9:12       ` Liviu Ionescu
2015-06-23 10:39   ` Andreas Färber
2015-06-23 12:58     ` Liviu Ionescu
2015-06-23 14:25       ` Andreas Färber
2015-06-23 16:15         ` Liviu Ionescu
2015-06-23 18:31         ` Peter Crosthwaite
2015-06-23 19:10           ` Liviu Ionescu
2015-06-23 20:57             ` Peter Crosthwaite
2015-06-23 21:24               ` Liviu Ionescu
2015-06-23 19:27           ` Andreas Färber
2015-06-23 20:10           ` Liviu Ionescu
2015-06-24  7:30             ` Liviu Ionescu
2015-06-24  8:29               ` Peter Crosthwaite
2015-06-24  9:29                 ` Liviu Ionescu
2015-06-24  9:51                   ` Paolo Bonzini
2015-06-24 13:41                     ` Andreas Färber
2015-06-24 13:50                   ` Andreas Färber [this message]
2015-06-24 14:11                     ` Liviu Ionescu
2015-06-24 14:18                       ` Andreas Färber
2015-06-24 14:39                         ` Liviu Ionescu
2015-06-24 14:41                           ` Andreas Färber
2015-06-24 20:14                       ` Liviu Ionescu
2015-06-24  8:51             ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=558AB5B3.7080005@suse.de \
    --to=afaerber@suse.de \
    --cc=Qemu-devel@nongnu.org \
    --cc=ilg@livius.net \
    --cc=pbonzini@redhat.com \
    --cc=peter.crosthwaite@xilinx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.