]> err.no Git - linux-2.6/commitdiff
[PATCH] powerpc: use a common vio_match_device routine
authorStephen Rothwell <sfr@canb.auug.org.au>
Thu, 27 Apr 2006 07:21:46 +0000 (17:21 +1000)
committerPaul Mackerras <paulus@samba.org>
Sat, 29 Apr 2006 08:02:01 +0000 (18:02 +1000)
This requires the compatible properties having vaules that are empty
strings instead of just being empty properties.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/vio.c
arch/powerpc/platforms/iseries/setup.c
arch/powerpc/platforms/iseries/vio.c
arch/powerpc/platforms/pseries/vio.c
include/asm-powerpc/vio.h

index 9b46eed5e63700bfafc80861db1672098787d1f3..19529297a2dca7c827b64dddda6f94912b460c17 100644 (file)
@@ -47,7 +47,8 @@ static const struct vio_device_id *vio_match_device(
                const struct vio_device_id *ids, const struct vio_dev *dev)
 {
        while (ids->type[0] != '\0') {
-               if (vio_bus_ops.match(ids, dev))
+               if ((strncmp(dev->type, ids->type, strlen(ids->type)) == 0) &&
+                   device_is_compatible(dev->dev.platform_data, ids->compat))
                        return ids;
                ids++;
        }
index 901acbcc088850b70615671b54e1c87e9644c1e1..befd36af7e32ada241b5ed9ffdf7624f2df21423 100644 (file)
@@ -927,7 +927,7 @@ void dt_vdevices(struct iseries_flat_dt *dt)
        snprintf(buf, sizeof(buf), "viocons@%08x", reg);
        dt_start_node(dt, buf);
        dt_prop_str(dt, "device_type", "serial");
-       dt_prop_empty(dt, "compatible");
+       dt_prop_str(dt, "compatible", "");
        dt_prop_u32(dt, "reg", reg);
        dt_end_node(dt);
        reg++;
@@ -949,7 +949,7 @@ void dt_vdevices(struct iseries_flat_dt *dt)
                snprintf(buf, 32, "vlan@%08x", reg + i);
                dt_start_node(dt, buf);
                dt_prop_str(dt, "device_type", "vlan");
-               dt_prop_empty(dt, "compatible");
+               dt_prop_str(dt, "compatible", "");
                dt_prop_u32(dt, "reg", reg + i);
                dt_prop_u32(dt, "linux,unit_address", i);
 
@@ -970,7 +970,7 @@ void dt_vdevices(struct iseries_flat_dt *dt)
                snprintf(buf, 32, "viodasd@%08x", reg + i);
                dt_start_node(dt, buf);
                dt_prop_str(dt, "device_type", "viodasd");
-               dt_prop_empty(dt, "compatible");
+               dt_prop_str(dt, "compatible", "");
                dt_prop_u32(dt, "reg", reg + i);
                dt_prop_u32(dt, "linux,unit_address", i);
                dt_end_node(dt);
@@ -980,7 +980,7 @@ void dt_vdevices(struct iseries_flat_dt *dt)
                snprintf(buf, 32, "viocd@%08x", reg + i);
                dt_start_node(dt, buf);
                dt_prop_str(dt, "device_type", "viocd");
-               dt_prop_empty(dt, "compatible");
+               dt_prop_str(dt, "compatible", "");
                dt_prop_u32(dt, "reg", reg + i);
                dt_prop_u32(dt, "linux,unit_address", i);
                dt_end_node(dt);
@@ -990,7 +990,7 @@ void dt_vdevices(struct iseries_flat_dt *dt)
                snprintf(buf, 32, "viotape@%08x", reg + i);
                dt_start_node(dt, buf);
                dt_prop_str(dt, "device_type", "viotape");
-               dt_prop_empty(dt, "compatible");
+               dt_prop_str(dt, "compatible", "");
                dt_prop_u32(dt, "reg", reg + i);
                dt_prop_u32(dt, "linux,unit_address", i);
                dt_end_node(dt);
index a689da6f2b076de10d7cefc7eb270647cf5e79ef..bdd2b7d97d15df209764197cd6acfc2b99c47ec8 100644 (file)
@@ -50,18 +50,7 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
        return &vio_iommu_table;
 }
 
-/**
- * vio_match_device_iseries: - Tell if a iSeries VIO device matches a
- *     vio_device_id
- */
-static int vio_match_device_iseries(const struct vio_device_id *id,
-               const struct vio_dev *dev)
-{
-       return strncmp(dev->type, id->type, strlen(id->type)) == 0;
-}
-
 static struct vio_bus_ops vio_bus_ops_iseries = {
-       .match = vio_match_device_iseries,
        .build_iommu_table = vio_build_iommu_table,
 };
 
@@ -75,5 +64,4 @@ static int __init vio_bus_init_iseries(void)
        iSeries_vio_dev = &vio_bus_device.dev;
        return vio_bus_init(&vio_bus_ops_iseries);
 }
-
 __initcall(vio_bus_init_iseries);
index b3925aefdac666fad6e68110ee336d4b8cf5c5e9..d2891661d87b11647ee5b99f91f2bee4f29e6703 100644 (file)
 
 extern struct subsystem devices_subsys; /* needed for vio_find_name() */
 
-/**
- * vio_match_device_pseries: - Tell if a pSeries VIO device matches a
- *     vio_device_id
- */
-static int vio_match_device_pseries(const struct vio_device_id *id,
-               const struct vio_dev *dev)
-{
-       return (strncmp(dev->type, id->type, strlen(id->type)) == 0) &&
-                       device_is_compatible(dev->dev.platform_data, id->compat);
-}
-
 /**
  * vio_build_iommu_table: - gets the dma information from OF and
  *     builds the TCE tree.
@@ -76,7 +65,6 @@ static struct iommu_table *vio_build_iommu_table(struct vio_dev *dev)
 }
 
 static struct vio_bus_ops vio_bus_ops_pseries = {
-       .match = vio_match_device_pseries,
        .build_iommu_table = vio_build_iommu_table,
 };
 
index 0055d8e6102d114ccee6938283fb5c45c6a42fa0..9c09a8ffa128a93ccb4a0bf17a9db7944663ea8d 100644 (file)
@@ -65,7 +65,6 @@ struct vio_driver {
 };
 
 struct vio_bus_ops {
-       int (*match)(const struct vio_device_id *id, const struct vio_dev *dev);
        struct iommu_table *(*build_iommu_table)(struct vio_dev *dev);
 };