@@ -289,7 +289,7 @@ static inline void rpmsg_init_ept(struct rpmsg_endpoint *ept,
289
289
rpmsg_ept_cb cb ,
290
290
rpmsg_ns_unbind_cb ns_unbind_cb )
291
291
{
292
- strncpy (ept -> name , name , sizeof (ept -> name ));
292
+ strncpy (ept -> name , name ? name : "" , sizeof (ept -> name ));
293
293
ept -> addr = src ;
294
294
ept -> dest_addr = dest ;
295
295
ept -> cb = cb ;
@@ -326,6 +326,31 @@ int rpmsg_create_ept(struct rpmsg_endpoint *ept, struct rpmsg_device *rdev,
326
326
const char * name , uint32_t src , uint32_t dest ,
327
327
rpmsg_ept_cb cb , rpmsg_ns_unbind_cb ns_unbind_cb );
328
328
329
+
330
+ /**
331
+ * rpmsg_create_anon_ept - like rpmsg_create_ept but without name
332
+ *
333
+ * Create a RPMsg endpoint, initialize it with source address,
334
+ * remoteproc address and endpoint callback, and register it to
335
+ * the RPMsg device.
336
+ *
337
+ * @ept: pointer to rpmsg endpoint
338
+ * @src: local address of the endpoint
339
+ * @dest: target address of the endpoint
340
+ * @cb: endpoint callback
341
+ *
342
+ * In essence, an rpmsg endpoint represents a listener on the rpmsg bus, as
343
+ * it binds an rpmsg address with an rx callback handler.
344
+ */
345
+
346
+ static inline int rpmsg_create_anon_ept (struct rpmsg_endpoint * ept ,
347
+ struct rpmsg_device * rdev ,
348
+ uint32_t src , uint32_t dest ,
349
+ rpmsg_ept_cb cb )
350
+ {
351
+ return rpmsg_create_ept (ept , rdev , NULL , src , dest , cb , NULL );
352
+ }
353
+
329
354
/**
330
355
* rpmsg_destroy_ept - destroy rpmsg endpoint and unregister it from rpmsg
331
356
* device
0 commit comments