struct fsl_mc_obj_desc endpoint_desc = {{ 0 }};
        struct dprc_endpoint endpoint1 = {{ 0 }};
        struct dprc_endpoint endpoint2 = {{ 0 }};
+       struct fsl_mc_bus *mc_bus;
        int state, err;
 
        mc_bus_dev = to_fsl_mc_device(mc_dev->dev.parent);
        strcpy(endpoint_desc.type, endpoint2.type);
        endpoint_desc.id = endpoint2.id;
        endpoint = fsl_mc_device_lookup(&endpoint_desc, mc_bus_dev);
+       if (endpoint)
+               return endpoint;
 
        /*
         * We know that the device has an endpoint because we verified by
         * yet discovered by the fsl-mc bus, thus the lookup returned NULL.
         * Force a rescan of the devices in this container and retry the lookup.
         */
-       if (!endpoint) {
-               struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_bus_dev);
-
-               if (mutex_trylock(&mc_bus->scan_mutex)) {
-                       err = dprc_scan_objects(mc_bus_dev, true);
-                       mutex_unlock(&mc_bus->scan_mutex);
-               }
-
-               if (err < 0)
-                       return ERR_PTR(err);
+       mc_bus = to_fsl_mc_bus(mc_bus_dev);
+       if (mutex_trylock(&mc_bus->scan_mutex)) {
+               err = dprc_scan_objects(mc_bus_dev, true);
+               mutex_unlock(&mc_bus->scan_mutex);
        }
+       if (err < 0)
+               return ERR_PTR(err);
 
        endpoint = fsl_mc_device_lookup(&endpoint_desc, mc_bus_dev);
        /*