···473473}474474475475/**476476+ * ccw_device_get_util_str() - return newly allocated utility strings477477+ * @cdev: device to obtain the utility strings for478478+ * @chp_idx: index of the channel path479479+ *480480+ * On success return a newly allocated copy of the utility strings481481+ * associated with the given channel path. Return %NULL on error.482482+ */483483+u8 *ccw_device_get_util_str(struct ccw_device *cdev, int chp_idx)484484+{485485+ struct subchannel *sch = to_subchannel(cdev->dev.parent);486486+ struct channel_path *chp;487487+ struct chp_id chpid;488488+ u8 *util_str;489489+490490+ chp_id_init(&chpid);491491+ chpid.id = sch->schib.pmcw.chpid[chp_idx];492492+ chp = chpid_to_chp(chpid);493493+494494+ util_str = kmalloc(sizeof(chp->desc_fmt3.util_str), GFP_KERNEL);495495+ if (!util_str)496496+ return NULL;497497+498498+ mutex_lock(&chp->lock);499499+ memcpy(util_str, chp->desc_fmt3.util_str, sizeof(chp->desc_fmt3.util_str));500500+ mutex_unlock(&chp->lock);501501+502502+ return util_str;503503+}504504+505505+/**476506 * ccw_device_get_id() - obtain a ccw device id477507 * @cdev: device to obtain the id for478508 * @dev_id: where to fill in the values···712682EXPORT_SYMBOL(ccw_device_get_ciw);713683EXPORT_SYMBOL(ccw_device_get_path_mask);714684EXPORT_SYMBOL_GPL(ccw_device_get_chp_desc);685685+EXPORT_SYMBOL_GPL(ccw_device_get_util_str);