Skip to content

Commit

Permalink
Add replacechar func to miyoo-video driver (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiopex authored Dec 29, 2023
1 parent ec50461 commit 437e6d5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion drivers/video/fbdev/miyoo-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,20 @@ static char *driver = "";
module_param(driver, charp, S_IRUGO);
MODULE_PARM_DESC(driver, "Name of video driver to load");

static int replacechar(char *str, char orig, char rep) {
char *ix = str;
int n = 0;
while((ix = strchr(ix, orig)) != NULL) {
*ix++ = rep;
n++;
}
return n;
}

static ssize_t miyoo_video_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
{
return sprintf(buf, "%s", driver);
replacechar(driver, '+', ' ');
return sprintf(buf, "%s", driver);
}

static ssize_t miyoo_video_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count)
Expand Down

0 comments on commit 437e6d5

Please sign in to comment.