/*
* drivers/s390/cio/chsc.c
* S/390 common I/O routines -- channel subsystem call
- * $Revision: 1.114 $
+ * $Revision: 1.115 $
*
* Copyright (C) 1999-2002 IBM Deutschland Entwicklung GmbH,
* IBM Corporation
return -ENOMEM;
memset(chp, 0, sizeof(struct channel_path));
- chps[chpid] = chp;
-
/* fill in status, etc. */
chp->id = chpid;
chp->state = 1;
if (ret) {
printk(KERN_WARNING "%s: could not register %02x\n",
__func__, chpid);
- return ret;
+ goto out_free;
}
ret = device_create_file(&chp->dev, &dev_attr_status);
- if (ret)
+ if (ret) {
device_unregister(&chp->dev);
-
+ goto out_free;
+ } else
+ chps[chpid] = chp;
+ return ret;
+out_free:
+ kfree(chp);
return ret;
}
extern int cio_get_options (struct subchannel *);
extern int cio_modify (struct subchannel *);
/* Use with care. */
+#ifdef CONFIG_CCW_CONSOLE
extern struct subchannel *cio_probe_console(void);
extern void cio_release_console(void);
extern int cio_is_console(int irq);
extern struct subchannel *cio_get_console_subchannel(void);
+#else
+#define cio_is_console(irq) 0
+#define cio_get_console_subchannel() NULL
+#endif
extern int cio_show_msg;
};
if (notify) {
/* Get device online again. */
+ cdev->private->state = DEV_STATE_OFFLINE;
ccw_device_online(cdev);
wake_up(&cdev->private->wait_q);
return;
(irb->scsw.actl & SCSW_ACTL_SUSPENDED)))
ccw_device_path_notoper(cdev);
- if (!(irb->scsw.dstat & DEV_STAT_UNIT_CHECK)) {
+ if (!(irb->scsw.dstat & DEV_STAT_UNIT_CHECK) &&
+ (irb->scsw.dstat & DEV_STAT_CHN_END)) {
cdev->private->irb.esw.esw0.erw.cons = 1;
cdev->private->flags.dosense = 0;
}