Skip to content

Commit 1637a94

Browse files
cgrogregkh
authored andcommitted
staging: most: core: remove sysfs attr remove_link
This patch removes the sysfs attribute remove_link, as it is not needed anymore since the introduction of the configfs configuration interface. Signed-off-by: Christian Gromm <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 83072c3 commit 1637a94

File tree

1 file changed

+0
-86
lines changed

1 file changed

+0
-86
lines changed

drivers/staging/most/core.c

Lines changed: 0 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -520,48 +520,6 @@ static ssize_t components_show(struct device_driver *drv, char *buf)
520520
return offs;
521521
}
522522

523-
/**
524-
* split_string - parses buf and extracts ':' separated substrings.
525-
*
526-
* @buf: complete string from attribute 'add_channel'
527-
* @a: storage for 1st substring (=interface name)
528-
* @b: storage for 2nd substring (=channel name)
529-
* @c: storage for 3rd substring (=component name)
530-
* @d: storage optional 4th substring (=user defined name)
531-
*
532-
* Examples:
533-
*
534-
* Input: "mdev0:ch6:cdev:my_channel\n" or
535-
* "mdev0:ch6:cdev:my_channel"
536-
*
537-
* Output: *a -> "mdev0", *b -> "ch6", *c -> "cdev" *d -> "my_channel"
538-
*
539-
* Input: "mdev1:ep81:cdev\n"
540-
* Output: *a -> "mdev1", *b -> "ep81", *c -> "cdev" *d -> ""
541-
*
542-
* Input: "mdev1:ep81"
543-
* Output: *a -> "mdev1", *b -> "ep81", *c -> "cdev" *d == NULL
544-
*/
545-
static int split_string(char *buf, char **a, char **b, char **c, char **d)
546-
{
547-
*a = strsep(&buf, ":");
548-
if (!*a)
549-
return -EIO;
550-
551-
*b = strsep(&buf, ":\n");
552-
if (!*b)
553-
return -EIO;
554-
555-
*c = strsep(&buf, ":\n");
556-
if (!*c)
557-
return -EIO;
558-
559-
if (d)
560-
*d = strsep(&buf, ":\n");
561-
562-
return 0;
563-
}
564-
565523
/**
566524
* get_channel - get pointer to channel
567525
* @mdev: name of the device interface
@@ -723,48 +681,6 @@ int most_add_link(char *mdev, char *mdev_ch, char *comp_name, char *link_name,
723681
return link_channel_to_component(c, comp, link_name, comp_param);
724682
}
725683

726-
/**
727-
* remove_link_store - store function for remove_link attribute
728-
* @drv: device driver
729-
* @buf: buffer
730-
* @len: buffer length
731-
*
732-
* Example:
733-
* echo "mdev0:ep81" >remove_link
734-
*/
735-
static ssize_t remove_link_store(struct device_driver *drv,
736-
const char *buf,
737-
size_t len)
738-
{
739-
struct most_channel *c;
740-
struct core_component *comp;
741-
char buffer[STRING_SIZE];
742-
char *mdev;
743-
char *mdev_ch;
744-
char *comp_name;
745-
int ret;
746-
size_t max_len = min_t(size_t, len + 1, STRING_SIZE);
747-
748-
strlcpy(buffer, buf, max_len);
749-
ret = split_string(buffer, &mdev, &mdev_ch, &comp_name, NULL);
750-
if (ret)
751-
return ret;
752-
comp = match_component(comp_name);
753-
if (!comp)
754-
return -ENODEV;
755-
c = get_channel(mdev, mdev_ch);
756-
if (!c)
757-
return -ENODEV;
758-
759-
if (comp->disconnect_channel(c->iface, c->channel_id))
760-
return -EIO;
761-
if (c->pipe0.comp == comp)
762-
c->pipe0.comp = NULL;
763-
if (c->pipe1.comp == comp)
764-
c->pipe1.comp = NULL;
765-
return len;
766-
}
767-
768684
int most_remove_link(char *mdev, char *mdev_ch, char *comp_name)
769685
{
770686
struct most_channel *c;
@@ -790,12 +706,10 @@ int most_remove_link(char *mdev, char *mdev_ch, char *comp_name)
790706

791707
static DRIVER_ATTR_RO(links);
792708
static DRIVER_ATTR_RO(components);
793-
static DRIVER_ATTR_WO(remove_link);
794709

795710
static struct attribute *mc_attrs[] = {
796711
DRV_ATTR(links),
797712
DRV_ATTR(components),
798-
DRV_ATTR(remove_link),
799713
NULL,
800714
};
801715

0 commit comments

Comments
 (0)