Skip to content

Commit 3d2d10e

Browse files
committed
Merge tag 'rpmsg-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux
Pull rpmsg updates from Bjorn Andersson: "Mark 'data' argument in rpmsg_send() const, and perculate to related drivers. Replace deprecated class_destroy() with class_unregister()" * tag 'rpmsg-v7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: media: platform: mtk-mdp3: Constify buffer passed to mdp_vpu_sendmsg() ASoC: qcom: Constify GPR packet being send over GPR interface rpmsg: Constify buffer passed to send API remoteproc: mtk_scp: Constify buffer passed to scp_send_ipi() remoteproc: mtk_scp_ipi: Constify buffer passed to scp_ipi_send() drivers: rpmsg: class_destroy() is deprecated
2 parents d65218d + 3e2fa99 commit 3d2d10e

18 files changed

Lines changed: 67 additions & 58 deletions

File tree

drivers/media/platform/mediatek/mdp3/mtk-mdp3-vpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ void mdp_vpu_unregister(struct mdp_dev *mdp)
163163
}
164164

165165
static int mdp_vpu_sendmsg(struct mdp_vpu_dev *vpu, enum scp_ipi_id id,
166-
void *buf, unsigned int len)
166+
const void *buf, unsigned int len)
167167
{
168168
struct mdp_dev *mdp = vpu_to_mdp(vpu);
169169
unsigned int t = MDP_VPU_MESSAGE_TIMEOUT;

drivers/remoteproc/mtk_scp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ static void scp_unregister_ipi(struct platform_device *pdev, u32 id)
10781078
scp_ipi_unregister(scp, id);
10791079
}
10801080

1081-
static int scp_send_ipi(struct platform_device *pdev, u32 id, void *buf,
1081+
static int scp_send_ipi(struct platform_device *pdev, u32 id, const void *buf,
10821082
unsigned int len, unsigned int wait)
10831083
{
10841084
struct mtk_scp *scp = platform_get_drvdata(pdev);

drivers/remoteproc/mtk_scp_ipi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ EXPORT_SYMBOL_GPL(scp_ipi_unlock);
156156
*
157157
* Return: 0 if sending data successfully, -error on error.
158158
**/
159-
int scp_ipi_send(struct mtk_scp *scp, u32 id, void *buf, unsigned int len,
159+
int scp_ipi_send(struct mtk_scp *scp, u32 id, const void *buf, unsigned int len,
160160
unsigned int wait)
161161
{
162162
struct mtk_share_obj __iomem *send_obj = scp->send_buf;

drivers/rpmsg/mtk_rpmsg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static void mtk_rpmsg_destroy_ept(struct rpmsg_endpoint *ept)
135135
kref_put(&ept->refcount, __mtk_ept_release);
136136
}
137137

138-
static int mtk_rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len)
138+
static int mtk_rpmsg_send(struct rpmsg_endpoint *ept, const void *data, int len)
139139
{
140140
struct mtk_rpmsg_rproc_subdev *mtk_subdev =
141141
to_mtk_rpmsg_endpoint(ept)->mtk_subdev;
@@ -144,7 +144,7 @@ static int mtk_rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len)
144144
len, 0);
145145
}
146146

