css.c (863fc8492734822b95671780db803cd9a4b7d923) | css.c (14556b33f2a5d6a3bc75cd33b709452a31555b25) |
---|---|
1/* 2 * driver for channel subsystem 3 * 4 * Copyright IBM Corp. 2002, 2010 5 * 6 * Author(s): Arnd Bergmann (arndb@de.ibm.com) 7 * Cornelia Huck (cornelia.huck@de.ibm.com) 8 */ --- 210 unchanged lines hidden (view full) --- 219 chp_new(ssd->chpid[i]); 220 } 221} 222 223void css_update_ssd_info(struct subchannel *sch) 224{ 225 int ret; 226 | 1/* 2 * driver for channel subsystem 3 * 4 * Copyright IBM Corp. 2002, 2010 5 * 6 * Author(s): Arnd Bergmann (arndb@de.ibm.com) 7 * Cornelia Huck (cornelia.huck@de.ibm.com) 8 */ --- 210 unchanged lines hidden (view full) --- 219 chp_new(ssd->chpid[i]); 220 } 221} 222 223void css_update_ssd_info(struct subchannel *sch) 224{ 225 int ret; 226 |
227 if (cio_is_console(sch->schid)) { 228 /* Console is initialized too early for functions requiring 229 * memory allocation. */ | 227 ret = chsc_get_ssd_info(sch->schid, &sch->ssd_info); 228 if (ret) |
230 ssd_from_pmcw(&sch->ssd_info, &sch->schib.pmcw); | 229 ssd_from_pmcw(&sch->ssd_info, &sch->schib.pmcw); |
231 } else { 232 ret = chsc_get_ssd_info(sch->schid, &sch->ssd_info); 233 if (ret) 234 ssd_from_pmcw(&sch->ssd_info, &sch->schib.pmcw); 235 ssd_register_chpids(&sch->ssd_info); 236 } | 230 231 ssd_register_chpids(&sch->ssd_info); |
237} 238 239static ssize_t type_show(struct device *dev, struct device_attribute *attr, 240 char *buf) 241{ 242 struct subchannel *sch = to_subchannel(dev); 243 244 return sprintf(buf, "%01x\n", sch->st); --- 21 unchanged lines hidden (view full) --- 266 .attrs = subch_attrs, 267}; 268 269static const struct attribute_group *default_subch_attr_groups[] = { 270 &subch_attr_group, 271 NULL, 272}; 273 | 232} 233 234static ssize_t type_show(struct device *dev, struct device_attribute *attr, 235 char *buf) 236{ 237 struct subchannel *sch = to_subchannel(dev); 238 239 return sprintf(buf, "%01x\n", sch->st); --- 21 unchanged lines hidden (view full) --- 261 .attrs = subch_attrs, 262}; 263 264static const struct attribute_group *default_subch_attr_groups[] = { 265 &subch_attr_group, 266 NULL, 267}; 268 |
274static int css_register_subchannel(struct subchannel *sch) | 269int css_register_subchannel(struct subchannel *sch) |
275{ 276 int ret; 277 278 /* Initialize the subchannel structure */ 279 sch->dev.parent = &channel_subsystems[0]->device; 280 sch->dev.bus = &css_bus_type; 281 sch->dev.groups = default_subch_attr_groups; 282 /* --- 26 unchanged lines hidden (view full) --- 309 return ret; 310} 311 312int css_probe_device(struct subchannel_id schid) 313{ 314 int ret; 315 struct subchannel *sch; 316 | 270{ 271 int ret; 272 273 /* Initialize the subchannel structure */ 274 sch->dev.parent = &channel_subsystems[0]->device; 275 sch->dev.bus = &css_bus_type; 276 sch->dev.groups = default_subch_attr_groups; 277 /* --- 26 unchanged lines hidden (view full) --- 304 return ret; 305} 306 307int css_probe_device(struct subchannel_id schid) 308{ 309 int ret; 310 struct subchannel *sch; 311 |
317 if (cio_is_console(schid)) 318 sch = cio_get_console_subchannel(); 319 else { 320 sch = css_alloc_subchannel(schid); 321 if (IS_ERR(sch)) 322 return PTR_ERR(sch); 323 } | 312 sch = css_alloc_subchannel(schid); 313 if (IS_ERR(sch)) 314 return PTR_ERR(sch); 315 |
324 ret = css_register_subchannel(sch); 325 if (ret) 326 put_device(&sch->dev); 327 328 return ret; 329} 330 331static int --- 527 unchanged lines hidden (view full) --- 859 860} 861static struct notifier_block css_power_notifier = { 862 .notifier_call = css_power_event, 863}; 864 865/* 866 * Now that the driver core is running, we can setup our channel subsystem. | 316 ret = css_register_subchannel(sch); 317 if (ret) 318 put_device(&sch->dev); 319 320 return ret; 321} 322 323static int --- 527 unchanged lines hidden (view full) --- 851 852} 853static struct notifier_block css_power_notifier = { 854 .notifier_call = css_power_event, 855}; 856 857/* 858 * Now that the driver core is running, we can setup our channel subsystem. |
867 * The struct subchannel's are created during probing (except for the 868 * static console subchannel). | 859 * The struct subchannel's are created during probing. |
869 */ 870static int __init css_bus_init(void) 871{ 872 int ret, i; 873 874 ret = chsc_init(); 875 if (ret) 876 return ret; --- 162 unchanged lines hidden (view full) --- 1039 1040 1041/* 1042 * Wait for the initialization of devices to finish, to make sure we are 1043 * done with our setup if the search for the root device starts. 1044 */ 1045static int __init channel_subsystem_init_sync(void) 1046{ | 860 */ 861static int __init css_bus_init(void) 862{ 863 int ret, i; 864 865 ret = chsc_init(); 866 if (ret) 867 return ret; --- 162 unchanged lines hidden (view full) --- 1030 1031 1032/* 1033 * Wait for the initialization of devices to finish, to make sure we are 1034 * done with our setup if the search for the root device starts. 1035 */ 1036static int __init channel_subsystem_init_sync(void) 1037{ |
1038 /* Register subchannels which are already in use. */ 1039 cio_register_early_subchannels(); |
|
1047 /* Start initial subchannel evaluation. */ 1048 css_schedule_eval_all(); 1049 css_complete_work(); 1050 return 0; 1051} 1052subsys_initcall_sync(channel_subsystem_init_sync); 1053 1054void channel_subsystem_reinit(void) --- 213 unchanged lines hidden --- | 1040 /* Start initial subchannel evaluation. */ 1041 css_schedule_eval_all(); 1042 css_complete_work(); 1043 return 0; 1044} 1045subsys_initcall_sync(channel_subsystem_init_sync); 1046 1047void channel_subsystem_reinit(void) --- 213 unchanged lines hidden --- |