Patchwork musicpal: Fix registration of MMIO-less sysbus devices

login
register
mail settings
Submitter Jan Kiszka
Date April 10, 2011, 7:35 a.m.
Message ID <4DA15DCE.3000206@web.de>
Download mbox | patch
Permalink /patch/90496/
State New
Headers show

Comments

Jan Kiszka - April 10, 2011, 7:35 a.m.
The proper way to signal that a sysbus devices need no MMIO region is to
pass -1 to sysbus_create_simple.

Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
---
 hw/musicpal.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Aurelien Jarno - April 10, 2011, 12:31 p.m.
On Sun, Apr 10, 2011 at 09:35:42AM +0200, Jan Kiszka wrote:
> The proper way to signal that a sysbus devices need no MMIO region is to
> pass -1 to sysbus_create_simple.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@web.de>
> ---
>  hw/musicpal.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)

Thanks, applied.

> diff --git a/hw/musicpal.c b/hw/musicpal.c
> index d98aa8d..52b2931 100644
> --- a/hw/musicpal.c
> +++ b/hw/musicpal.c
> @@ -1597,11 +1597,11 @@ static void musicpal_init(ram_addr_t ram_size,
>      musicpal_misc_init();
>  
>      dev = sysbus_create_simple("musicpal_gpio", MP_GPIO_BASE, pic[MP_GPIO_IRQ]);
> -    i2c_dev = sysbus_create_simple("gpio_i2c", 0, NULL);
> +    i2c_dev = sysbus_create_simple("gpio_i2c", -1, NULL);
>      i2c = (i2c_bus *)qdev_get_child_bus(i2c_dev, "i2c");
>  
>      lcd_dev = sysbus_create_simple("musicpal_lcd", MP_LCD_BASE, NULL);
> -    key_dev = sysbus_create_simple("musicpal_key", 0, NULL);
> +    key_dev = sysbus_create_simple("musicpal_key", -1, NULL);
>  
>      /* I2C read data */
>      qdev_connect_gpio_out(i2c_dev, 0,
> -- 
> 1.7.1
>

Patch

diff --git a/hw/musicpal.c b/hw/musicpal.c
index d98aa8d..52b2931 100644
--- a/hw/musicpal.c
+++ b/hw/musicpal.c
@@ -1597,11 +1597,11 @@  static void musicpal_init(ram_addr_t ram_size,
     musicpal_misc_init();
 
     dev = sysbus_create_simple("musicpal_gpio", MP_GPIO_BASE, pic[MP_GPIO_IRQ]);
-    i2c_dev = sysbus_create_simple("gpio_i2c", 0, NULL);
+    i2c_dev = sysbus_create_simple("gpio_i2c", -1, NULL);
     i2c = (i2c_bus *)qdev_get_child_bus(i2c_dev, "i2c");
 
     lcd_dev = sysbus_create_simple("musicpal_lcd", MP_LCD_BASE, NULL);
-    key_dev = sysbus_create_simple("musicpal_key", 0, NULL);
+    key_dev = sysbus_create_simple("musicpal_key", -1, NULL);
 
     /* I2C read data */
     qdev_connect_gpio_out(i2c_dev, 0,