History

Merge tag 'rpmsg-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux

Pull rpmsg updates from Bjorn Andersson: "This adds pr_fmt for the rpmsg_char driver, fixes error handling in rpmsg_dev_probe() and corrects the spelling of "Return:" in various places, in order to fix kerneldoc" * tag 'rpmsg-v5.17' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux: rpmsg: core: Clean up resources on announce_create failure. rpmsg: Fix documentation return formatting rpmsg: char: Add pr_fmt() to prefix messages

Linus Torvalds committed 4 years ago

Commit fc9d6952 parents 722d948 8066c615 files · +36 −21Browse files

Unified · Split

5 files
  1. drivers/rpmsg/qcom_glink_native.c +1 −1
  2. drivers/rpmsg/qcom_smd.c +1 −1
  3. drivers/rpmsg/rpmsg_char.c +5 −2
  4. drivers/rpmsg/rpmsg_core.c +28 −16
  5. drivers/rpmsg/virtio_rpmsg_bus.c +1 −1
drivers/rpmsg/qcom_glink_native.c+1−1
@@ -427,7 +427,7 @@ static void qcom_glink_handle_intent_req_ack(struct qcom_glink *glink, · 426 unmodified lines
427 * Allocates a local channel id and sends a RPM_CMD_OPEN message to the remote.427 * Allocates a local channel id and sends a RPM_CMD_OPEN message to the remote.
428 * Will return with refcount held, regardless of outcome.428 * Will return with refcount held, regardless of outcome.
429 *429 *
430 * Returns 0 on success, negative errno otherwise.430 * Return: 0 on success, negative errno otherwise.
431 */431 */
432static int qcom_glink_send_open_req(struct qcom_glink *glink,432static int qcom_glink_send_open_req(struct qcom_glink *glink,
433 struct glink_channel *channel)433 struct glink_channel *channel)
drivers/rpmsg/qcom_smd.c+1−1
@@ -1467,7 +1467,7 @@ ATTRIBUTE_GROUPS(qcom_smd_edge); · 1466 unmodified lines
1467 * @parent: parent device for the edge1467 * @parent: parent device for the edge
1468 * @node: device_node describing the edge1468 * @node: device_node describing the edge
1469 *1469 *
1470 * Returns an edge reference, or negative ERR_PTR() on failure.1470 * Return: an edge reference, or negative ERR_PTR() on failure.
1471 */1471 */
1472struct qcom_smd_edge *qcom_smd_register_edge(struct device *parent,1472struct qcom_smd_edge *qcom_smd_register_edge(struct device *parent,
1473 struct device_node *node)1473 struct device_node *node)
drivers/rpmsg/rpmsg_char.c+5−2
@@ -9,6 +9,9 @@ · 8 unmodified lines
9 * Based on rpmsg performance statistics driver by Michal Simek, which in turn9 * Based on rpmsg performance statistics driver by Michal Simek, which in turn
10 * was based on TI & Google OMX rpmsg driver.10 * was based on TI & Google OMX rpmsg driver.
11 */11 */
12
13#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
14
12#include <linux/cdev.h>15#include <linux/cdev.h>
13#include <linux/device.h>16#include <linux/device.h>
14#include <linux/fs.h>17#include <linux/fs.h>
@@ -550,7 +553,7 @@ static int rpmsg_chrdev_init(void) · 535 unmodified lines
550 553
551 ret = alloc_chrdev_region(&rpmsg_major, 0, RPMSG_DEV_MAX, "rpmsg");554 ret = alloc_chrdev_region(&rpmsg_major, 0, RPMSG_DEV_MAX, "rpmsg");
552 if (ret < 0) {555 if (ret < 0) {
553 pr_err("rpmsg: failed to allocate char dev region\n");556 pr_err("failed to allocate char dev region\n");
554 return ret;557 return ret;
555 }558 }
556 559
@@ -563,7 +566,7 @@ static int rpmsg_chrdev_init(void) · 6 unmodified lines
563 566
564 ret = register_rpmsg_driver(&rpmsg_chrdev_driver);567 ret = register_rpmsg_driver(&rpmsg_chrdev_driver);
565 if (ret < 0) {568 if (ret < 0) {
566 pr_err("rpmsgchr: failed to register rpmsg driver\n");569 pr_err("failed to register rpmsg driver\n");
567 class_destroy(rpmsg_class);570 class_destroy(rpmsg_class);
568 unregister_chrdev_region(rpmsg_major, RPMSG_DEV_MAX);571 unregister_chrdev_region(rpmsg_major, RPMSG_DEV_MAX);
569 }572 }
drivers/rpmsg/rpmsg_core.c+28−16
@@ -26,7 +26,7 @@ · 25 unmodified lines
26 * @rpdev: rpmsg device26 * @rpdev: rpmsg device
27 * @chinfo: channel_info to bind27 * @chinfo: channel_info to bind
28 *28 *
29 * Returns a pointer to the new rpmsg device on success, or NULL on error.29 * Return: a pointer to the new rpmsg device on success, or NULL on error.
30 */30 */
31struct rpmsg_device *rpmsg_create_channel(struct rpmsg_device *rpdev,31struct rpmsg_device *rpmsg_create_channel(struct rpmsg_device *rpdev,
32 struct rpmsg_channel_info *chinfo)32 struct rpmsg_channel_info *chinfo)
@@ -48,7 +48,7 @@ EXPORT_SYMBOL(rpmsg_create_channel); · 15 unmodified lines
48 * @rpdev: rpmsg device48 * @rpdev: rpmsg device
49 * @chinfo: channel_info to bind49 * @chinfo: channel_info to bind
50 *50 *
51 * Returns 0 on success or an appropriate error value.51 * Return: 0 on success or an appropriate error value.
52 */52 */
53int rpmsg_release_channel(struct rpmsg_device *rpdev,53int rpmsg_release_channel(struct rpmsg_device *rpdev,
54 struct rpmsg_channel_info *chinfo)54 struct rpmsg_channel_info *chinfo)
@@ -102,7 +102,7 @@ EXPORT_SYMBOL(rpmsg_release_channel); · 47 unmodified lines
102 * dynamically assign them an available rpmsg address (drivers should have102 * dynamically assign them an available rpmsg address (drivers should have
103 * a very good reason why not to always use RPMSG_ADDR_ANY here).103 * a very good reason why not to always use RPMSG_ADDR_ANY here).
104 *104 *
105 * Returns a pointer to the endpoint on success, or NULL on error.105 * Return: a pointer to the endpoint on success, or NULL on error.
106 */106 */
107struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_device *rpdev,107struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_device *rpdev,
108 rpmsg_rx_cb_t cb, void *priv,108 rpmsg_rx_cb_t cb, void *priv,
@@ -146,7 +146,7 @@ EXPORT_SYMBOL(rpmsg_destroy_ept); · 37 unmodified lines
146 *146 *
147 * Can only be called from process context (for now).147 * Can only be called from process context (for now).
148 *148 *
149 * Returns 0 on success and an appropriate error value on failure.149 * Return: 0 on success and an appropriate error value on failure.
150 */150 */
151int rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len)151int rpmsg_send(struct rpmsg_endpoint *ept, void *data, int len)
152{152{
@@ -175,7 +175,7 @@ EXPORT_SYMBOL(rpmsg_send); · 22 unmodified lines
175 *175 *
176 * Can only be called from process context (for now).176 * Can only be called from process context (for now).
177 *177 *
178 * Returns 0 on success and an appropriate error value on failure.178 * Return: 0 on success and an appropriate error value on failure.
179 */179 */
180int rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst)180int rpmsg_sendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst)
181{181{
@@ -206,7 +206,7 @@ EXPORT_SYMBOL(rpmsg_sendto); · 24 unmodified lines
206 *206 *
207 * Can only be called from process context (for now).207 * Can only be called from process context (for now).
208 *208 *
209 * Returns 0 on success and an appropriate error value on failure.209 * Return: 0 on success and an appropriate error value on failure.
210 */210 */
211int rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst,211int rpmsg_send_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst,
212 void *data, int len)212 void *data, int len)
@@ -235,7 +235,7 @@ EXPORT_SYMBOL(rpmsg_send_offchannel); · 22 unmodified lines
235 *235 *
236 * Can only be called from process context (for now).236 * Can only be called from process context (for now).
237 *237 *
238 * Returns 0 on success and an appropriate error value on failure.238 * Return: 0 on success and an appropriate error value on failure.
239 */239 */
240int rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len)240int rpmsg_trysend(struct rpmsg_endpoint *ept, void *data, int len)
241{241{
@@ -263,7 +263,7 @@ EXPORT_SYMBOL(rpmsg_trysend); · 21 unmodified lines
263 *263 *
264 * Can only be called from process context (for now).264 * Can only be called from process context (for now).
265 *265 *
266 * Returns 0 on success and an appropriate error value on failure.266 * Return: 0 on success and an appropriate error value on failure.
267 */267 */
268int rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst)268int rpmsg_trysendto(struct rpmsg_endpoint *ept, void *data, int len, u32 dst)
269{269{
@@ -282,7 +282,7 @@ EXPORT_SYMBOL(rpmsg_trysendto); · 12 unmodified lines
282 * @filp: file for poll_wait()282 * @filp: file for poll_wait()
283 * @wait: poll_table for poll_wait()283 * @wait: poll_table for poll_wait()
284 *284 *
285 * Returns mask representing the current state of the endpoint's send buffers285 * Return: mask representing the current state of the endpoint's send buffers
286 */286 */
287__poll_t rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp,287__poll_t rpmsg_poll(struct rpmsg_endpoint *ept, struct file *filp,
288 poll_table *wait)288 poll_table *wait)
@@ -313,7 +313,7 @@ EXPORT_SYMBOL(rpmsg_poll); · 24 unmodified lines
313 *313 *
314 * Can only be called from process context (for now).314 * Can only be called from process context (for now).
315 *315 *
316 * Returns 0 on success and an appropriate error value on failure.316 * Return: 0 on success and an appropriate error value on failure.
317 */317 */
318int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst,318int rpmsg_trysend_offchannel(struct rpmsg_endpoint *ept, u32 src, u32 dst,
319 void *data, int len)319 void *data, int len)
@@ -540,13 +540,25 @@ static int rpmsg_dev_probe(struct device *dev) · 220 unmodified lines
540 err = rpdrv->probe(rpdev);540 err = rpdrv->probe(rpdev);
541 if (err) {541 if (err) {
542 dev_err(dev, "%s: failed: %d\n", __func__, err);542 dev_err(dev, "%s: failed: %d\n", __func__, err);
543 if (ept)543 goto destroy_ept;
544 rpmsg_destroy_ept(ept);
545 goto out;
546 }544 }
547 545
548 if (ept && rpdev->ops->announce_create)546 if (ept && rpdev->ops->announce_create) {
549 err = rpdev->ops->announce_create(rpdev);547 err = rpdev->ops->announce_create(rpdev);
548 if (err) {
549 dev_err(dev, "failed to announce creation\n");
550 goto remove_rpdev;
551 }
552 }
553
554 return 0;
555
556remove_rpdev:
557 if (rpdrv->remove)
558 rpdrv->remove(rpdev);
559destroy_ept:
560 if (ept)
561 rpmsg_destroy_ept(ept);
550out:562out:
551 return err;563 return err;
552}564}
@@ -623,7 +635,7 @@ EXPORT_SYMBOL(rpmsg_unregister_device); · 70 unmodified lines
623 * @rpdrv: pointer to a struct rpmsg_driver635 * @rpdrv: pointer to a struct rpmsg_driver
624 * @owner: owning module/driver636 * @owner: owning module/driver
625 *637 *
626 * Returns 0 on success, and an appropriate error value on failure.638 * Return: 0 on success, and an appropriate error value on failure.
627 */639 */
628int __register_rpmsg_driver(struct rpmsg_driver *rpdrv, struct module *owner)640int __register_rpmsg_driver(struct rpmsg_driver *rpdrv, struct module *owner)
629{641{
@@ -637,7 +649,7 @@ EXPORT_SYMBOL(__register_rpmsg_driver); · 7 unmodified lines
637 * unregister_rpmsg_driver() - unregister an rpmsg driver from the rpmsg bus649 * unregister_rpmsg_driver() - unregister an rpmsg driver from the rpmsg bus
638 * @rpdrv: pointer to a struct rpmsg_driver650 * @rpdrv: pointer to a struct rpmsg_driver
639 *651 *
640 * Returns 0 on success, and an appropriate error value on failure.652 * Return: 0 on success, and an appropriate error value on failure.
641 */653 */
642void unregister_rpmsg_driver(struct rpmsg_driver *rpdrv)654void unregister_rpmsg_driver(struct rpmsg_driver *rpdrv)
643{655{
drivers/rpmsg/virtio_rpmsg_bus.c+1−1
@@ -547,7 +547,7 @@ static void rpmsg_downref_sleepers(struct virtproc_info *vrp) · 546 unmodified lines
547 * should use the appropriate rpmsg_{try}send{to, _offchannel} API547 * should use the appropriate rpmsg_{try}send{to, _offchannel} API
548 * (see include/linux/rpmsg.h).548 * (see include/linux/rpmsg.h).
549 *549 *
550 * Returns 0 on success and an appropriate error value on failure.550 * Return: 0 on success and an appropriate error value on failure.
551 */551 */
552static int rpmsg_send_offchannel_raw(struct rpmsg_device *rpdev,552static int rpmsg_send_offchannel_raw(struct rpmsg_device *rpdev,
553 u32 src, u32 dst,553 u32 src, u32 dst,