summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@linaro.org>2016-09-01 15:27:57 -0700
committerBjorn Andersson <bjorn.andersson@linaro.org>2016-09-08 22:15:20 -0700
commit92e1de51bf2cb8d49adc8925abe56ce84911a232 (patch)
tree24a48c667cb9fbcc6af5943c5ef3a3ed5e7bcd32 /drivers
parent2b263d2408663a36c14a0aa1f765b2c84b92ea18 (diff)
rpmsg: Clean up rpmsg device vs channel naming
The rpmsg device representing struct is called rpmsg_channel and the variable name used throughout is rpdev, with the communication happening on endpoints it's clearer to just call this a "device" in a public API. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/rpmsg/virtio_rpmsg_bus.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c
index 7c7c6a8b21d9..1ac9fd871760 100644
--- a/drivers/rpmsg/virtio_rpmsg_bus.c
+++ b/drivers/rpmsg/virtio_rpmsg_bus.c
@@ -73,7 +73,7 @@ struct virtproc_info {
struct rpmsg_endpoint *ns_ept;
};
-#define to_rpmsg_channel(d) container_of(d, struct rpmsg_channel, dev)
+#define to_rpmsg_device(d) container_of(d, struct rpmsg_device, dev)
#define to_rpmsg_driver(d) container_of(d, struct rpmsg_driver, drv)
/*
@@ -113,7 +113,7 @@ static ssize_t \
field##_show(struct device *dev, \
struct device_attribute *attr, char *buf) \
{ \
- struct rpmsg_channel *rpdev = to_rpmsg_channel(dev); \
+ struct rpmsg_device *rpdev = to_rpmsg_device(dev); \
\
return sprintf(buf, format_string, rpdev->path); \
}
@@ -127,7 +127,7 @@ rpmsg_show_attr(announce, announce ? "true" : "false", "%s\n");
static ssize_t modalias_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct rpmsg_channel *rpdev = to_rpmsg_channel(dev);
+ struct rpmsg_device *rpdev = to_rpmsg_device(dev);
return sprintf(buf, RPMSG_DEVICE_MODALIAS_FMT "\n", rpdev->id.name);
}
@@ -142,7 +142,7 @@ static struct device_attribute rpmsg_dev_attrs[] = {
};
/* rpmsg devices and drivers are matched using the service name */
-static inline int rpmsg_id_match(const struct rpmsg_channel *rpdev,
+static inline int rpmsg_id_match(const struct rpmsg_device *rpdev,
const struct rpmsg_device_id *id)
{
return strncmp(id->name, rpdev->id.name, RPMSG_NAME_SIZE) == 0;
@@ -151,7 +151,7 @@ static inline int rpmsg_id_match(const struct rpmsg_channel *rpdev,
/* match rpmsg channel and rpmsg driver */
static int rpmsg_dev_match(struct device *dev, struct device_driver *drv)
{
- struct rpmsg_channel *rpdev = to_rpmsg_channel(dev);
+ struct rpmsg_device *rpdev = to_rpmsg_device(dev);
struct rpmsg_driver *rpdrv = to_rpmsg_driver(drv);
const struct rpmsg_device_id *ids = rpdrv->id_table;
unsigned int i;
@@ -166,7 +166,7 @@ static int rpmsg_dev_match(struct device *dev, struct device_driver *drv)
static int rpmsg_uevent(struct device *dev, struct kobj_uevent_env *env)
{
- struct rpmsg_channel *rpdev = to_rpmsg_channel(dev);
+ struct rpmsg_device *rpdev = to_rpmsg_device(dev);
return add_uevent_var(env, "MODALIAS=" RPMSG_DEVICE_MODALIAS_FMT,
rpdev->id.name);
@@ -194,7 +194,7 @@ static void __ept_release(struct kref *kref)
/* for more info, see below documentation of rpmsg_create_ept() */
static struct rpmsg_endpoint *__rpmsg_create_ept(struct virtproc_info *vrp,
- struct rpmsg_channel *rpdev,
+ struct rpmsg_device *rpdev,
rpmsg_rx_cb_t cb,
void *priv, u32 addr)
{
@@ -282,7 +282,7 @@ free_ept:
*
* Returns a pointer to the endpoint on success, or NULL on error.
*/
-struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_channel *rpdev,
+struct rpmsg_endpoint *rpmsg_create_ept(struct rpmsg_device *rpdev,
rpmsg_rx_cb_t cb, void *priv,
struct rpmsg_channel_info chinfo)
{
@@ -339,7 +339,7 @@ EXPORT_SYMBOL(rpmsg_destroy_ept);
*/
static int rpmsg_dev_probe(struct device *dev)
{
- struct rpmsg_channel *rpdev = to_rpmsg_channel(dev);
+ struct rpmsg_device *rpdev = to_rpmsg_device(dev);
struct rpmsg_driver *rpdrv = to_rpmsg_driver(rpdev->dev.driver);
struct virtproc_info *vrp = rpdev->vrp;
struct rpmsg_channel_info chinfo = {};
@@ -387,7 +387,7 @@ out:
static int rpmsg_dev_remove(struct device *dev)
{
- struct rpmsg_channel *rpdev = to_rpmsg_channel(dev);
+ struct rpmsg_device *rpdev = to_rpmsg_device(dev);
struct rpmsg_driver *rpdrv = to_rpmsg_driver(rpdev->dev.driver);
struct virtproc_info *vrp = rpdev->vrp;
int err = 0;
@@ -451,7 +451,7 @@ EXPORT_SYMBOL(unregister_rpmsg_driver);
static void rpmsg_release_device(struct device *dev)
{
- struct rpmsg_channel *rpdev = to_rpmsg_channel(dev);
+ struct rpmsg_device *rpdev = to_rpmsg_device(dev);
kfree(rpdev);
}
@@ -461,10 +461,10 @@ static void rpmsg_release_device(struct device *dev)
* this is used to make sure we're not creating rpmsg devices for channels
* that already exist.
*/
-static int rpmsg_channel_match(struct device *dev, void *data)
+static int rpmsg_device_match(struct device *dev, void *data)
{
struct rpmsg_channel_info *chinfo = data;
- struct rpmsg_channel *rpdev = to_rpmsg_channel(dev);
+ struct rpmsg_device *rpdev = to_rpmsg_device(dev);
if (chinfo->src != RPMSG_ADDR_ANY && chinfo->src != rpdev->src)
return 0;
@@ -484,15 +484,15 @@ static int rpmsg_channel_match(struct device *dev, void *data)
* this function will be used to create both static and dynamic
* channels.
*/
-static struct rpmsg_channel *rpmsg_create_channel(struct virtproc_info *vrp,
- struct rpmsg_channel_info *chinfo)
+static struct rpmsg_device *rpmsg_create_channel(struct virtproc_info *vrp,
+ struct rpmsg_channel_info *chinfo)
{
- struct rpmsg_channel *rpdev;
+ struct rpmsg_device *rpdev;
struct device *tmp, *dev = &vrp->vdev->dev;
int ret;
/* make sure a similar channel doesn't already exist */
- tmp = device_find_child(dev, chinfo, rpmsg_channel_match);
+ tmp = device_find_child(dev, chinfo, rpmsg_device_match);
if (tmp) {
/* decrement the matched device's refcount back */
put_device(tmp);
@@ -544,7 +544,7 @@ static int rpmsg_destroy_channel(struct virtproc_info *vrp,
struct virtio_device *vdev = vrp->vdev;
struct device *dev;
- dev = device_find_child(&vdev->dev, chinfo, rpmsg_channel_match);
+ dev = device_find_child(&vdev->dev, chinfo, rpmsg_device_match);
if (!dev)
return -EINVAL;
@@ -669,7 +669,7 @@ static void rpmsg_downref_sleepers(struct virtproc_info *vrp)
*
* Returns 0 on success and an appropriate error value on failure.
*/
-int rpmsg_send_offchannel_raw(struct rpmsg_channel *rpdev, u32 src, u32 dst,
+int rpmsg_send_offchannel_raw(struct rpmsg_device *rpdev, u32 src, u32 dst,
void *data, int len, bool wait)
{
struct virtproc_info *vrp = rpdev->vrp;
@@ -879,11 +879,11 @@ static void rpmsg_xmit_done(struct virtqueue *svq)
}
/* invoked when a name service announcement arrives */
-static void rpmsg_ns_cb(struct rpmsg_channel *rpdev, void *data, int len,
+static void rpmsg_ns_cb(struct rpmsg_device *rpdev, void *data, int len,
void *priv, u32 src)
{
struct rpmsg_ns_msg *msg = data;
- struct rpmsg_channel *newch;
+ struct rpmsg_device *newch;
struct rpmsg_channel_info chinfo;
struct virtproc_info *vrp = priv;
struct device *dev = &vrp->vdev->dev;