aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/chp.c
diff options
context:
space:
mode:
authorPeter Oberparleiter <peter.oberparleiter@de.ibm.com>2013-03-11 12:58:18 +0100
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-04-17 14:07:26 +0200
commitcce0eacc225b402824e2fc72936b3796e7659fc6 (patch)
treece22f4ddf3f5fe003b21f8d1a2d27353c0293926 /drivers/s390/cio/chp.c
parents390/monreader: Remove redundant NULL check before kfree (diff)
downloadlinux-dev-cce0eacc225b402824e2fc72936b3796e7659fc6.tar.xz
linux-dev-cce0eacc225b402824e2fc72936b3796e7659fc6.zip
s390/cio: collect format 1 channel-path description data
Collect format 1 channel-path description data for each CHPID and update the information in one place. Reviewed-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/chp.c')
-rw-r--r--drivers/s390/cio/chp.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/drivers/s390/cio/chp.c b/drivers/s390/cio/chp.c
index 50ad5fdd815d..21fabc6d5a9c 100644
--- a/drivers/s390/cio/chp.c
+++ b/drivers/s390/cio/chp.c
@@ -377,6 +377,26 @@ static void chp_release(struct device *dev)
}
/**
+ * chp_update_desc - update channel-path description
+ * @chp - channel-path
+ *
+ * Update the channel-path description of the specified channel-path.
+ * Return zero on success, non-zero otherwise.
+ */
+int chp_update_desc(struct channel_path *chp)
+{
+ int rc;
+
+ rc = chsc_determine_base_channel_path_desc(chp->chpid, &chp->desc);
+ if (rc)
+ return rc;
+
+ rc = chsc_determine_fmt1_channel_path_desc(chp->chpid, &chp->desc_fmt1);
+
+ return rc;
+}
+
+/**
* chp_new - register a new channel-path
* @chpid - channel-path ID
*
@@ -403,7 +423,7 @@ int chp_new(struct chp_id chpid)
mutex_init(&chp->lock);
/* Obtain channel path description and fill it in. */
- ret = chsc_determine_base_channel_path_desc(chpid, &chp->desc);
+ ret = chp_update_desc(chp);
if (ret)
goto out_free;
if ((chp->desc.flags & 0x80) == 0) {