Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 6451
b: refs/heads/master
c: b877b90
h: refs/heads/master
i:
  6449: dd9d7c9
  6447: fee89e2
v: v3
  • Loading branch information
Stephen Rothwell authored and Paul Mackerras committed Aug 30, 2005
1 parent c1187c8 commit 28f47b9
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5c0b4b8759f78c31172088a91e10733fc014ccee
refs/heads/master: b877b90f227fb9698d99fb70492d432362584082
15 changes: 11 additions & 4 deletions trunk/arch/ppc64/kernel/iSeries_vio.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,31 @@ static void __init iommu_vio_init(void)
}

/**
* vio_register_device: - Register a new vio device.
* vio_register_device_iseries: - Register a new iSeries vio device.
* @voidev: The device to register.
*/
static struct vio_dev *__init vio_register_device_iseries(char *type,
uint32_t unit_num)
{
struct vio_dev *viodev;

/* allocate a vio_dev for this node */
/* allocate a vio_dev for this device */
viodev = kmalloc(sizeof(struct vio_dev), GFP_KERNEL);
if (!viodev)
return NULL;
memset(viodev, 0, sizeof(struct vio_dev));

snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%s%d", type, unit_num);

return vio_register_device_common(viodev, viodev->dev.bus_id, type,
unit_num, &vio_iommu_table);
viodev->name = viodev->dev.bus_id;
viodev->type = type;
viodev->unit_address = unit_num;
viodev->iommu_table = &vio_iommu_table;
if (vio_register_device(viodev) == NULL) {
kfree(viodev);
return NULL;
}
return viodev;
}

void __init probe_bus_iseries(void)
Expand Down
9 changes: 6 additions & 3 deletions trunk/arch/ppc64/kernel/pSeries_vio.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/kobject.h>
#include <asm/iommu.h>
#include <asm/dma.h>
#include <asm/prom.h>
#include <asm/vio.h>
#include <asm/hvcall.h>

Expand Down Expand Up @@ -181,11 +182,13 @@ struct vio_dev * __devinit vio_register_device_node(struct device_node *of_node)
}

snprintf(viodev->dev.bus_id, BUS_ID_SIZE, "%x", *unit_address);
viodev->name = of_node->name;
viodev->type = of_node->type;
viodev->unit_address = *unit_address;
viodev->iommu_table = vio_build_iommu_table(viodev);

/* register with generic device framework */
if (vio_register_device_common(viodev, of_node->name, of_node->type,
*unit_address, vio_build_iommu_table(viodev))
== NULL) {
if (vio_register_device(viodev) == NULL) {
/* XXX free TCE table */
kfree(viodev);
return NULL;
Expand Down
8 changes: 1 addition & 7 deletions trunk/arch/ppc64/kernel/vio.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,8 @@ static ssize_t viodev_show_name(struct device *dev,
}
DEVICE_ATTR(name, S_IRUSR | S_IRGRP | S_IROTH, viodev_show_name, NULL);

struct vio_dev * __devinit vio_register_device_common(
struct vio_dev *viodev, char *name, char *type,
uint32_t unit_address, struct iommu_table *iommu_table)
struct vio_dev * __devinit vio_register_device(struct vio_dev *viodev)
{
viodev->name = name;
viodev->type = type;
viodev->unit_address = unit_address;
viodev->iommu_table = iommu_table;
/* init generic 'struct device' fields: */
viodev->dev.parent = &vio_bus_device.dev;
viodev->dev.bus = &vio_bus_type;
Expand Down
4 changes: 1 addition & 3 deletions trunk/include/asm-ppc64/vio.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ const void * vio_get_attribute(struct vio_dev *vdev, void* which, int* length);
int vio_get_irq(struct vio_dev *dev);
int vio_enable_interrupts(struct vio_dev *dev);
int vio_disable_interrupts(struct vio_dev *dev);
extern struct vio_dev * __devinit vio_register_device_common(
struct vio_dev *viodev, char *name, char *type,
uint32_t unit_address, struct iommu_table *iommu_table);
extern struct vio_dev * __devinit vio_register_device(struct vio_dev *viodev);

extern struct dma_mapping_ops vio_dma_ops;

Expand Down

0 comments on commit 28f47b9

Please sign in to comment.