147-
static int mtk_rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len)
147+
static int mtk_rpmsg_trysend(struct rpmsg_endpoint *ept, const void *data, int len)
148148
{
149149
struct mtk_rpmsg_rproc_subdev *mtk_subdev =
150150
to_mtk_rpmsg_endpoint(ept)->mtk_subdev;

drivers/rpmsg/qcom_glink_native.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,7 +1474,7 @@ static int qcom_glink_request_intent(struct qcom_glink *glink,
14741474
}
14751475

14761476
static int __qcom_glink_send(struct glink_channel *channel,
1477-
void *data, int len, bool wait)
1477+
const void *data, int len, bool wait)
14781478
{
14791479
struct qcom_glink *glink = channel->glink;
14801480
struct glink_core_rx_intent *intent = NULL;
@@ -1553,28 +1553,31 @@ static int __qcom_glink_send(struct glink_channel *channel,
15531553
return 0;
15541554
}
15551555

1556-
static int qcom_glink_send(struct rpmsg_endpoint *ept, void *data, int len)
1556+
static int qcom_glink_send(struct rpmsg_endpoint *ept, const void *data, int len)
15571557
{
15581558
struct glink_channel *channel = to_glink_channel(ept);
15591559

15601560
return __qcom_glink_send(channel, data, len, true);
15611561
}
15621562

1563-
static int qcom_glink_trysend(struct rpmsg_endpoint *ept, void *data, int len)
1563+
static int qcom_glink_trysend(struct rpmsg_endpoint *ept, const void *data,
1564+
int len)
15641565
{
15651566
struct glink_channel *channel = to_glink_channel(ept);
15661567

15671568
return __qcom_glink_send(channel, data, len, false);
15681569
}
15691570

1570-
static int qcom_glink_sendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst)
1571+
static int qcom_glink_sendto(struct rpmsg_endpoint *ept, const void *data,
1572+
int len, u32 dst)
15711573
{
15721574
struct glink_channel *channel = to_glink_channel(ept);
15731575

15741576
return __qcom_glink_send(channel, data, len, true);
15751577
}
15761578

1577-
static int qcom_glink_trysendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst)
1579+
static int qcom_glink_trysendto(struct rpmsg_endpoint *ept, const void *data,
1580+
int len, u32 dst)
15781581
{
15791582
struct glink_channel *channel = to_glink_channel(ept);
15801583

drivers/rpmsg/qcom_smd.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -960,28 +960,30 @@ static void qcom_smd_destroy_ept(struct rpmsg_endpoint *ept)
960960
kref_put(&ept->refcount, __ept_release);
961961
}
962962

963-
static int qcom_smd_send(struct rpmsg_endpoint *ept, void *data, int len)
963+
static int qcom_smd_send(struct rpmsg_endpoint *ept, const void *data, int len)
964964
{
965965
struct qcom_smd_endpoint *qsept = to_smd_endpoint(ept);
966966

967967
return __qcom_smd_send(qsept->qsch, data, len, true);
968968
}
969969

970-
static int qcom_smd_trysend(struct rpmsg_endpoint *ept, void *data, int len)
970+
static int qcom_smd_trysend(struct rpmsg_endpoint *ept, const void *data, int len)
971971
{
972972
struct qcom_smd_endpoint *qsept = to_smd_endpoint(ept);
973973

974974
return __qcom_smd_send(qsept->qsch, data, len, false);
975975
}
976976

977-
static int qcom_smd_sendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst)
977+
static int qcom_smd_sendto(struct rpmsg_endpoint *ept, const void *data, int len,
978+
u32 dst)
978979
{
979980
struct qcom_smd_endpoint *qsept = to_smd_endpoint(ept);
980981

981982
return __qcom_smd_send(qsept->qsch, data, len, true);
982983
}
983984

