diff mbox series

[v2,1/2] dp264: use pci_create() to initialise the cmd646 device

Message ID 20200301190520.18520-2-mark.cave-ayland@ilande.co.uk
State New
Headers show
Series cmd646: remove pci_cmd646_ide_init() function | expand

Commit Message

Mark Cave-Ayland March 1, 2020, 7:05 p.m. UTC
Remove the call to pci_cmd646_ide_init() since global device init functions
are deprecated in preference of using qdev directly.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 hw/alpha/dp264.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

BALATON Zoltan March 1, 2020, 9:34 p.m. UTC | #1
On Sun, 1 Mar 2020, Mark Cave-Ayland wrote:
> Remove the call to pci_cmd646_ide_init() since global device init functions
> are deprecated in preference of using qdev directly.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> hw/alpha/dp264.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
> index 8d71a30617..50e75aeee3 100644
> --- a/hw/alpha/dp264.c
> +++ b/hw/alpha/dp264.c
> @@ -16,6 +16,7 @@
> #include "sysemu/sysemu.h"
> #include "hw/rtc/mc146818rtc.h"
> #include "hw/ide.h"
> +#include "hw/ide/pci.h"
> #include "hw/timer/i8254.h"
> #include "hw/isa/superio.h"
> #include "hw/dma/i8257.h"
> @@ -100,9 +101,13 @@ static void clipper_init(MachineState *machine)
>     /* IDE disk setup.  */
>     {
>         DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
> +        PCIDevice *pci_dev;
> +
>         ide_drive_get(hd, ARRAY_SIZE(hd));
>
> -        pci_cmd646_ide_init(pci_bus, hd, 0);
> +        pci_dev = pci_create(pci_bus, -1, "cmd646-ide");
> +        qdev_init_nofail(DEVICE(pci_dev));

You could just use pci_create_simple here now that you don't set 
properties.

Regards,
BALATON Zoltan

> +        pci_ide_create_devs(pci_dev, hd);
>     }
>
>     /* Load PALcode.  Given that this is not "real" cpu palcode,
>
Philippe Mathieu-Daudé March 2, 2020, 1:39 p.m. UTC | #2
On 3/1/20 10:34 PM, BALATON Zoltan wrote:
> On Sun, 1 Mar 2020, Mark Cave-Ayland wrote:
>> Remove the call to pci_cmd646_ide_init() since global device init 
>> functions
>> are deprecated in preference of using qdev directly.
>>
>> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
>> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
>> ---
>> hw/alpha/dp264.c | 7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
>> index 8d71a30617..50e75aeee3 100644
>> --- a/hw/alpha/dp264.c
>> +++ b/hw/alpha/dp264.c
>> @@ -16,6 +16,7 @@
>> #include "sysemu/sysemu.h"
>> #include "hw/rtc/mc146818rtc.h"
>> #include "hw/ide.h"
>> +#include "hw/ide/pci.h"
>> #include "hw/timer/i8254.h"
>> #include "hw/isa/superio.h"
>> #include "hw/dma/i8257.h"
>> @@ -100,9 +101,13 @@ static void clipper_init(MachineState *machine)
>>     /* IDE disk setup.  */
>>     {
>>         DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
>> +        PCIDevice *pci_dev;
>> +
>>         ide_drive_get(hd, ARRAY_SIZE(hd));
>>
>> -        pci_cmd646_ide_init(pci_bus, hd, 0);
>> +        pci_dev = pci_create(pci_bus, -1, "cmd646-ide");
>> +        qdev_init_nofail(DEVICE(pci_dev));
> 
> You could just use pci_create_simple here now that you don't set 
> properties.

Can be added as a patch on top, either ways:

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> 
> Regards,
> BALATON Zoltan
> 
>> +        pci_ide_create_devs(pci_dev, hd);
>>     }
>>
>>     /* Load PALcode.  Given that this is not "real" cpu palcode,
>>
>
diff mbox series

Patch

diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
index 8d71a30617..50e75aeee3 100644
--- a/hw/alpha/dp264.c
+++ b/hw/alpha/dp264.c
@@ -16,6 +16,7 @@ 
 #include "sysemu/sysemu.h"
 #include "hw/rtc/mc146818rtc.h"
 #include "hw/ide.h"
+#include "hw/ide/pci.h"
 #include "hw/timer/i8254.h"
 #include "hw/isa/superio.h"
 #include "hw/dma/i8257.h"
@@ -100,9 +101,13 @@  static void clipper_init(MachineState *machine)
     /* IDE disk setup.  */
     {
         DriveInfo *hd[MAX_IDE_BUS * MAX_IDE_DEVS];
+        PCIDevice *pci_dev;
+
         ide_drive_get(hd, ARRAY_SIZE(hd));
 
-        pci_cmd646_ide_init(pci_bus, hd, 0);
+        pci_dev = pci_create(pci_bus, -1, "cmd646-ide");
+        qdev_init_nofail(DEVICE(pci_dev));
+        pci_ide_create_devs(pci_dev, hd);
     }
 
     /* Load PALcode.  Given that this is not "real" cpu palcode,