diff options
Diffstat (limited to 'drivers/s390/cio/css.c')
-rw-r--r-- | drivers/s390/cio/css.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 85d43c6bcb66..e995123fd805 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c | |||
@@ -152,24 +152,15 @@ css_alloc_subchannel(struct subchannel_id schid) | |||
152 | } | 152 | } |
153 | 153 | ||
154 | static void | 154 | static void |
155 | css_free_subchannel(struct subchannel *sch) | ||
156 | { | ||
157 | if (sch) { | ||
158 | /* Reset intparm to zeroes. */ | ||
159 | sch->config.intparm = 0; | ||
160 | cio_commit_config(sch); | ||
161 | kfree(sch->lock); | ||
162 | kfree(sch); | ||
163 | } | ||
164 | } | ||
165 | |||
166 | static void | ||
167 | css_subchannel_release(struct device *dev) | 155 | css_subchannel_release(struct device *dev) |
168 | { | 156 | { |
169 | struct subchannel *sch; | 157 | struct subchannel *sch; |
170 | 158 | ||
171 | sch = to_subchannel(dev); | 159 | sch = to_subchannel(dev); |
172 | if (!cio_is_console(sch->schid)) { | 160 | if (!cio_is_console(sch->schid)) { |
161 | /* Reset intparm to zeroes. */ | ||
162 | sch->config.intparm = 0; | ||
163 | cio_commit_config(sch); | ||
173 | kfree(sch->lock); | 164 | kfree(sch->lock); |
174 | kfree(sch); | 165 | kfree(sch); |
175 | } | 166 | } |
@@ -180,6 +171,8 @@ static int css_sch_device_register(struct subchannel *sch) | |||
180 | int ret; | 171 | int ret; |
181 | 172 | ||
182 | mutex_lock(&sch->reg_mutex); | 173 | mutex_lock(&sch->reg_mutex); |
174 | dev_set_name(&sch->dev, "0.%x.%04x", sch->schid.ssid, | ||
175 | sch->schid.sch_no); | ||
183 | ret = device_register(&sch->dev); | 176 | ret = device_register(&sch->dev); |
184 | mutex_unlock(&sch->reg_mutex); | 177 | mutex_unlock(&sch->reg_mutex); |
185 | return ret; | 178 | return ret; |
@@ -327,7 +320,7 @@ int css_probe_device(struct subchannel_id schid) | |||
327 | return PTR_ERR(sch); | 320 | return PTR_ERR(sch); |
328 | ret = css_register_subchannel(sch); | 321 | ret = css_register_subchannel(sch); |
329 | if (ret) | 322 | if (ret) |
330 | css_free_subchannel(sch); | 323 | put_device(&sch->dev); |
331 | return ret; | 324 | return ret; |
332 | } | 325 | } |
333 | 326 | ||
@@ -644,7 +637,10 @@ __init_channel_subsystem(struct subchannel_id schid, void *data) | |||
644 | * not working) so we do it now. This is true e.g. for the | 637 | * not working) so we do it now. This is true e.g. for the |
645 | * console subchannel. | 638 | * console subchannel. |
646 | */ | 639 | */ |
647 | css_register_subchannel(sch); | 640 | if (css_register_subchannel(sch)) { |
641 | if (!cio_is_console(schid)) | ||
642 | put_device(&sch->dev); | ||
643 | } | ||
648 | return 0; | 644 | return 0; |
649 | } | 645 | } |
650 | 646 | ||
@@ -661,8 +657,8 @@ css_generate_pgid(struct channel_subsystem *css, u32 tod_high) | |||
661 | css->global_pgid.pgid_high.cpu_addr = 0; | 657 | css->global_pgid.pgid_high.cpu_addr = 0; |
662 | #endif | 658 | #endif |
663 | } | 659 | } |
664 | css->global_pgid.cpu_id = ((cpuid_t *) __LC_CPUID)->ident; | 660 | css->global_pgid.cpu_id = S390_lowcore.cpu_id.ident; |
665 | css->global_pgid.cpu_model = ((cpuid_t *) __LC_CPUID)->machine; | 661 | css->global_pgid.cpu_model = S390_lowcore.cpu_id.machine; |
666 | css->global_pgid.tod_high = tod_high; | 662 | css->global_pgid.tod_high = tod_high; |
667 | 663 | ||
668 | } | 664 | } |
@@ -920,8 +916,10 @@ init_channel_subsystem (void) | |||
920 | goto out_device; | 916 | goto out_device; |
921 | } | 917 | } |
922 | ret = device_register(&css->pseudo_subchannel->dev); | 918 | ret = device_register(&css->pseudo_subchannel->dev); |
923 | if (ret) | 919 | if (ret) { |
920 | put_device(&css->pseudo_subchannel->dev); | ||
924 | goto out_file; | 921 | goto out_file; |
922 | } | ||
925 | } | 923 | } |
926 | ret = register_reboot_notifier(&css_reboot_notifier); | 924 | ret = register_reboot_notifier(&css_reboot_notifier); |
927 | if (ret) | 925 | if (ret) |