984-
static int qcom_smd_trysendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst)
985+
static int qcom_smd_trysendto(struct rpmsg_endpoint *ept, const void *data,
986+
int len, u32 dst)
985987
{
986988
struct qcom_smd_endpoint *qsept = to_smd_endpoint(ept);
987989

drivers/rpmsg/rpmsg_core.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ EXPORT_SYMBOL(rpmsg_destroy_ept);
153153
*
154154
* Return: 0 on success and an appropriate error value on failure.
155155
*/
156-
int rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len)
156+
int rpmsg_send(struct rpmsg_endpoint *ept, const void *data, int len)
157157
{
158158
if (WARN_ON(!ept))
159159
return -EINVAL;
@@ -182,7 +182,7 @@ EXPORT_SYMBOL(rpmsg_send);
182182
*
183183
* Return: 0 on success and an appropriate error value on failure.
184184
*/
185-
int rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst)
185+
int rpmsg_sendto(struct rpmsg_endpoint *ept, const void *data, int len, u32 dst)
186186
{
187187
if (WARN_ON(!ept))
188188
return -EINVAL;
@@ -210,7 +210,7 @@ EXPORT_SYMBOL(rpmsg_sendto);
210210
*
211211
* Return: 0 on success and an appropriate error value on failure.
212212
*/
213-
int rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len)
213+
int rpmsg_trysend(struct rpmsg_endpoint *ept, const void *data, int len)
214214
{
215215
if (WARN_ON(!ept))
216216
return -EINVAL;
@@ -238,7 +238,7 @@ EXPORT_SYMBOL(rpmsg_trysend);
238238
*
239239
* Return: 0 on success and an appropriate error value on failure.
240240
*/
241-
int rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst)
241+
int rpmsg_trysendto(struct rpmsg_endpoint *ept, const void *data, int len, u32 dst)
242242
{
243243
if (WARN_ON(!ept))
244244
return -EINVAL;
@@ -650,7 +650,7 @@ static int __init rpmsg_init(void)
650650
ret = bus_register(&rpmsg_bus);
651651
if (ret) {
652652
pr_err("failed to register rpmsg bus: %d\n", ret);
653-
class_destroy(&rpmsg_class);
653+
class_unregister(&rpmsg_class);
654654
}
655655
return ret;
656656
}
@@ -659,7 +659,7 @@ postcore_initcall(rpmsg_init);
659659
static void __exit rpmsg_fini(void)
660660
{
661661
bus_unregister(&rpmsg_bus);
662-
class_destroy(&rpmsg_class);
662+
class_unregister(&rpmsg_class);
663663
}
664664
module_exit(rpmsg_fini);
665665

drivers/rpmsg/rpmsg_internal.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ struct rpmsg_device_ops {
6363
struct rpmsg_endpoint_ops {
6464
void (*destroy_ept)(struct rpmsg_endpoint *ept);
6565

66-
int (*send)(struct rpmsg_endpoint *ept, void *data, int len);
67-
int (*sendto)(struct rpmsg_endpoint *ept, void *data, int len, u32 dst);
66+
int (*send)(struct rpmsg_endpoint *ept, const void *data, int len);
67+
int (*sendto)(struct rpmsg_endpoint *ept, const void *data, int len, u32 dst);
6868

69-
int (*trysend)(struct rpmsg_endpoint *ept, void *data, int len);
70-
int (*trysendto)(struct rpmsg_endpoint *ept, void *data, int len, u32 dst);
69+
int (*trysend)(struct rpmsg_endpoint *ept, const void *data, int len);
70+
int (*trysendto)(struct rpmsg_endpoint *ept, const void *data, int len, u32 dst);
7171
__poll_t (*poll)(struct rpmsg_endpoint *ept, struct file *filp,
7272
poll_table *wait);
7373
int (*set_flow_control)(struct rpmsg_endpoint *ept, bool pause, u32 dst);

drivers/rpmsg/virtio_rpmsg_bus.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,12 @@ struct virtio_rpmsg_channel {
136136
#define RPMSG_RESERVED_ADDRESSES (1024)
137137

138138
static void virtio_rpmsg_destroy_ept(struct rpmsg_endpoint *ept);
139-
static int virtio_rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len);
140-
static int virtio_rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len,
141-
u32 dst);
142-
static int virtio_rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len);
143-
static int virtio_rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data,
139+
static int virtio_rpmsg_send(struct rpmsg_endpoint *ept, const void *data, int len);
140+
static int virtio_rpmsg_sendto(struct rpmsg_endpoint *ept, const void *data,
141+
int len, u32 dst);
142+
static int virtio_rpmsg_trysend(struct rpmsg_endpoint *ept, const void *data,
143+
int len);
144+
static int virtio_rpmsg_trysendto(struct rpmsg_endpoint *ept, const void *data,
144145
int len, u32 dst);
145146
static __poll_t virtio_rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp,
146147
poll_table *wait);
@@ -490,7 +491,7 @@ static void *get_a_tx_buf(struct virtproc_info *vrp)
490491
*/
491492
static int rpmsg_send_offchannel_raw(struct rpmsg_device *rpdev,
492493
u32 src, u32 dst,
493-
void *data, int len, bool wait)
494+
const void *data, int len, bool wait)
494495
{
495496
struct virtio_rpmsg_channel *vch = to_virtio_rpmsg_channel(rpdev);
496497
struct virtproc_info *vrp = vch->vrp;
@@ -580,32 +581,33 @@ static int rpmsg_send_offchannel_raw(struct rpmsg_device *rpdev,
580581
return err;
581582
}
582583

583-
static int virtio_rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len)
584+
static int virtio_rpmsg_send(struct rpmsg_endpoint *ept, const void *data, int len)
584585
{
585586
struct rpmsg_device *rpdev = ept->rpdev;
586587
u32 src = ept->addr, dst = rpdev->dst;
587588

588589
return rpmsg_send_offchannel_raw(rpdev, src, dst, data, len, true);
589590
}
590591

