qemu-e2k/hw/audio
Eduardo Habkost e90f2a8c3e qdev: Replace cannot_instantiate_with_device_add_yet with !user_creatable
cannot_instantiate_with_device_add_yet was introduced by commit
efec3dd631 to replace no_user. It was
supposed to be a temporary measure.

When it was introduced, we had 54
cannot_instantiate_with_device_add_yet=true lines in the code.
Today (3 years later) this number has not shrunk: we now have
57 cannot_instantiate_with_device_add_yet=true lines. I think it
is safe to say it is not a temporary measure, and we won't see
the flag go away soon.

Instead of a long field name that misleads people to believe it
is temporary, replace it a shorter and less misleading field:
user_creatable.

Except for code comments, changes were generated using the
following Coccinelle patch:

  @@
  expression DC;
  @@
  (
  -DC->cannot_instantiate_with_device_add_yet = false;
  +DC->user_creatable = true;
  |
  -DC->cannot_instantiate_with_device_add_yet = true;
  +DC->user_creatable = false;
  )

  @@
  typedef ObjectClass;
  expression dc;
  identifier class, data;
  @@
   static void device_class_init(ObjectClass *class, void *data)
   {
   ...
   dc->hotpluggable = true;
  +dc->user_creatable = true;
   ...
   }

  @@
  @@
   struct DeviceClass {
   ...
  -bool cannot_instantiate_with_device_add_yet;
  +bool user_creatable;
   ...
  }

  @@
  expression DC;
  @@
  (
  -!DC->cannot_instantiate_with_device_add_yet
  +DC->user_creatable
  |
  -DC->cannot_instantiate_with_device_add_yet
  +!DC->user_creatable
  )

Cc: Alistair Francis <alistair.francis@xilinx.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Thomas Huth <thuth@redhat.com>
Acked-by: Alistair Francis <alistair.francis@xilinx.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Acked-by: Marcel Apfelbaum <marcel@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20170503203604.31462-2-ehabkost@redhat.com>
[ehabkost: kept "TODO remove once we're there" comment]
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2017-05-17 10:37:00 -03:00
..
ac97.c audio: ac97: add exit function 2017-01-11 09:19:03 +01:00
adlib.c audio: Remove type field 2017-05-04 09:16:04 +02:00
cs4231.c hw/audio: QOM'ify cs4231.c 2016-06-03 11:13:38 +02:00
cs4231a.c cs4231a: use IsaDma interface instead of global DMA_* functions 2016-02-03 11:28:58 -05:00
es1370.c es1370: wire up reset via DeviceClass 2017-01-11 09:19:03 +01:00
fmopl.c audio: Use ARRAY_SIZE from qemu/osdep.h 2017-05-04 09:16:05 +02:00
fmopl.h audio: un-export OPLResetChip 2017-05-04 09:16:05 +02:00
gus.c audio: GUSsample is int16_t 2017-05-04 09:16:05 +02:00
gusemu_hal.c audio: GUSsample is int16_t 2017-05-04 09:16:05 +02:00
gusemu_mixer.c audio: GUSsample is int16_t 2017-05-04 09:16:05 +02:00
gusemu.h audio: GUSsample is int16_t 2017-05-04 09:16:05 +02:00
gustate.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
hda-codec-common.h
hda-codec.c hw/audio: convert exit callback in HDACodecDeviceClass to void 2017-05-04 08:29:01 +02:00
intel-hda-defs.h
intel-hda.c hw/audio: replace exit with unrealize in hda_codec_device_class_init 2017-05-04 08:29:01 +02:00
intel-hda.h hw/audio: convert exit callback in HDACodecDeviceClass to void 2017-05-04 08:29:01 +02:00
lm4549.c audio: Clean up includes 2016-02-02 13:57:31 +01:00
lm4549.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
Makefile.objs audio: remove Y8950 configuration 2017-05-04 09:16:03 +02:00
marvell_88w8618.c qdev: Replace cannot_instantiate_with_device_add_yet with !user_creatable 2017-05-17 10:37:00 -03:00
milkymist-ac97.c milkymist: update specification URLs 2016-06-20 18:12:04 +02:00
pcspk.c qdev: Replace cannot_instantiate_with_device_add_yet with !user_creatable 2017-05-17 10:37:00 -03:00
pl041.c hw/audio: QOM'ify pl041.c 2017-01-11 09:19:03 +01:00
pl041.h Clean up decorations and whitespace around header guards 2016-07-12 16:20:46 +02:00
pl041.hx
sb16.c portio: keep references on portio 2016-09-08 18:05:21 +04:00
trace-events trace-events: fix first line comment in trace-events 2016-08-12 10:36:01 +01:00
wm8750.c i2c: Allow I2C devices to NAK start events 2017-01-09 11:40:20 +00:00