]> Git Repo - J-linux.git/blobdiff - drivers/fpga/fpga-bridge.c
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
[J-linux.git] / drivers / fpga / fpga-bridge.c
index 80bd8f1b2aa60fc06b8f132898105fab9c14c939..2deccacc3aa759ad8dc3761d404a38cceb1034e0 100644 (file)
@@ -19,11 +19,6 @@ static struct class *fpga_bridge_class;
 /* Lock for adding/removing bridges to linked lists*/
 static spinlock_t bridge_list_lock;
 
-static int fpga_bridge_of_node_match(struct device *dev, const void *data)
-{
-       return dev->of_node == data;
-}
-
 /**
  * fpga_bridge_enable - Enable transactions on the bridge
  *
@@ -104,8 +99,7 @@ struct fpga_bridge *of_fpga_bridge_get(struct device_node *np,
 {
        struct device *dev;
 
-       dev = class_find_device(fpga_bridge_class, NULL, np,
-                               fpga_bridge_of_node_match);
+       dev = class_find_device_by_of_node(fpga_bridge_class, np);
        if (!dev)
                return ERR_PTR(-ENODEV);
 
@@ -334,7 +328,7 @@ struct fpga_bridge *fpga_bridge_create(struct device *dev, const char *name,
                                       void *priv)
 {
        struct fpga_bridge *bridge;
-       int id, ret = 0;
+       int id, ret;
 
        if (!name || !strlen(name)) {
                dev_err(dev, "Attempt to register with no name!\n");
@@ -346,10 +340,8 @@ struct fpga_bridge *fpga_bridge_create(struct device *dev, const char *name,
                return NULL;
 
        id = ida_simple_get(&fpga_bridge_ida, 0, 0, GFP_KERNEL);
-       if (id < 0) {
-               ret = id;
+       if (id < 0)
                goto error_kfree;
-       }
 
        mutex_init(&bridge->mutex);
        INIT_LIST_HEAD(&bridge->node);
This page took 0.033001 seconds and 4 git commands to generate.