[v4,20/20] audio: set default value for pcspk.iobase property
diff mbox series

Message ID 20200624113026.13343-21-kraxel@redhat.com
State New
Headers show
Series
  • audio: deprecate -soundhw
Related show

Commit Message

Gerd Hoffmann June 24, 2020, 11:30 a.m. UTC
Allows to drop the explicit qdev_prop_set_uint32 call in pcspk_init.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/hw/audio/pcspk.h | 6 +-----
 hw/audio/pcspk.c         | 2 +-
 2 files changed, 2 insertions(+), 6 deletions(-)

Comments

Eric Blake June 24, 2020, 12:26 p.m. UTC | #1
On 6/24/20 6:30 AM, Gerd Hoffmann wrote:
> Allows to drop the explicit qdev_prop_set_uint32 call in pcspk_init.

"allows to $verb" is not idiomatic, better is "allows ${verb}ing" 
[Allows dropping] or "allows $subject to $verb" [Allows us to drop].

> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>   include/hw/audio/pcspk.h | 6 +-----
>   hw/audio/pcspk.c         | 2 +-
>   2 files changed, 2 insertions(+), 6 deletions(-)
>

Patch
diff mbox series

diff --git a/include/hw/audio/pcspk.h b/include/hw/audio/pcspk.h
index 8b485602675f..06cba00b8376 100644
--- a/include/hw/audio/pcspk.h
+++ b/include/hw/audio/pcspk.h
@@ -33,11 +33,7 @@ 
 
 static inline void pcspk_init(ISADevice *isadev, ISABus *bus, ISADevice *pit)
 {
-    DeviceState *dev;
-
-    dev = DEVICE(isadev);
-    qdev_prop_set_uint32(dev, "iobase", 0x61);
-    object_property_set_link(OBJECT(dev), OBJECT(pit), "pit", NULL);
+    object_property_set_link(OBJECT(isadev), OBJECT(pit), "pit", NULL);
     isa_realize_and_unref(isadev, bus, &error_fatal);
 }
 
diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c
index 4c7e339ac2b5..ea539e7605a8 100644
--- a/hw/audio/pcspk.c
+++ b/hw/audio/pcspk.c
@@ -219,7 +219,7 @@  static const VMStateDescription vmstate_spk = {
 
 static Property pcspk_properties[] = {
     DEFINE_AUDIO_PROPERTIES(PCSpkState, card),
-    DEFINE_PROP_UINT32("iobase", PCSpkState, iobase,  -1),
+    DEFINE_PROP_UINT32("iobase", PCSpkState, iobase,  0x61),
     DEFINE_PROP_BOOL("migrate", PCSpkState, migrate,  true),
     DEFINE_PROP_END_OF_LIST(),
 };