+// SPDX-License-Identifier: GPL-2.0-only OR MIT
+/*
+ * Apple SoC MCC memory controller performance control driver
+ *
+ * Copyright The Asahi Linux Contributors
Copyright date?
+static int apple_mcc_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct device_node *node = dev->of_node;
By convention mostly we call the variable "np".
+ mcc->reg_base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(mcc->reg_base))
+ return PTR_ERR(mcc->reg_base);
+
+ if (of_property_read_u32(node, "apple,num-channels", &mcc->num_channels)) {
Don't you have a limit of supported channels? It cannot be any uint32...
+ dev_err(dev, "missing apple,num-channels property\n");
Use almost everywhere dev_err_probe - less code and you get error msg
printed.
+
+ dev_info(dev, "Apple MCC performance driver initialized\n");
Please skip it, or at least make it a dev_dbg, you don't print any
valuable information here.
+static struct platform_driver apple_mcc_driver = {
+ .probe = apple_mcc_probe,
+ .driver = {
+ .name = "apple-mcc",
+ .of_match_table = apple_mcc_of_match,
+ },
+};
module_platform_driver() goes here.
+
+MODULE_AUTHOR("Hector Martin <marcan@xxxxxxxxx>");
+MODULE_DESCRIPTION("MCC memory controller performance tuning driver for Apple SoCs");
+MODULE_LICENSE("GPL v2");
I think this will be "Dual MIT/GPL", based on your SPDX.