clk: sunxi-ng: Prevent unbinding CCUs via sysfs
authorSamuel Holland <samuel@sholland.org>
Wed, 1 Sep 2021 05:05:20 +0000 (00:05 -0500)
committerMaxime Ripard <maxime@cerno.tech>
Mon, 13 Sep 2021 07:03:20 +0000 (09:03 +0200)
The CCU drivers are not really designed to be unbound. Unbinding a SoC's
main CCU is especially pointless, as very few of the peripherals on the
SoC will work without it. Let's avoid any potential problems by removing
the bind/unbind attributes from sysfs for these drivers.

This change is not applied to the "secondary" CCUs (DE, USB) as those
could reasonably be unbound without making the system useless.

Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20210901050526.45673-3-samuel@sholland.org
drivers/clk/sunxi-ng/ccu-sun50i-a100-r.c
drivers/clk/sunxi-ng/ccu-sun50i-a100.c
drivers/clk/sunxi-ng/ccu-sun50i-a64.c
drivers/clk/sunxi-ng/ccu-sun50i-h6.c
drivers/clk/sunxi-ng/ccu-sun8i-a83t.c
drivers/clk/sunxi-ng/ccu-sun8i-r40.c
drivers/clk/sunxi-ng/ccu-sun9i-a80-de.c
drivers/clk/sunxi-ng/ccu-sun9i-a80.c

index 6f2a589..804729e 100644 (file)
@@ -208,6 +208,7 @@ static struct platform_driver sun50i_a100_r_ccu_driver = {
        .probe  = sun50i_a100_r_ccu_probe,
        .driver = {
                .name   = "sun50i-a100-r-ccu",
+               .suppress_bind_attrs = true,
                .of_match_table = sun50i_a100_r_ccu_ids,
        },
 };
index 913bb08..1d475d5 100644 (file)
@@ -1270,6 +1270,7 @@ static struct platform_driver sun50i_a100_ccu_driver = {
        .probe  = sun50i_a100_ccu_probe,
        .driver = {
                .name   = "sun50i-a100-ccu",
+               .suppress_bind_attrs = true,
                .of_match_table = sun50i_a100_ccu_ids,
        },
 };
index 54f25c6..fcbd914 100644 (file)
@@ -978,6 +978,7 @@ static struct platform_driver sun50i_a64_ccu_driver = {
        .probe  = sun50i_a64_ccu_probe,
        .driver = {
                .name   = "sun50i-a64-ccu",
+               .suppress_bind_attrs = true,
                .of_match_table = sun50i_a64_ccu_ids,
        },
 };
index c0800da..9a8902f 100644 (file)
@@ -1252,6 +1252,7 @@ static struct platform_driver sun50i_h6_ccu_driver = {
        .probe  = sun50i_h6_ccu_probe,
        .driver = {
                .name   = "sun50i-h6-ccu",
+               .suppress_bind_attrs = true,
                .of_match_table = sun50i_h6_ccu_ids,
        },
 };
index c2ddcd2..e663ab0 100644 (file)
@@ -918,6 +918,7 @@ static struct platform_driver sun8i_a83t_ccu_driver = {
        .probe  = sun8i_a83t_ccu_probe,
        .driver = {
                .name   = "sun8i-a83t-ccu",
+               .suppress_bind_attrs = true,
                .of_match_table = sun8i_a83t_ccu_ids,
        },
 };
index 002e0c3..a2144ee 100644 (file)
@@ -1369,6 +1369,7 @@ static struct platform_driver sun8i_r40_ccu_driver = {
        .probe  = sun8i_r40_ccu_probe,
        .driver = {
                .name   = "sun8i-r40-ccu",
+               .suppress_bind_attrs = true,
                .of_match_table = sun8i_r40_ccu_ids,
        },
 };
index 261e644..d207297 100644 (file)
@@ -268,6 +268,7 @@ static struct platform_driver sun9i_a80_de_clk_driver = {
        .probe  = sun9i_a80_de_clk_probe,
        .driver = {
                .name   = "sun9i-a80-de-clks",
+               .suppress_bind_attrs = true,
                .of_match_table = sun9i_a80_de_clk_ids,
        },
 };
index 97aaed0..68b30fd 100644 (file)
@@ -1243,6 +1243,7 @@ static struct platform_driver sun9i_a80_ccu_driver = {
        .probe  = sun9i_a80_ccu_probe,
        .driver = {
                .name   = "sun9i-a80-ccu",
+               .suppress_bind_attrs = true,
                .of_match_table = sun9i_a80_ccu_ids,
        },
 };