591-
static int virtio_rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len,
592-
u32 dst)
592+
static int virtio_rpmsg_sendto(struct rpmsg_endpoint *ept, const void *data,
593+
int len, u32 dst)
593594
{
594595
struct rpmsg_device *rpdev = ept->rpdev;
595596
u32 src = ept->addr;
596597

597598
return rpmsg_send_offchannel_raw(rpdev, src, dst, data, len, true);
598599
}
599600

600-
static int virtio_rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len)
601+
static int virtio_rpmsg_trysend(struct rpmsg_endpoint *ept, const void *data,
602+
int len)
601603
{
602604
struct rpmsg_device *rpdev = ept->rpdev;
603605
u32 src = ept->addr, dst = rpdev->dst;
604606

605607
return rpmsg_send_offchannel_raw(rpdev, src, dst, data, len, false);
606608
}
607609

608-
static int virtio_rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data,
610+
static int virtio_rpmsg_trysendto(struct rpmsg_endpoint *ept, const void *data,
609611
int len, u32 dst)
610612
{
611613
struct rpmsg_device *rpdev = ept->rpdev;

drivers/soc/qcom/apr.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ gpr_port_t *gpr_alloc_port(struct apr_device *gdev, struct device *dev,
123123
}
124124
EXPORT_SYMBOL_GPL(gpr_alloc_port);
125125

126-
static int pkt_router_send_svc_pkt(struct pkt_router_svc *svc, struct gpr_pkt *pkt)
126+
static int pkt_router_send_svc_pkt(struct pkt_router_svc *svc, const struct gpr_pkt *pkt)
127127
{
128128
struct packet_router *pr = svc->pr;
129-
struct gpr_hdr *hdr;
129+
const struct gpr_hdr *hdr;
130130
unsigned long flags;
131131
int ret;
132132

@@ -139,13 +139,13 @@ static int pkt_router_send_svc_pkt(struct pkt_router_svc *svc, struct gpr_pkt *p
139139
return ret ? ret : hdr->pkt_size;
140140
}
141141

142-
int gpr_send_pkt(struct apr_device *gdev, struct gpr_pkt *pkt)
142+
int gpr_send_pkt(struct apr_device *gdev, const struct gpr_pkt *pkt)
143143
{
144144
return pkt_router_send_svc_pkt(&gdev->svc, pkt);
145145
}
146146
EXPORT_SYMBOL_GPL(gpr_send_pkt);
147147

148-
int gpr_send_port_pkt(gpr_port_t *port, struct gpr_pkt *pkt)
148+
int gpr_send_port_pkt(gpr_port_t *port, const struct gpr_pkt *pkt)
149149
{
150150
return pkt_router_send_svc_pkt(port, pkt);
151151
}

0 commit comments

Comments
 (0)