slimbus: ngd: register ngd driver only once.
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Sun, 16 Sep 2018 23:45:46 +0000 (16:45 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 Sep 2018 18:21:02 +0000 (20:21 +0200)
Move ngd platform driver out of loop so that it registers only once.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/slimbus/qcom-ngd-ctrl.c

index 14a9d18306cbf7bc89868197e24b49286d2ae892..f872166f8614744781b3625ca82121ddda3dfb0e 100644 (file)
@@ -1342,7 +1342,6 @@ static int of_qcom_slim_ngd_register(struct device *parent,
                ngd->base = ctrl->base + ngd->id * data->offset +
                                        (ngd->id - 1) * data->size;
                ctrl->ngd = ngd;
-               platform_driver_register(&qcom_slim_ngd_driver);
 
                return 0;
        }
@@ -1441,6 +1440,7 @@ static int qcom_slim_ngd_ctrl_probe(struct platform_device *pdev)
        init_completion(&ctrl->reconf);
        init_completion(&ctrl->qmi.qmi_comp);
 
+       platform_driver_register(&qcom_slim_ngd_driver);
        return of_qcom_slim_ngd_register(dev, ctrl);
 }