ethernet: hisilicon: hns: hns_dsaf_mac: add missing of_node_put after calling of_pars...
[linux-2.6/btrfs-unstable.git] / arch / mips / loongson64 / loongson-3 / platform.c
blob25a97cc0ee33664f79f16e3ffb4d350a4b033dae
1 /*
2 * Copyright (C) 2009 Lemote Inc.
3 * Author: Wu Zhangjin, wuzhangjin@gmail.com
4 * Xiang Yu, xiangy@lemote.com
5 * Chen Huacai, chenhc@lemote.com
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
13 #include <linux/err.h>
14 #include <linux/slab.h>
15 #include <linux/platform_device.h>
16 #include <asm/bootinfo.h>
17 #include <boot_param.h>
18 #include <loongson_hwmon.h>
19 #include <workarounds.h>
21 static int __init loongson3_platform_init(void)
23 int i;
24 struct platform_device *pdev;
26 if (loongson_sysconf.ecname[0] != '\0')
27 platform_device_register_simple(loongson_sysconf.ecname, -1, NULL, 0);
29 for (i = 0; i < loongson_sysconf.nr_sensors; i++) {
30 if (loongson_sysconf.sensors[i].type > SENSOR_FAN)
31 continue;
33 pdev = kzalloc(sizeof(struct platform_device), GFP_KERNEL);
34 pdev->name = loongson_sysconf.sensors[i].name;
35 pdev->id = loongson_sysconf.sensors[i].id;
36 pdev->dev.platform_data = &loongson_sysconf.sensors[i];
37 platform_device_register(pdev);
40 return 0;
43 arch_initcall(loongson3_platform_init);