hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/mailbox/rockchip-mailbox.c
....@@ -1,4 +1,4 @@
1
-// SPDX-License-Identifier: GPL-2.0
1
+// SPDX-License-Identifier: GPL-2.0-only
22 /*
33 * Copyright (c) 2015, Fuzhou Rockchip Electronics Co., Ltd
44 */
....@@ -263,7 +263,7 @@
263263 mb->mbox.chans[i].con_priv = &mb->chans[i];
264264 }
265265
266
- ret = mbox_controller_register(&mb->mbox);
266
+ ret = devm_mbox_controller_register(&pdev->dev, &mb->mbox);
267267 if (ret < 0) {
268268 dev_err(&pdev->dev, "Failed to register mailbox: %d\n", ret);
269269 goto disable_clk;
....@@ -294,28 +294,23 @@
294294 return ret;
295295 }
296296
297
-static int rockchip_mbox_remove(struct platform_device *pdev)
298
-{
299
- struct rockchip_mbox *mb = platform_get_drvdata(pdev);
300
-
301
- if (!mb)
302
- return -EINVAL;
303
-
304
- mbox_controller_unregister(&mb->mbox);
305
-
306
- return 0;
307
-}
308
-
309297 static struct platform_driver rockchip_mbox_driver = {
310298 .probe = rockchip_mbox_probe,
311
- .remove = rockchip_mbox_remove,
312299 .driver = {
313300 .name = "rockchip-mailbox",
314301 .of_match_table = of_match_ptr(rockchip_mbox_of_match),
315302 },
316303 };
317304
305
+#if defined(CONFIG_ROCKCHIP_THUNDER_BOOT)
306
+static int __init rockchip_mbox_driver_init(void)
307
+{
308
+ return platform_driver_register(&rockchip_mbox_driver);
309
+}
310
+core_initcall(rockchip_mbox_driver_init);
311
+#else
318312 module_platform_driver(rockchip_mbox_driver);
313
+#endif
319314
320315 MODULE_LICENSE("GPL v2");
321316 MODULE_DESCRIPTION("Rockchip mailbox: communicate between CPU cores and MCU");