Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: mvebu: make cp110-system-controller explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/clk/mvebu/Kconfig:config ARMADA_CP110_SYSCON
drivers/clk/mvebu/Kconfig: bool

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_platform_driver() uses the same init level priority as
builtin_platform_driver() the init ordering remains unchanged with
this commit.

Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: linux-clk@vger.kernel.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>

authored by

Paul Gortmaker and committed by
Stephen Boyd
7acf751e 9fe69429

+3 -32
+3 -32
drivers/clk/mvebu/cp110-system-controller.c
··· 30 30 31 31 #include <linux/clk-provider.h> 32 32 #include <linux/mfd/syscon.h> 33 - #include <linux/module.h> 33 + #include <linux/init.h> 34 34 #include <linux/of.h> 35 35 #include <linux/of_address.h> 36 36 #include <linux/platform_device.h> ··· 368 368 return ret; 369 369 } 370 370 371 - static int cp110_syscon_clk_remove(struct platform_device *pdev) 372 - { 373 - struct clk_hw **cp110_clks = platform_get_drvdata(pdev); 374 - int i; 375 - 376 - of_clk_del_provider(pdev->dev.of_node); 377 - 378 - for (i = 0; i < CP110_MAX_GATABLE_CLOCKS; i++) { 379 - struct clk_hw *hw = cp110_clks[CP110_MAX_CORE_CLOCKS + i]; 380 - 381 - if (hw) 382 - cp110_unregister_gate(hw); 383 - } 384 - 385 - clk_hw_unregister_fixed_factor(cp110_clks[CP110_CORE_NAND]); 386 - clk_hw_unregister_fixed_factor(cp110_clks[CP110_CORE_CORE]); 387 - clk_hw_unregister_fixed_factor(cp110_clks[CP110_CORE_EIP]); 388 - clk_hw_unregister_fixed_factor(cp110_clks[CP110_CORE_PPV2]); 389 - clk_hw_unregister_fixed_rate(cp110_clks[CP110_CORE_APLL]); 390 - 391 - return 0; 392 - } 393 - 394 371 static const struct of_device_id cp110_syscon_of_match[] = { 395 372 { .compatible = "marvell,cp110-system-controller0", }, 396 373 { } 397 374 }; 398 - MODULE_DEVICE_TABLE(of, armada8k_pcie_of_match); 399 375 400 376 static struct platform_driver cp110_syscon_driver = { 401 377 .probe = cp110_syscon_clk_probe, 402 - .remove = cp110_syscon_clk_remove, 403 378 .driver = { 404 379 .name = "marvell-cp110-system-controller0", 405 380 .of_match_table = cp110_syscon_of_match, 381 + .suppress_bind_attrs = true, 406 382 }, 407 383 }; 408 - 409 - module_platform_driver(cp110_syscon_driver); 410 - 411 - MODULE_DESCRIPTION("Marvell CP110 System Controller 0 driver"); 412 - MODULE_AUTHOR("Thomas Petazzoni <thomas.petazzoni@free-electrons.com>"); 413 - MODULE_LICENSE("GPL"); 384 + builtin_platform_driver(cp110_syscon_driver);