This patch introduces attribute names that are more self explaining. Signed-off-by: Christian Gromm <christian.gromm@xxxxxxxxxxxxx> --- drivers/staging/most/configfs.c | 98 ++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/drivers/staging/most/configfs.c b/drivers/staging/most/configfs.c index cb0256a..8d6aaf9 100644 --- a/drivers/staging/most/configfs.c +++ b/drivers/staging/most/configfs.c @@ -17,8 +17,8 @@ struct mdev_link { struct config_item item; struct list_head list; - int create; - int destroy; + int create_link; + int destroy_link; u16 num_buffers; u16 buffer_size; u16 subbuffer_size; @@ -27,10 +27,10 @@ struct mdev_link { char datatype[MAX_LEN]; char direction[MAX_LEN]; char name[MAX_LEN]; - char mdev[MAX_LEN]; + char device[MAX_LEN]; char channel[MAX_LEN]; char comp[MAX_LEN]; - char param[MAX_LEN]; + char comp_params[MAX_LEN]; }; struct list_head mdev_link_list; @@ -39,7 +39,7 @@ int set_cfg_buffer_size(struct mdev_link *link) { if (!link->buffer_size) return -ENODATA; - return most_set_cfg_buffer_size(link->mdev, link->channel, + return most_set_cfg_buffer_size(link->device, link->channel, link->buffer_size); } @@ -47,7 +47,7 @@ int set_cfg_subbuffer_size(struct mdev_link *link) { if (!link->subbuffer_size) return -ENODATA; - return most_set_cfg_subbuffer_size(link->mdev, link->channel, + return most_set_cfg_subbuffer_size(link->device, link->channel, link->subbuffer_size); } @@ -55,7 +55,7 @@ int set_cfg_dbr_size(struct mdev_link *link) { if (!link->dbr_size) return -ENODATA; - return most_set_cfg_dbr_size(link->mdev, link->channel, + return most_set_cfg_dbr_size(link->device, link->channel, link->dbr_size); } @@ -63,7 +63,7 @@ int set_cfg_num_buffers(struct mdev_link *link) { if (!link->num_buffers) return -ENODATA; - return most_set_cfg_num_buffers(link->mdev, link->channel, + return most_set_cfg_num_buffers(link->device, link->channel, link->num_buffers); } @@ -71,7 +71,7 @@ int set_cfg_packets_xact(struct mdev_link *link) { if (!link->packets_per_xact) return -ENODATA; - return most_set_cfg_packets_xact(link->mdev, link->channel, + return most_set_cfg_packets_xact(link->device, link->channel, link->packets_per_xact); } @@ -79,7 +79,7 @@ int set_cfg_direction(struct mdev_link *link) { if (!strlen(link->direction)) return -ENODATA; - return most_set_cfg_direction(link->mdev, link->channel, + return most_set_cfg_direction(link->device, link->channel, link->direction); } @@ -87,7 +87,7 @@ int set_cfg_datatype(struct mdev_link *link) { if (!strlen(link->datatype)) return -ENODATA; - return most_set_cfg_datatype(link->mdev, link->channel, + return most_set_cfg_datatype(link->device, link->channel, link->datatype); } @@ -119,13 +119,13 @@ static int set_config_and_add_link(struct mdev_link *mdev_link) } } - return most_add_link(mdev_link->mdev, mdev_link->channel, + return most_add_link(mdev_link->device, mdev_link->channel, mdev_link->comp, mdev_link->name, - mdev_link->param); + mdev_link->comp_params); } -static ssize_t mdev_link_create_store(struct config_item *item, - const char *page, size_t count) +static ssize_t mdev_link_create_link_store(struct config_item *item, + const char *page, size_t count) { struct mdev_link *mdev_link = to_mdev_link(item); u16 tmp; @@ -138,7 +138,7 @@ static ssize_t mdev_link_create_store(struct config_item *item, if (tmp != 1) return -ERANGE; - if (!mdev_link->mdev || !mdev_link->channel || !mdev_link->comp) { + if (!mdev_link->device || !mdev_link->channel || !mdev_link->comp) { pr_err("Config parameters incomplete\n"); return -ENODATA; } @@ -146,12 +146,12 @@ static ssize_t mdev_link_create_store(struct config_item *item, if (ret && ret != -ENODEV) return ret; list_add_tail(&mdev_link->list, &mdev_link_list); - mdev_link->create = tmp; + mdev_link->create_link = tmp; return count; } -static ssize_t mdev_link_destroy_store(struct config_item *item, - const char *page, size_t count) +static ssize_t mdev_link_destroy_link_store(struct config_item *item, + const char *page, size_t count) { struct mdev_link *mdev_link = to_mdev_link(item); u16 tmp; @@ -163,8 +163,8 @@ static ssize_t mdev_link_destroy_store(struct config_item *item, return ret; if (tmp != 1) return -ERANGE; - mdev_link->destroy = tmp; - ret = most_remove_link(mdev_link->mdev, mdev_link->channel, + mdev_link->destroy_link = tmp; + ret = most_remove_link(mdev_link->device, mdev_link->channel, mdev_link->comp); if (ret) return ret; @@ -210,18 +210,18 @@ static ssize_t mdev_link_datatype_store(struct config_item *item, return count; } -static ssize_t mdev_link_mdev_show(struct config_item *item, char *page) +static ssize_t mdev_link_device_show(struct config_item *item, char *page) { - return sprintf(page, "%s\n", to_mdev_link(item)->mdev); + return sprintf(page, "%s\n", to_mdev_link(item)->device); } -static ssize_t mdev_link_mdev_store(struct config_item *item, - const char *page, size_t count) +static ssize_t mdev_link_device_store(struct config_item *item, + const char *page, size_t count) { struct mdev_link *mdev_link = to_mdev_link(item); char *p = (char *)page; - strcpy(mdev_link->mdev, p); + strcpy(mdev_link->device, p); return count; } @@ -256,18 +256,18 @@ static ssize_t mdev_link_comp_store(struct config_item *item, return count; } -static ssize_t mdev_link_param_show(struct config_item *item, char *page) +static ssize_t mdev_link_comp_params_show(struct config_item *item, char *page) { - return sprintf(page, "%s\n", to_mdev_link(item)->param); + return sprintf(page, "%s\n", to_mdev_link(item)->comp_params); } -static ssize_t mdev_link_param_store(struct config_item *item, - const char *page, size_t count) +static ssize_t mdev_link_comp_params_store(struct config_item *item, + const char *page, size_t count) { struct mdev_link *mdev_link = to_mdev_link(item); char *p = (char *)page; - strcpy(mdev_link->param, p); + strcpy(mdev_link->comp_params, p); return count; } @@ -364,12 +364,12 @@ static ssize_t mdev_link_dbr_size_store(struct config_item *item, return count; } -CONFIGFS_ATTR_WO(mdev_link_, create); -CONFIGFS_ATTR_WO(mdev_link_, destroy); -CONFIGFS_ATTR(mdev_link_, mdev); +CONFIGFS_ATTR_WO(mdev_link_, create_link); +CONFIGFS_ATTR_WO(mdev_link_, destroy_link); +CONFIGFS_ATTR(mdev_link_, device); CONFIGFS_ATTR(mdev_link_, channel); CONFIGFS_ATTR(mdev_link_, comp); -CONFIGFS_ATTR(mdev_link_, param); +CONFIGFS_ATTR(mdev_link_, comp_params); CONFIGFS_ATTR(mdev_link_, num_buffers); CONFIGFS_ATTR(mdev_link_, buffer_size); CONFIGFS_ATTR(mdev_link_, subbuffer_size); @@ -379,12 +379,12 @@ CONFIGFS_ATTR(mdev_link_, direction); CONFIGFS_ATTR(mdev_link_, dbr_size); static struct configfs_attribute *mdev_link_attrs[] = { - &mdev_link_attr_create, - &mdev_link_attr_destroy, - &mdev_link_attr_mdev, + &mdev_link_attr_create_link, + &mdev_link_attr_destroy_link, + &mdev_link_attr_device, &mdev_link_attr_channel, &mdev_link_attr_comp, - &mdev_link_attr_param, + &mdev_link_attr_comp_params, &mdev_link_attr_num_buffers, &mdev_link_attr_buffer_size, &mdev_link_attr_subbuffer_size, @@ -401,7 +401,7 @@ static void mdev_link_release(struct config_item *item) int ret; if (!list_empty(&mdev_link_list)) { - ret = most_remove_link(mdev_link->mdev, mdev_link->channel, + ret = most_remove_link(mdev_link->device, mdev_link->channel, mdev_link->comp); if (ret && (ret != -ENODEV)) pr_err("Removing link failed.\n"); @@ -500,7 +500,7 @@ static struct configfs_subsystem most_video_subsys = { struct most_snd_grp { struct config_group group; - int create; + int create_card; struct list_head list; }; @@ -520,14 +520,14 @@ static struct config_item *most_snd_grp_make_item(struct config_group *group, return ERR_PTR(-ENOMEM); config_item_init_type_name(&mdev_link->item, name, &mdev_link_type); - mdev_link->create = 0; + mdev_link->create_link = 0; strcpy(mdev_link->name, name); strcpy(mdev_link->comp, "sound"); return &mdev_link->item; } -static ssize_t most_snd_grp_create_store(struct config_item *item, - const char *page, size_t count) +static ssize_t most_snd_grp_create_card_store(struct config_item *item, + const char *page, size_t count) { struct most_snd_grp *snd_grp = to_most_snd_grp(item); int ret = 0; @@ -544,14 +544,14 @@ static ssize_t most_snd_grp_create_store(struct config_item *item, if (ret) return ret; } - snd_grp->create = tmp; + snd_grp->create_card = tmp; return count; } -CONFIGFS_ATTR_WO(most_snd_grp_, create); +CONFIGFS_ATTR_WO(most_snd_grp_, create_card); static struct configfs_attribute *most_snd_grp_attrs[] = { - &most_snd_grp_attr_create, + &most_snd_grp_attr_create_card, NULL, }; @@ -597,7 +597,7 @@ static struct config_group *most_sound_make_group(struct config_group *group, struct most_sound, subsys); list_for_each_entry(most, &ms->soundcard_list, list) { - if (!most->create) { + if (!most->create_card) { pr_info("adapter configuration still in progress.\n"); return ERR_PTR(-EPROTO); } @@ -661,7 +661,7 @@ void most_interface_register_notify(const char *mdev) struct mdev_link *mdev_link; list_for_each_entry(mdev_link, &mdev_link_list, list) { - if (!strcmp(mdev_link->mdev, mdev)) { + if (!strcmp(mdev_link->device, mdev)) { set_config_and_add_link(mdev_link); if (!strcmp(mdev_link->comp, "sound")) register_snd_card = true; -- 2.7.4 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel