From d2f3f10b352915e7eecd88af144fb6cdd1fdd8a6 Mon Sep 17 00:00:00 2001 From: tiopex Date: Fri, 29 Dec 2023 09:11:48 +0100 Subject: [PATCH] Add replacechar func to miyoo-video driver --- drivers/video/fbdev/miyoo-video.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/miyoo-video.c b/drivers/video/fbdev/miyoo-video.c index a750a2cde..7c726e940 100644 --- a/drivers/video/fbdev/miyoo-video.c +++ b/drivers/video/fbdev/miyoo-video.c @@ -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)