Skip to content

Commit

Permalink
Un-inline fdctrl_init_isa()
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Anthony Liguori <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
  • Loading branch information
Markus Armbruster authored and kevmw committed Jun 15, 2012
1 parent 8aab031 commit dfc65f1
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 25 deletions.
20 changes: 20 additions & 0 deletions hw/fdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1888,6 +1888,26 @@ static int fdctrl_connect_drives(FDCtrl *fdctrl)
return 0;
}

ISADevice *fdctrl_init_isa(ISABus *bus, DriveInfo **fds)
{
ISADevice *dev;

dev = isa_try_create(bus, "isa-fdc");
if (!dev) {
return NULL;
}

if (fds[0]) {
qdev_prop_set_drive_nofail(&dev->qdev, "driveA", fds[0]->bdrv);
}
if (fds[1]) {
qdev_prop_set_drive_nofail(&dev->qdev, "driveB", fds[1]->bdrv);
}
qdev_init_nofail(&dev->qdev);

return dev;
}

void fdctrl_init_sysbus(qemu_irq irq, int dma_chann,
target_phys_addr_t mmio_base, DriveInfo **fds)
{
Expand Down
24 changes: 2 additions & 22 deletions hw/fdc.h
Original file line number Diff line number Diff line change
@@ -1,32 +1,12 @@
#ifndef HW_FDC_H
#define HW_FDC_H

#include "isa.h"
#include "blockdev.h"
#include "qemu-common.h"

/* fdc.c */
#define MAX_FD 2

static inline ISADevice *fdctrl_init_isa(ISABus *bus, DriveInfo **fds)
{
ISADevice *dev;

dev = isa_try_create(bus, "isa-fdc");
if (!dev) {
return NULL;
}

if (fds[0]) {
qdev_prop_set_drive_nofail(&dev->qdev, "driveA", fds[0]->bdrv);
}
if (fds[1]) {
qdev_prop_set_drive_nofail(&dev->qdev, "driveB", fds[1]->bdrv);
}
qdev_init_nofail(&dev->qdev);

return dev;
}

ISADevice *fdctrl_init_isa(ISABus *bus, DriveInfo **fds);
void fdctrl_init_sysbus(qemu_irq irq, int dma_chann,
target_phys_addr_t mmio_base, DriveInfo **fds);
void sun4m_fdctrl_init(qemu_irq irq, target_phys_addr_t io_base,
Expand Down
3 changes: 2 additions & 1 deletion hw/ide/piix.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

#include <hw/hw.h>
#include <hw/pc.h>
#include <hw/pci.h>
#include <hw/isa.h>
#include "block.h"
#include "blockdev.h"
#include "sysemu.h"
#include "dma.h"

Expand Down
2 changes: 0 additions & 2 deletions hw/isa.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

#define ISA_NUM_IRQS 16

typedef struct ISADevice ISADevice;

#define TYPE_ISA_DEVICE "isa-device"
#define ISA_DEVICE(obj) \
OBJECT_CHECK(ISADevice, (obj), TYPE_ISA_DEVICE)
Expand Down
1 change: 1 addition & 0 deletions hw/pc_sysfw.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
* THE SOFTWARE.
*/

#include "blockdev.h"
#include "sysbus.h"
#include "hw.h"
#include "pc.h"
Expand Down
1 change: 1 addition & 0 deletions qemu-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ typedef struct VLANState VLANState;
typedef struct VLANClientState VLANClientState;
typedef struct i2c_bus i2c_bus;
typedef struct ISABus ISABus;
typedef struct ISADevice ISADevice;
typedef struct SMBusDevice SMBusDevice;
typedef struct PCIHostState PCIHostState;
typedef struct PCIExpressHost PCIExpressHost;
Expand Down

0 comments on commit dfc65f1

Please sign in to comment.