All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] cmd646: remove pci_cmd646_ide_init() function
@ 2020-03-01 19:05 Mark Cave-Ayland
  2020-03-01 19:05 ` [PATCH v2 1/2] dp264: use pci_create() to initialise the cmd646 device Mark Cave-Ayland
  2020-03-01 19:05 ` [PATCH v2 2/2] cmd646: remove unused pci_cmd646_ide_init() function Mark Cave-Ayland
  0 siblings, 2 replies; 5+ messages in thread
From: Mark Cave-Ayland @ 2020-03-01 19:05 UTC (permalink / raw)
  To: qemu-devel, rth, jsnow

The recent cmd646 discussions reminded me of this patch I've had sitting in an
old branch for a while.

The DP264 machine is the last remaining user of the deprecated
pci_cmd646_ide_init() init function. Switch it over to using qdev via pci_create()
and then remove the now-unused pci_cmd646_ide_init() function.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>

v2:
- Rebase onto master
- Remove setting "secondary" property to 0 for dp264 since this is already the default
- Add R-B tags from Richard


Mark Cave-Ayland (2):
  dp264: use pci_create() to initialise the cmd646 device
  cmd646: remove unused pci_cmd646_ide_init() function

 hw/alpha/dp264.c |  7 ++++++-
 hw/ide/cmd646.c  | 12 ------------
 include/hw/ide.h |  2 --
 3 files changed, 6 insertions(+), 15 deletions(-)

-- 
2.20.1



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] dp264: use pci_create() to initialise the cmd646 device
  2020-03-01 19:05 [PATCH v2 0/2] cmd646: remove pci_cmd646_ide_init() function Mark Cave-Ayland
@ 2020-03-01 19:05 ` Mark Cave-Ayland
  2020-03-01 21:34   ` BALATON Zoltan
  2020-03-01 19:05 ` [PATCH v2 2/2] cmd646: remove unused pci_cmd646_ide_init() function Mark Cave-Ayland
  1 sibling, 1 reply; 5+ messages in thread
From: Mark Cave-Ayland @ 2020-03-01 19:05 UTC (permalink / raw)
  To: qemu-devel, rth, jsnow

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));
+        pci_ide_create_devs(pci_dev, hd);
     }
 
     /* Load PALcode.  Given that this is not "real" cpu palcode,
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/2] cmd646: remove unused pci_cmd646_ide_init() function
  2020-03-01 19:05 [PATCH v2 0/2] cmd646: remove pci_cmd646_ide_init() function Mark Cave-Ayland
  2020-03-01 19:05 ` [PATCH v2 1/2] dp264: use pci_create() to initialise the cmd646 device Mark Cave-Ayland
@ 2020-03-01 19:05 ` Mark Cave-Ayland
  1 sibling, 0 replies; 5+ messages in thread
From: Mark Cave-Ayland @ 2020-03-01 19:05 UTC (permalink / raw)
  To: qemu-devel, rth, jsnow

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
---
 hw/ide/cmd646.c  | 12 ------------
 include/hw/ide.h |  2 --
 2 files changed, 14 deletions(-)

diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c
index 335c060673..d953932104 100644
--- a/hw/ide/cmd646.c
+++ b/hw/ide/cmd646.c
@@ -317,18 +317,6 @@ static void pci_cmd646_ide_exitfn(PCIDevice *dev)
     }
 }
 
-void pci_cmd646_ide_init(PCIBus *bus, DriveInfo **hd_table,
-                         int secondary_ide_enabled)
-{
-    PCIDevice *dev;
-
-    dev = pci_create(bus, -1, "cmd646-ide");
-    qdev_prop_set_uint32(&dev->qdev, "secondary", secondary_ide_enabled);
-    qdev_init_nofail(&dev->qdev);
-
-    pci_ide_create_devs(dev, hd_table);
-}
-
 static Property cmd646_ide_properties[] = {
     DEFINE_PROP_UINT32("secondary", PCIIDEState, secondary, 0),
     DEFINE_PROP_END_OF_LIST(),
diff --git a/include/hw/ide.h b/include/hw/ide.h
index 28d8a06439..0c7080ed92 100644
--- a/include/hw/ide.h
+++ b/include/hw/ide.h
@@ -12,8 +12,6 @@ ISADevice *isa_ide_init(ISABus *bus, int iobase, int iobase2, int isairq,
                         DriveInfo *hd0, DriveInfo *hd1);
 
 /* ide-pci.c */
-void pci_cmd646_ide_init(PCIBus *bus, DriveInfo **hd_table,
-                         int secondary_ide_enabled);
 PCIDevice *pci_piix3_xen_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn);
 PCIDevice *pci_piix3_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn);
 PCIDevice *pci_piix4_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn);
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/2] dp264: use pci_create() to initialise the cmd646 device
  2020-03-01 19:05 ` [PATCH v2 1/2] dp264: use pci_create() to initialise the cmd646 device Mark Cave-Ayland
@ 2020-03-01 21:34   ` BALATON Zoltan
  2020-03-02 13:39     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 5+ messages in thread
From: BALATON Zoltan @ 2020-03-01 21:34 UTC (permalink / raw)
  To: Mark Cave-Ayland; +Cc: jsnow, qemu-devel, rth

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,
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/2] dp264: use pci_create() to initialise the cmd646 device
  2020-03-01 21:34   ` BALATON Zoltan
@ 2020-03-02 13:39     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-03-02 13:39 UTC (permalink / raw)
  To: BALATON Zoltan, Mark Cave-Ayland; +Cc: jsnow, qemu-devel, rth

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,
>>
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-03-02 13:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-01 19:05 [PATCH v2 0/2] cmd646: remove pci_cmd646_ide_init() function Mark Cave-Ayland
2020-03-01 19:05 ` [PATCH v2 1/2] dp264: use pci_create() to initialise the cmd646 device Mark Cave-Ayland
2020-03-01 21:34   ` BALATON Zoltan
2020-03-02 13:39     ` Philippe Mathieu-Daudé
2020-03-01 19:05 ` [PATCH v2 2/2] cmd646: remove unused pci_cmd646_ide_init() function Mark Cave-Ayland

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.