|
@@ -108,6 +108,24 @@ css_subchannel_release(struct device *dev)
|
|
|
|
|
|
extern int css_get_ssd_info(struct subchannel *sch);
|
|
|
|
|
|
+
|
|
|
+int css_sch_device_register(struct subchannel *sch)
|
|
|
+{
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ mutex_lock(&sch->reg_mutex);
|
|
|
+ ret = device_register(&sch->dev);
|
|
|
+ mutex_unlock(&sch->reg_mutex);
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+
|
|
|
+void css_sch_device_unregister(struct subchannel *sch)
|
|
|
+{
|
|
|
+ mutex_lock(&sch->reg_mutex);
|
|
|
+ device_unregister(&sch->dev);
|
|
|
+ mutex_unlock(&sch->reg_mutex);
|
|
|
+}
|
|
|
+
|
|
|
static int
|
|
|
css_register_subchannel(struct subchannel *sch)
|
|
|
{
|
|
@@ -119,7 +137,7 @@ css_register_subchannel(struct subchannel *sch)
|
|
|
sch->dev.release = &css_subchannel_release;
|
|
|
|
|
|
/* make it known to the system */
|
|
|
- ret = device_register(&sch->dev);
|
|
|
+ ret = css_sch_device_register(sch);
|
|
|
if (ret)
|
|
|
printk (KERN_WARNING "%s: could not register %s\n",
|
|
|
__func__, sch->dev.bus_id);
|
|
@@ -250,7 +268,7 @@ css_evaluate_subchannel(struct subchannel_id schid, int slow)
|
|
|
* The device will be killed automatically.
|
|
|
*/
|
|
|
cio_disable_subchannel(sch);
|
|
|
- device_unregister(&sch->dev);
|
|
|
+ css_sch_device_unregister(sch);
|
|
|
/* Reset intparm to zeroes. */
|
|
|
sch->schib.pmcw.intparm = 0;
|
|
|
cio_modify(sch);
|
|
@@ -264,7 +282,7 @@ css_evaluate_subchannel(struct subchannel_id schid, int slow)
|
|
|
* away in any case.
|
|
|
*/
|
|
|
if (!disc) {
|
|
|
- device_unregister(&sch->dev);
|
|
|
+ css_sch_device_unregister(sch);
|
|
|
/* Reset intparm to zeroes. */
|
|
|
sch->schib.pmcw.intparm = 0;
|
|
|
cio_modify(sch);
|