clk: imx8m: Suppress bind attrs
authorLeonard Crestez <leonard.crestez@nxp.com>
Thu, 21 Nov 2019 13:52:17 +0000 (15:52 +0200)
committerShawn Guo <shawnguo@kernel.org>
Mon, 9 Dec 2019 02:36:34 +0000 (10:36 +0800)
The clock drivers on imx8m series are registered as platform devices and
this opens the possibility of reloading the driver at runtime.

This doesn't actually work: clocks are never removed and attempting to
bind again results in registration errors and a crash. Almost all
devices depend on clocks anyway so rebinding is unlikely to ever be
useful

Fix this by explicitly suppressing bind attrs like several other
clock drivers.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
drivers/clk/imx/clk-imx8mm.c
drivers/clk/imx/clk-imx8mn.c
drivers/clk/imx/clk-imx8mq.c

index 9246e89bb5fda3231bc5f37ef48fc7a02be8bd1e..d5e767e399db784777bea7ba34bb4fe7e070f208 100644 (file)
@@ -621,6 +621,11 @@ static struct platform_driver imx8mm_clk_driver = {
        .probe = imx8mm_clocks_probe,
        .driver = {
                .name = "imx8mm-ccm",
+               /*
+                * Disable bind attributes: clocks are not removed and
+                * reloading the driver will crash or break devices.
+                */
+               .suppress_bind_attrs = true,
                .of_match_table = of_match_ptr(imx8mm_clk_of_match),
        },
 };
index 4749beab9fc853fdae68d903860088f0b2cb1258..b0e07784defb94b9506df295be5a0bf215e8b74d 100644 (file)
@@ -578,6 +578,11 @@ static struct platform_driver imx8mn_clk_driver = {
        .probe = imx8mn_clocks_probe,
        .driver = {
                .name = "imx8mn-ccm",
+               /*
+                * Disable bind attributes: clocks are not removed and
+                * reloading the driver will crash or break devices.
+                */
+               .suppress_bind_attrs = true,
                .of_match_table = of_match_ptr(imx8mn_clk_of_match),
        },
 };
index c8ab86fcba7c7be09547bc7e83bf5d8b9357a783..14a1483b7d9f2aad297a7cb460065308b32d0446 100644 (file)
@@ -613,6 +613,11 @@ static struct platform_driver imx8mq_clk_driver = {
        .probe = imx8mq_clocks_probe,
        .driver = {
                .name = "imx8mq-ccm",
+               /*
+                * Disable bind attributes: clocks are not removed and
+                * reloading the driver will crash or break devices.
+                */
+               .suppress_bind_attrs = true,
                .of_match_table = of_match_ptr(imx8mq_clk_of_match),
        },
 };