fastrpc.c (86008304dc2ad41a274cdacb585c641ec6bbb558) | fastrpc.c (01b76c32e3f30d54ab8ec1efeed3c6ecef7f6027) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2// Copyright (c) 2011-2018, The Linux Foundation. All rights reserved. 3// Copyright (c) 2018, Linaro Limited 4 5#include <linux/completion.h> 6#include <linux/device.h> 7#include <linux/dma-buf.h> 8#include <linux/dma-mapping.h> --- 1170 unchanged lines hidden (view full) --- 1179}; 1180 1181static int fastrpc_cb_probe(struct platform_device *pdev) 1182{ 1183 struct fastrpc_channel_ctx *cctx; 1184 struct fastrpc_session_ctx *sess; 1185 struct device *dev = &pdev->dev; 1186 int i, sessions = 0; | 1// SPDX-License-Identifier: GPL-2.0 2// Copyright (c) 2011-2018, The Linux Foundation. All rights reserved. 3// Copyright (c) 2018, Linaro Limited 4 5#include <linux/completion.h> 6#include <linux/device.h> 7#include <linux/dma-buf.h> 8#include <linux/dma-mapping.h> --- 1170 unchanged lines hidden (view full) --- 1179}; 1180 1181static int fastrpc_cb_probe(struct platform_device *pdev) 1182{ 1183 struct fastrpc_channel_ctx *cctx; 1184 struct fastrpc_session_ctx *sess; 1185 struct device *dev = &pdev->dev; 1186 int i, sessions = 0; |
1187 int rc; |
|
1187 1188 cctx = dev_get_drvdata(dev->parent); 1189 if (!cctx) 1190 return -EINVAL; 1191 1192 of_property_read_u32(dev->of_node, "qcom,nsessions", &sessions); 1193 1194 spin_lock(&cctx->lock); --- 13 unchanged lines hidden (view full) --- 1208 if (cctx->sesscount++ >= FASTRPC_MAX_SESSIONS) 1209 break; 1210 dup_sess = &cctx->session[cctx->sesscount]; 1211 memcpy(dup_sess, sess, sizeof(*dup_sess)); 1212 } 1213 } 1214 cctx->sesscount++; 1215 spin_unlock(&cctx->lock); | 1188 1189 cctx = dev_get_drvdata(dev->parent); 1190 if (!cctx) 1191 return -EINVAL; 1192 1193 of_property_read_u32(dev->of_node, "qcom,nsessions", &sessions); 1194 1195 spin_lock(&cctx->lock); --- 13 unchanged lines hidden (view full) --- 1209 if (cctx->sesscount++ >= FASTRPC_MAX_SESSIONS) 1210 break; 1211 dup_sess = &cctx->session[cctx->sesscount]; 1212 memcpy(dup_sess, sess, sizeof(*dup_sess)); 1213 } 1214 } 1215 cctx->sesscount++; 1216 spin_unlock(&cctx->lock); |
1216 dma_set_mask(dev, DMA_BIT_MASK(32)); | 1217 rc = dma_set_mask(dev, DMA_BIT_MASK(32)); 1218 if (rc) { 1219 dev_err(dev, "32-bit DMA enable failed\n"); 1220 return rc; 1221 } |
1217 1218 return 0; 1219} 1220 1221static int fastrpc_cb_remove(struct platform_device *pdev) 1222{ 1223 struct fastrpc_channel_ctx *cctx = dev_get_drvdata(pdev->dev.parent); 1224 struct fastrpc_session_ctx *sess = dev_get_drvdata(&pdev->dev); --- 177 unchanged lines hidden --- | 1222 1223 return 0; 1224} 1225 1226static int fastrpc_cb_remove(struct platform_device *pdev) 1227{ 1228 struct fastrpc_channel_ctx *cctx = dev_get_drvdata(pdev->dev.parent); 1229 struct fastrpc_session_ctx *sess = dev_get_drvdata(&pdev->dev); --- 177 unchanged lines hidden --- |