|
25 | 25 | #define MT7621_MEM_TEST_PATTERN 0xaa5555aa
|
26 | 26 |
|
27 | 27 | static u32 detect_magic __initdata;
|
| 28 | +static struct ralink_soc_info *soc_info_ptr; |
28 | 29 |
|
29 | 30 | int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge)
|
30 | 31 | {
|
@@ -147,27 +148,30 @@ static const char __init *mt7621_get_soc_revision(void)
|
147 | 148 | return "E1";
|
148 | 149 | }
|
149 | 150 |
|
150 |
| -static void soc_dev_init(struct ralink_soc_info *soc_info) |
| 151 | +static int __init mt7621_soc_dev_init(void) |
151 | 152 | {
|
152 | 153 | struct soc_device *soc_dev;
|
153 | 154 | struct soc_device_attribute *soc_dev_attr;
|
154 | 155 |
|
155 | 156 | soc_dev_attr = kzalloc(sizeof(*soc_dev_attr), GFP_KERNEL);
|
156 | 157 | if (!soc_dev_attr)
|
157 |
| - return; |
| 158 | + return -ENOMEM; |
158 | 159 |
|
159 | 160 | soc_dev_attr->soc_id = "mt7621";
|
160 | 161 | soc_dev_attr->family = "Ralink";
|
161 | 162 | soc_dev_attr->revision = mt7621_get_soc_revision();
|
162 | 163 |
|
163 |
| - soc_dev_attr->data = soc_info; |
| 164 | + soc_dev_attr->data = soc_info_ptr; |
164 | 165 |
|
165 | 166 | soc_dev = soc_device_register(soc_dev_attr);
|
166 | 167 | if (IS_ERR(soc_dev)) {
|
167 | 168 | kfree(soc_dev_attr);
|
168 |
| - return; |
| 169 | + return PTR_ERR(soc_dev); |
169 | 170 | }
|
| 171 | + |
| 172 | + return 0; |
170 | 173 | }
|
| 174 | +device_initcall(mt7621_soc_dev_init); |
171 | 175 |
|
172 | 176 | void __init prom_soc_init(struct ralink_soc_info *soc_info)
|
173 | 177 | {
|
@@ -209,7 +213,7 @@ void __init prom_soc_init(struct ralink_soc_info *soc_info)
|
209 | 213 |
|
210 | 214 | soc_info->mem_detect = mt7621_memory_detect;
|
211 | 215 |
|
212 |
| - soc_dev_init(soc_info); |
| 216 | + soc_info_ptr = soc_info; |
213 | 217 |
|
214 | 218 | if (!register_cps_smp_ops())
|
215 | 219 | return;
|
|
0 commit comments