From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: John Snow <jsnow@redhat.com>,
QEMU Developers <qemu-devel@nongnu.org>,
Richard Henderson <rth@twiddle.net>
Subject: Re: [PATCH 1/2] dp264: use pci_create() to initialise the cmd646 device
Date: Fri, 14 Feb 2020 19:16:13 +0000 [thread overview]
Message-ID: <c0b7cbcc-78b0-0e86-5cd5-5a011a4afd68@ilande.co.uk> (raw)
In-Reply-To: <CAP+75-X1pbKfG8+17Zif-ZsQNbFk34_AzVWy=U_Hr+Rz7=pgOA@mail.gmail.com>
On 14/02/2020 11:47, Philippe Mathieu-Daudé wrote:
> Hi Mark,
>
> On Fri, Feb 14, 2020 at 9:48 AM Mark Cave-Ayland
> <mark.cave-ayland@ilande.co.uk> 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>
>> ---
>> hw/alpha/dp264.c | 8 +++++++-
>> 1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/hw/alpha/dp264.c b/hw/alpha/dp264.c
>> index a8f9a89cc4..e91989bf9a 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,14 @@ 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");
>
> Not this patch problem, but it would be nice to have a TYPE_CMD646_IDE.
Yeah - there are quite a few places where this could be improved, but certainly a
patch for another day.
>> + qdev_prop_set_uint32(DEVICE(pci_dev), "secondary", 0);
>
> Secondary_ide disabled is the default in cmd646_ide_properties[], can
> we avoid this call?
Sure. The patch in its current form is a very simple like-for-like conversion, but it
can be easily be removed.
If we're going to do this then another thing to consider is if we want to replace the
-1 in pci_create() with a specific PCI_DEVFN value to make things a bit more robust.
ATB,
Mark.
next prev parent reply other threads:[~2020-02-14 19:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-14 8:46 [PATCH 0/2] cmd646: remove pci_cmd646_ide_init() function Mark Cave-Ayland
2020-02-14 8:46 ` [PATCH 1/2] dp264: use pci_create() to initialise the cmd646 device Mark Cave-Ayland
2020-02-14 11:47 ` Philippe Mathieu-Daudé
2020-02-14 19:16 ` Mark Cave-Ayland [this message]
2020-02-16 9:31 ` Richard Henderson
2020-02-14 8:46 ` [PATCH 2/2] cmd646: remove unused pci_cmd646_ide_init() function Mark Cave-Ayland
2020-02-16 9:31 ` Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c0b7cbcc-78b0-0e86-5cd5-5a011a4afd68@ilande.co.uk \
--to=mark.cave-ayland@ilande.co.uk \
--cc=jsnow@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).