hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/nvmem/rockchip-efuse.c
....@@ -1,17 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Rockchip eFuse Driver
34 *
45 * Copyright (c) 2015 Rockchip Electronics Co. Ltd.
56 * Author: Caesar Wang <wxt@rock-chips.com>
6
- *
7
- * This program is free software; you can redistribute it and/or modify it
8
- * under the terms of version 2 of the GNU General Public License as
9
- * published by the Free Software Foundation.
10
- *
11
- * This program is distributed in the hope that it will be useful, but WITHOUT
12
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14
- * more details.
157 */
168
179 #include <linux/clk.h>
....@@ -547,7 +539,7 @@
547539 };
548540 MODULE_DEVICE_TABLE(of, rockchip_efuse_match);
549541
550
-static int __init rockchip_efuse_probe(struct platform_device *pdev)
542
+static int rockchip_efuse_probe(struct platform_device *pdev)
551543 {
552544 struct resource *res;
553545 struct nvmem_device *nvmem;
....@@ -591,19 +583,33 @@
591583 }
592584
593585 static struct platform_driver rockchip_efuse_driver = {
586
+ .probe = rockchip_efuse_probe,
594587 .driver = {
595588 .name = "rockchip-efuse",
596589 .of_match_table = rockchip_efuse_match,
597590 },
598591 };
599592
600
-static int __init rockchip_efuse_module_init(void)
593
+static int __init rockchip_efuse_init(void)
601594 {
602
- return platform_driver_probe(&rockchip_efuse_driver,
603
- rockchip_efuse_probe);
595
+ int ret;
596
+
597
+ ret = platform_driver_register(&rockchip_efuse_driver);
598
+ if (ret) {
599
+ pr_err("failed to register efuse driver\n");
600
+ return ret;
601
+ }
602
+
603
+ return 0;
604604 }
605605
606
-subsys_initcall(rockchip_efuse_module_init);
606
+static void __exit rockchip_efuse_exit(void)
607
+{
608
+ return platform_driver_unregister(&rockchip_efuse_driver);
609
+}
610
+
611
+subsys_initcall(rockchip_efuse_init);
612
+module_exit(rockchip_efuse_exit);
607613
608614 MODULE_DESCRIPTION("rockchip_efuse driver");
609615 MODULE_LICENSE("GPL v2");