* [PATCH] staging: sm750fb: remove unnecessary initializations
From: Ahmet Sezgin Duran @ 2026-05-11 17:17 UTC (permalink / raw)
To: gregkh; +Cc: linux-fbdev, linux-staging, linux-kernel, Ahmet Sezgin Duran
Remove two instances of `de_ctrl = 0` initializations since the
variable is overridden unconditionally before being used.
Signed-off-by: Ahmet Sezgin Duran <ahmet@sezginduran.net>
---
drivers/staging/sm750fb/sm750_accel.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c
index ec2f0a6aa57d..5ba1af274730 100644
--- a/drivers/staging/sm750fb/sm750_accel.c
+++ b/drivers/staging/sm750fb/sm750_accel.c
@@ -159,7 +159,6 @@ int sm750_hw_copyarea(struct lynx_accel *accel,
direction = LEFT_TO_RIGHT;
/* Direction of ROP2 operation: 1 = Left to Right, (-1) = Right to Left */
- de_ctrl = 0;
/* If source and destination are the same surface, need to check for overlay cases */
if (source_base == dest_base && source_pitch == dest_pitch) {
@@ -326,7 +325,7 @@ int sm750_hw_imageblit(struct lynx_accel *accel, const char *src_buf,
unsigned int bytes_per_scan;
unsigned int words_per_scan;
unsigned int bytes_remain;
- unsigned int de_ctrl = 0;
+ unsigned int de_ctrl;
unsigned char remain[4];
int i, j;
int ret;
--
2.54.0
^ permalink raw reply related
* [PATCH v3] staging: sm750fb: Keep g_fbmode array non-const
From: Chhabilal Dangal @ 2026-05-11 17:02 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
Cc: linux-fbdev, linux-staging, linux-kernel, Chhabilal Dangal
The g_fbmode array is modified at runtime, so it must remain
non-const. Added clarifying comment.
Signed-off-by: Chhabilal Dangal <yogeshdangal66@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 9f3e3d37e82a..a553099f42f3 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -33,6 +33,7 @@
static int g_hwcursor = 1;
static int g_noaccel;
static int g_nomtrr;
+/* intentionally non-const since array is modified at runtime */
static const char *g_fbmode[] = {NULL, NULL};
static const char *g_def_fbmode = "1024x768-32@60";
static char *g_settings;
--
2.54.0
^ permalink raw reply related
* Re: [PATCH v2] staging: sm750fb: minor coding style cleanup
From: Greg Kroah-Hartman @ 2026-05-11 16:55 UTC (permalink / raw)
To: Chhabilal Dangal
Cc: Sudip Mukherjee, Teddy Wang, linux-fbdev, linux-staging,
linux-kernel
In-Reply-To: <20260511160905.29938-1-yogeshdangal66@gmail.com>
On Mon, May 11, 2026 at 09:54:05PM +0545, Chhabilal Dangal wrote:
> Clean up various coding style issues including spacing in struct initializers and indentation of wrapped lines.
>
> Signed-off-by: Alone <yogeshdangal66@gmail.com>
> ---
> drivers/staging/sm750fb/sm750.c | 203 ++++++++++++++++----------------
> 1 file changed, 103 insertions(+), 100 deletions(-)
>
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index 9f3e3d37e82a..7fca2c9f6966 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -33,7 +33,8 @@
> static int g_hwcursor = 1;
> static int g_noaccel;
> static int g_nomtrr;
> -static const char *g_fbmode[] = {NULL, NULL};
> +/* intentionally non-const since array is modified at runtime */
> +static const char *g_fbmode[] = { NULL, NULL };
> static const char *g_def_fbmode = "1024x768-32@60";
> static char *g_settings;
> static int g_dualview;
> @@ -41,64 +42,62 @@ static char *g_option;
>
> static const struct fb_videomode lynx750_ext[] = {
> /* 1024x600-60 VESA [1.71:1] */
> - {NULL, 60, 1024, 600, 20423, 144, 40, 18, 1, 104, 3,
> - FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> - FB_VMODE_NONINTERLACED},
> + { NULL, 60, 1024, 600, 20423, 144, 40, 18, 1, 104, 3,
> + FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> + FB_VMODE_NONINTERLACED },
>
> /* 1024x600-70 VESA */
> - {NULL, 70, 1024, 600, 17211, 152, 48, 21, 1, 104, 3,
> - FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> - FB_VMODE_NONINTERLACED},
> + { NULL, 70, 1024, 600, 17211, 152, 48, 21, 1, 104, 3,
> + FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> + FB_VMODE_NONINTERLACED },
>
> /* 1024x600-75 VESA */
> - {NULL, 75, 1024, 600, 15822, 160, 56, 23, 1, 104, 3,
> - FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> - FB_VMODE_NONINTERLACED},
> + { NULL, 75, 1024, 600, 15822, 160, 56, 23, 1, 104, 3,
> + FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> + FB_VMODE_NONINTERLACED },
>
> /* 1024x600-85 VESA */
> - {NULL, 85, 1024, 600, 13730, 168, 56, 26, 1, 112, 3,
> - FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> - FB_VMODE_NONINTERLACED},
> + { NULL, 85, 1024, 600, 13730, 168, 56, 26, 1, 112, 3,
> + FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> + FB_VMODE_NONINTERLACED },
>
> /* 720x480 */
> - {NULL, 60, 720, 480, 37427, 88, 16, 13, 1, 72, 3,
> - FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> - FB_VMODE_NONINTERLACED},
> + { NULL, 60, 720, 480, 37427, 88, 16, 13, 1, 72, 3,
> + FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> + FB_VMODE_NONINTERLACED },
>
> /* 1280x720 [1.78:1] */
> - {NULL, 60, 1280, 720, 13426, 162, 86, 22, 1, 136, 3,
> - FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> - FB_VMODE_NONINTERLACED},
> + { NULL, 60, 1280, 720, 13426, 162, 86, 22, 1, 136, 3,
> + FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> + FB_VMODE_NONINTERLACED },
>
> /* 1280x768@60 */
> - {NULL, 60, 1280, 768, 12579, 192, 64, 20, 3, 128, 7,
> - FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> - FB_VMODE_NONINTERLACED},
> + { NULL, 60, 1280, 768, 12579, 192, 64, 20, 3, 128, 7,
> + FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> + FB_VMODE_NONINTERLACED },
>
> /* 1360 x 768 [1.77083:1] */
> - {NULL, 60, 1360, 768, 11804, 208, 64, 23, 1, 144, 3,
> - FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> - FB_VMODE_NONINTERLACED},
> + { NULL, 60, 1360, 768, 11804, 208, 64, 23, 1, 144, 3,
> + FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> + FB_VMODE_NONINTERLACED },
>
> /* 1368 x 768 [1.78:1] */
> - {NULL, 60, 1368, 768, 11647, 216, 72, 23, 1, 144, 3,
> - FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> - FB_VMODE_NONINTERLACED},
> + { NULL, 60, 1368, 768, 11647, 216, 72, 23, 1, 144, 3,
> + FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> + FB_VMODE_NONINTERLACED },
>
> /* 1440 x 900 [16:10] */
> - {NULL, 60, 1440, 900, 9392, 232, 80, 28, 1, 152, 3,
> - FB_SYNC_VERT_HIGH_ACT,
> - FB_VMODE_NONINTERLACED},
> + { NULL, 60, 1440, 900, 9392, 232, 80, 28, 1, 152, 3,
> + FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED },
>
> /* 1440x960 [15:10] */
> - {NULL, 60, 1440, 960, 8733, 240, 88, 30, 1, 152, 3,
> - FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> - FB_VMODE_NONINTERLACED},
> + { NULL, 60, 1440, 960, 8733, 240, 88, 30, 1, 152, 3,
> + FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
> + FB_VMODE_NONINTERLACED },
>
> /* 1920x1080 [16:9] */
> - {NULL, 60, 1920, 1080, 6734, 148, 88, 41, 1, 44, 3,
> - FB_SYNC_VERT_HIGH_ACT,
> - FB_VMODE_NONINTERLACED},
> + { NULL, 60, 1920, 1080, 6734, 148, 88, 41, 1, 44, 3,
> + FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED },
> };
>
> /* no hardware cursor supported under version 2.6.10, kernel bug */
> @@ -120,8 +119,7 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
>
> sm750_hw_cursor_disable(cursor);
> if (fbcursor->set & FB_CUR_SETSIZE)
> - sm750_hw_cursor_set_size(cursor,
> - fbcursor->image.width,
> + sm750_hw_cursor_set_size(cursor, fbcursor->image.width,
> fbcursor->image.height);
>
> if (fbcursor->set & FB_CUR_SETPOS)
> @@ -134,19 +132,23 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
> u16 fg, bg;
>
> fg = ((info->cmap.red[fbcursor->image.fg_color] & 0xf800)) |
> - ((info->cmap.green[fbcursor->image.fg_color] & 0xfc00) >> 5) |
> - ((info->cmap.blue[fbcursor->image.fg_color] & 0xf800) >> 11);
> + ((info->cmap.green[fbcursor->image.fg_color] & 0xfc00) >>
> + 5) |
> + ((info->cmap.blue[fbcursor->image.fg_color] & 0xf800) >>
> + 11);
>
> bg = ((info->cmap.red[fbcursor->image.bg_color] & 0xf800)) |
> - ((info->cmap.green[fbcursor->image.bg_color] & 0xfc00) >> 5) |
> - ((info->cmap.blue[fbcursor->image.bg_color] & 0xf800) >> 11);
> + ((info->cmap.green[fbcursor->image.bg_color] & 0xfc00) >>
> + 5) |
> + ((info->cmap.blue[fbcursor->image.bg_color] & 0xf800) >>
> + 11);
>
> sm750_hw_cursor_set_color(cursor, fg, bg);
> }
>
> if (fbcursor->set & (FB_CUR_SETSHAPE | FB_CUR_SETIMAGE)) {
> - sm750_hw_cursor_set_data(cursor, fbcursor->rop, fbcursor->image.data,
> - fbcursor->mask);
> + sm750_hw_cursor_set_data(cursor, fbcursor->rop,
> + fbcursor->image.data, fbcursor->mask);
> }
>
> if (fbcursor->enable)
> @@ -178,7 +180,7 @@ static void lynxfb_ops_fillrect(struct fb_info *info,
> bpp = info->var.bits_per_pixel >> 3;
>
> color = (bpp == 1) ? region->color :
> - ((u32 *)info->pseudo_palette)[region->color];
> + ((u32 *)info->pseudo_palette)[region->color];
> rop = (region->rop != ROP_COPY) ? HW_ROP2_XOR : HW_ROP2_COPY;
>
> /*
> @@ -189,11 +191,9 @@ static void lynxfb_ops_fillrect(struct fb_info *info,
> */
> spin_lock(&sm750_dev->slock);
>
> - sm750_dev->accel.de_fillrect(&sm750_dev->accel,
> - base, pitch, bpp,
> - region->dx, region->dy,
> - region->width, region->height,
> - color, rop);
> + sm750_dev->accel.de_fillrect(&sm750_dev->accel, base, pitch, bpp,
> + region->dx, region->dy, region->width,
> + region->height, color, rop);
> spin_unlock(&sm750_dev->slock);
> }
>
> @@ -223,10 +223,9 @@ static void lynxfb_ops_copyarea(struct fb_info *info,
> */
> spin_lock(&sm750_dev->slock);
>
> - sm750_dev->accel.de_copyarea(&sm750_dev->accel,
> - base, pitch, region->sx, region->sy,
> - base, pitch, bpp, region->dx, region->dy,
> - region->width, region->height,
> + sm750_dev->accel.de_copyarea(&sm750_dev->accel, base, pitch, region->sx,
> + region->sy, base, pitch, bpp, region->dx,
> + region->dy, region->width, region->height,
> HW_ROP2_COPY);
> spin_unlock(&sm750_dev->slock);
> }
> @@ -272,12 +271,11 @@ static void lynxfb_ops_imageblit(struct fb_info *info,
> */
> spin_lock(&sm750_dev->slock);
>
> - sm750_dev->accel.de_imageblit(&sm750_dev->accel,
> - image->data, image->width >> 3, 0,
> - base, pitch, bpp,
> - image->dx, image->dy,
> - image->width, image->height,
> - fgcol, bgcol, HW_ROP2_COPY);
> + sm750_dev->accel.de_imageblit(&sm750_dev->accel, image->data,
> + image->width >> 3, 0, base, pitch, bpp,
> + image->dx, image->dy, image->width,
> + image->height, fgcol, bgcol,
> + HW_ROP2_COPY);
> spin_unlock(&sm750_dev->slock);
> }
>
> @@ -385,7 +383,7 @@ static int lynxfb_ops_set_par(struct fb_info *info)
>
> var->height = -1;
> var->width = -1;
> - var->accel_flags = 0;/*FB_ACCELF_TEXT;*/
> + var->accel_flags = 0; /*FB_ACCELF_TEXT;*/
>
> if (ret) {
> dev_err(info->device, "bpp %d not supported\n",
> @@ -498,7 +496,7 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var,
>
> var->height = -1;
> var->width = -1;
> - var->accel_flags = 0;/* FB_ACCELF_TEXT; */
> + var->accel_flags = 0; /* FB_ACCELF_TEXT; */
>
> /* check if current fb's video memory big enough to hold the onscreen*/
> request = var->xres_virtual * (var->bits_per_pixel >> 3);
> @@ -514,12 +512,9 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var,
> return hw_sm750_crtc_check_mode(crtc, var);
> }
>
> -static int lynxfb_ops_setcolreg(unsigned int regno,
> - unsigned int red,
> - unsigned int green,
> - unsigned int blue,
> - unsigned int transp,
> - struct fb_info *info)
> +static int lynxfb_ops_setcolreg(unsigned int regno, unsigned int red,
> + unsigned int green, unsigned int blue,
> + unsigned int transp, struct fb_info *info)
> {
> struct lynxfb_par *par;
> struct lynxfb_crtc *crtc;
> @@ -556,8 +551,7 @@ static int lynxfb_ops_setcolreg(unsigned int regno,
> if (info->fix.visual == FB_VISUAL_TRUECOLOR && regno < 256) {
> u32 val;
>
> - if (var->bits_per_pixel == 16 ||
> - var->bits_per_pixel == 32 ||
> + if (var->bits_per_pixel == 16 || var->bits_per_pixel == 32 ||
> var->bits_per_pixel == 24) {
> val = chan_to_field(red, &var->red);
> val |= chan_to_field(green, &var->green);
> @@ -616,7 +610,8 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
>
> /* chip specific phase */
> sm750_dev->accel.de_wait = (sm750_dev->revid == SM750LE_REVISION_ID) ?
> - hw_sm750le_de_wait : hw_sm750_de_wait;
> + hw_sm750le_de_wait :
> + hw_sm750_de_wait;
> switch (sm750_dev->dataflow) {
> case sm750_simul_pri:
> output->paths = sm750_pnc;
> @@ -670,7 +665,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
> static const struct fb_ops lynxfb_ops = {
> .owner = THIS_MODULE,
> FB_DEFAULT_IOMEM_OPS,
> - .fb_check_var = lynxfb_ops_check_var,
> + .fb_check_var = lynxfb_ops_check_var,
> .fb_set_par = lynxfb_ops_set_par,
> .fb_setcolreg = lynxfb_ops_setcolreg,
> .fb_blank = lynxfb_ops_blank,
> @@ -680,7 +675,7 @@ static const struct fb_ops lynxfb_ops = {
> static const struct fb_ops lynxfb_ops_with_cursor = {
> .owner = THIS_MODULE,
> FB_DEFAULT_IOMEM_OPS,
> - .fb_check_var = lynxfb_ops_check_var,
> + .fb_check_var = lynxfb_ops_check_var,
> .fb_set_par = lynxfb_ops_set_par,
> .fb_setcolreg = lynxfb_ops_setcolreg,
> .fb_blank = lynxfb_ops_blank,
> @@ -691,7 +686,7 @@ static const struct fb_ops lynxfb_ops_with_cursor = {
> static const struct fb_ops lynxfb_ops_accel = {
> .owner = THIS_MODULE,
> __FB_DEFAULT_IOMEM_OPS_RDWR,
> - .fb_check_var = lynxfb_ops_check_var,
> + .fb_check_var = lynxfb_ops_check_var,
> .fb_set_par = lynxfb_ops_set_par,
> .fb_setcolreg = lynxfb_ops_setcolreg,
> .fb_blank = lynxfb_ops_blank,
> @@ -705,7 +700,7 @@ static const struct fb_ops lynxfb_ops_accel = {
> static const struct fb_ops lynxfb_ops_accel_with_cursor = {
> .owner = THIS_MODULE,
> __FB_DEFAULT_IOMEM_OPS_RDWR,
> - .fb_check_var = lynxfb_ops_check_var,
> + .fb_check_var = lynxfb_ops_check_var,
> .fb_set_par = lynxfb_ops_set_par,
> .fb_setcolreg = lynxfb_ops_setcolreg,
> .fb_blank = lynxfb_ops_blank,
> @@ -728,11 +723,14 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
> struct fb_fix_screeninfo *fix;
>
> const struct fb_videomode *pdb[] = {
> - lynx750_ext, NULL, vesa_modes,
> + lynx750_ext,
> + NULL,
> + vesa_modes,
> };
> - int cdb[] = {ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE};
> + int cdb[] = { ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE };
> static const char *fix_id[2] = {
> - "sm750_fb1", "sm750_fb2",
> + "sm750_fb1",
> + "sm750_fb2",
> };
>
> int ret, line_length;
> @@ -755,8 +753,8 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
> * must be set after crtc member initialized
> */
> crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
> - crtc->cursor.mmio = sm750_dev->pvReg +
> - 0x800f0 + (int)crtc->channel * 0x140;
> + crtc->cursor.mmio =
> + sm750_dev->pvReg + 0x800f0 + (int)crtc->channel * 0x140;
>
> crtc->cursor.max_h = 64;
> crtc->cursor.max_w = 64;
> @@ -788,8 +786,8 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
> }
>
> for (i = 0; i < 3; i++) {
> - ret = fb_find_mode(var, info, g_fbmode[index],
> - pdb[i], cdb[i], NULL, 8);
> + ret = fb_find_mode(var, info, g_fbmode[index], pdb[i], cdb[i],
> + NULL, 8);
>
> if (ret == 1 || ret == 2)
> break;
> @@ -901,7 +899,8 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
> dev_info(&sm750_dev->pdev->dev,
> "find fbmode1 : %s\n", g_fbmode[1]);
> } else {
> - dev_warn(&sm750_dev->pdev->dev, "How many view you wann set?\n");
> + dev_warn(&sm750_dev->pdev->dev,
> + "How many view you wann set?\n");
> }
> }
> }
> @@ -1112,8 +1111,12 @@ static int __init lynxfb_setup(char *options)
> }
>
> static const struct pci_device_id smi_pci_table[] = {
> - { PCI_DEVICE(0x126f, 0x0750), },
> - {0,}
> + {
> + PCI_DEVICE(0x126f, 0x0750),
> + },
> + {
> + 0,
> + }
> };
>
> MODULE_DEVICE_TABLE(pci, smi_pci_table);
> @@ -1121,11 +1124,11 @@ MODULE_DEVICE_TABLE(pci, smi_pci_table);
> static SIMPLE_DEV_PM_OPS(lynxfb_pm_ops, lynxfb_suspend, lynxfb_resume);
>
> static struct pci_driver lynxfb_driver = {
> - .name = "sm750fb",
> - .id_table = smi_pci_table,
> - .probe = lynxfb_pci_probe,
> - .remove = lynxfb_pci_remove,
> - .driver.pm = &lynxfb_pm_ops,
> + .name = "sm750fb",
> + .id_table = smi_pci_table,
> + .probe = lynxfb_pci_probe,
> + .remove = lynxfb_pci_remove,
> + .driver.pm = &lynxfb_pm_ops,
> };
>
> static int __init lynxfb_init(void)
> @@ -1155,15 +1158,15 @@ module_exit(lynxfb_exit);
>
> module_param(g_option, charp, 0444);
>
> -MODULE_PARM_DESC(g_option,
> - "\n\t\tCommon options:\n"
> - "\t\tnoaccel:disable 2d capabilities\n"
> - "\t\tnomtrr:disable MTRR attribute for video memory\n"
> - "\t\tdualview:dual frame buffer feature enabled\n"
> - "\t\tnohwc:disable hardware cursor\n"
> - "\t\tUsual example:\n"
> - "\t\tinsmod ./sm750fb.ko g_option=\"noaccel,nohwc,1280x1024-8@60\"\n"
> - );
> +MODULE_PARM_DESC(
> + g_option,
> + "\n\t\tCommon options:\n"
> + "\t\tnoaccel:disable 2d capabilities\n"
> + "\t\tnomtrr:disable MTRR attribute for video memory\n"
> + "\t\tdualview:dual frame buffer feature enabled\n"
> + "\t\tnohwc:disable hardware cursor\n"
> + "\t\tUsual example:\n"
> + "\t\tinsmod ./sm750fb.ko g_option=\"noaccel,nohwc,1280x1024-8@60\"\n");
>
> MODULE_AUTHOR("monk liu <monk.liu@siliconmotion.com>");
> MODULE_AUTHOR("Sudip Mukherjee <sudip@vectorindia.org>");
> --
> 2.54.0
>
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- Your patch did many different things all at once, making it difficult
to review. All Linux kernel patches need to only do one thing at a
time. If you need to do multiple things (such as clean up all coding
style issues in a file/driver), do it in a sequence of patches, each
one doing only one thing. This will make it easier to review the
patches to ensure that they are correct, and to help alleviate any
merge issues that larger patches can cause.
- It looks like you did not use your "real" name for the patch on either
the Signed-off-by: line, or the From: line (both of which have to
match). Please read the kernel file,
Documentation/process/submitting-patches.rst for how to do this
correctly.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
^ permalink raw reply
* [PATCH v2] staging: sm750fb: minor coding style cleanup
From: Chhabilal Dangal @ 2026-05-11 16:09 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
Cc: linux-fbdev, linux-staging, linux-kernel, Chhabilal Dangal
Clean up various coding style issues including spacing in struct initializers and indentation of wrapped lines.
Signed-off-by: Alone <yogeshdangal66@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 203 ++++++++++++++++----------------
1 file changed, 103 insertions(+), 100 deletions(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 9f3e3d37e82a..7fca2c9f6966 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -33,7 +33,8 @@
static int g_hwcursor = 1;
static int g_noaccel;
static int g_nomtrr;
-static const char *g_fbmode[] = {NULL, NULL};
+/* intentionally non-const since array is modified at runtime */
+static const char *g_fbmode[] = { NULL, NULL };
static const char *g_def_fbmode = "1024x768-32@60";
static char *g_settings;
static int g_dualview;
@@ -41,64 +42,62 @@ static char *g_option;
static const struct fb_videomode lynx750_ext[] = {
/* 1024x600-60 VESA [1.71:1] */
- {NULL, 60, 1024, 600, 20423, 144, 40, 18, 1, 104, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
- FB_VMODE_NONINTERLACED},
+ { NULL, 60, 1024, 600, 20423, 144, 40, 18, 1, 104, 3,
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED },
/* 1024x600-70 VESA */
- {NULL, 70, 1024, 600, 17211, 152, 48, 21, 1, 104, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
- FB_VMODE_NONINTERLACED},
+ { NULL, 70, 1024, 600, 17211, 152, 48, 21, 1, 104, 3,
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED },
/* 1024x600-75 VESA */
- {NULL, 75, 1024, 600, 15822, 160, 56, 23, 1, 104, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
- FB_VMODE_NONINTERLACED},
+ { NULL, 75, 1024, 600, 15822, 160, 56, 23, 1, 104, 3,
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED },
/* 1024x600-85 VESA */
- {NULL, 85, 1024, 600, 13730, 168, 56, 26, 1, 112, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
- FB_VMODE_NONINTERLACED},
+ { NULL, 85, 1024, 600, 13730, 168, 56, 26, 1, 112, 3,
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED },
/* 720x480 */
- {NULL, 60, 720, 480, 37427, 88, 16, 13, 1, 72, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
- FB_VMODE_NONINTERLACED},
+ { NULL, 60, 720, 480, 37427, 88, 16, 13, 1, 72, 3,
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED },
/* 1280x720 [1.78:1] */
- {NULL, 60, 1280, 720, 13426, 162, 86, 22, 1, 136, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
- FB_VMODE_NONINTERLACED},
+ { NULL, 60, 1280, 720, 13426, 162, 86, 22, 1, 136, 3,
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED },
/* 1280x768@60 */
- {NULL, 60, 1280, 768, 12579, 192, 64, 20, 3, 128, 7,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
- FB_VMODE_NONINTERLACED},
+ { NULL, 60, 1280, 768, 12579, 192, 64, 20, 3, 128, 7,
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED },
/* 1360 x 768 [1.77083:1] */
- {NULL, 60, 1360, 768, 11804, 208, 64, 23, 1, 144, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
- FB_VMODE_NONINTERLACED},
+ { NULL, 60, 1360, 768, 11804, 208, 64, 23, 1, 144, 3,
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED },
/* 1368 x 768 [1.78:1] */
- {NULL, 60, 1368, 768, 11647, 216, 72, 23, 1, 144, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
- FB_VMODE_NONINTERLACED},
+ { NULL, 60, 1368, 768, 11647, 216, 72, 23, 1, 144, 3,
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED },
/* 1440 x 900 [16:10] */
- {NULL, 60, 1440, 900, 9392, 232, 80, 28, 1, 152, 3,
- FB_SYNC_VERT_HIGH_ACT,
- FB_VMODE_NONINTERLACED},
+ { NULL, 60, 1440, 900, 9392, 232, 80, 28, 1, 152, 3,
+ FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED },
/* 1440x960 [15:10] */
- {NULL, 60, 1440, 960, 8733, 240, 88, 30, 1, 152, 3,
- FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
- FB_VMODE_NONINTERLACED},
+ { NULL, 60, 1440, 960, 8733, 240, 88, 30, 1, 152, 3,
+ FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+ FB_VMODE_NONINTERLACED },
/* 1920x1080 [16:9] */
- {NULL, 60, 1920, 1080, 6734, 148, 88, 41, 1, 44, 3,
- FB_SYNC_VERT_HIGH_ACT,
- FB_VMODE_NONINTERLACED},
+ { NULL, 60, 1920, 1080, 6734, 148, 88, 41, 1, 44, 3,
+ FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED },
};
/* no hardware cursor supported under version 2.6.10, kernel bug */
@@ -120,8 +119,7 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
sm750_hw_cursor_disable(cursor);
if (fbcursor->set & FB_CUR_SETSIZE)
- sm750_hw_cursor_set_size(cursor,
- fbcursor->image.width,
+ sm750_hw_cursor_set_size(cursor, fbcursor->image.width,
fbcursor->image.height);
if (fbcursor->set & FB_CUR_SETPOS)
@@ -134,19 +132,23 @@ static int lynxfb_ops_cursor(struct fb_info *info, struct fb_cursor *fbcursor)
u16 fg, bg;
fg = ((info->cmap.red[fbcursor->image.fg_color] & 0xf800)) |
- ((info->cmap.green[fbcursor->image.fg_color] & 0xfc00) >> 5) |
- ((info->cmap.blue[fbcursor->image.fg_color] & 0xf800) >> 11);
+ ((info->cmap.green[fbcursor->image.fg_color] & 0xfc00) >>
+ 5) |
+ ((info->cmap.blue[fbcursor->image.fg_color] & 0xf800) >>
+ 11);
bg = ((info->cmap.red[fbcursor->image.bg_color] & 0xf800)) |
- ((info->cmap.green[fbcursor->image.bg_color] & 0xfc00) >> 5) |
- ((info->cmap.blue[fbcursor->image.bg_color] & 0xf800) >> 11);
+ ((info->cmap.green[fbcursor->image.bg_color] & 0xfc00) >>
+ 5) |
+ ((info->cmap.blue[fbcursor->image.bg_color] & 0xf800) >>
+ 11);
sm750_hw_cursor_set_color(cursor, fg, bg);
}
if (fbcursor->set & (FB_CUR_SETSHAPE | FB_CUR_SETIMAGE)) {
- sm750_hw_cursor_set_data(cursor, fbcursor->rop, fbcursor->image.data,
- fbcursor->mask);
+ sm750_hw_cursor_set_data(cursor, fbcursor->rop,
+ fbcursor->image.data, fbcursor->mask);
}
if (fbcursor->enable)
@@ -178,7 +180,7 @@ static void lynxfb_ops_fillrect(struct fb_info *info,
bpp = info->var.bits_per_pixel >> 3;
color = (bpp == 1) ? region->color :
- ((u32 *)info->pseudo_palette)[region->color];
+ ((u32 *)info->pseudo_palette)[region->color];
rop = (region->rop != ROP_COPY) ? HW_ROP2_XOR : HW_ROP2_COPY;
/*
@@ -189,11 +191,9 @@ static void lynxfb_ops_fillrect(struct fb_info *info,
*/
spin_lock(&sm750_dev->slock);
- sm750_dev->accel.de_fillrect(&sm750_dev->accel,
- base, pitch, bpp,
- region->dx, region->dy,
- region->width, region->height,
- color, rop);
+ sm750_dev->accel.de_fillrect(&sm750_dev->accel, base, pitch, bpp,
+ region->dx, region->dy, region->width,
+ region->height, color, rop);
spin_unlock(&sm750_dev->slock);
}
@@ -223,10 +223,9 @@ static void lynxfb_ops_copyarea(struct fb_info *info,
*/
spin_lock(&sm750_dev->slock);
- sm750_dev->accel.de_copyarea(&sm750_dev->accel,
- base, pitch, region->sx, region->sy,
- base, pitch, bpp, region->dx, region->dy,
- region->width, region->height,
+ sm750_dev->accel.de_copyarea(&sm750_dev->accel, base, pitch, region->sx,
+ region->sy, base, pitch, bpp, region->dx,
+ region->dy, region->width, region->height,
HW_ROP2_COPY);
spin_unlock(&sm750_dev->slock);
}
@@ -272,12 +271,11 @@ static void lynxfb_ops_imageblit(struct fb_info *info,
*/
spin_lock(&sm750_dev->slock);
- sm750_dev->accel.de_imageblit(&sm750_dev->accel,
- image->data, image->width >> 3, 0,
- base, pitch, bpp,
- image->dx, image->dy,
- image->width, image->height,
- fgcol, bgcol, HW_ROP2_COPY);
+ sm750_dev->accel.de_imageblit(&sm750_dev->accel, image->data,
+ image->width >> 3, 0, base, pitch, bpp,
+ image->dx, image->dy, image->width,
+ image->height, fgcol, bgcol,
+ HW_ROP2_COPY);
spin_unlock(&sm750_dev->slock);
}
@@ -385,7 +383,7 @@ static int lynxfb_ops_set_par(struct fb_info *info)
var->height = -1;
var->width = -1;
- var->accel_flags = 0;/*FB_ACCELF_TEXT;*/
+ var->accel_flags = 0; /*FB_ACCELF_TEXT;*/
if (ret) {
dev_err(info->device, "bpp %d not supported\n",
@@ -498,7 +496,7 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var,
var->height = -1;
var->width = -1;
- var->accel_flags = 0;/* FB_ACCELF_TEXT; */
+ var->accel_flags = 0; /* FB_ACCELF_TEXT; */
/* check if current fb's video memory big enough to hold the onscreen*/
request = var->xres_virtual * (var->bits_per_pixel >> 3);
@@ -514,12 +512,9 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var,
return hw_sm750_crtc_check_mode(crtc, var);
}
-static int lynxfb_ops_setcolreg(unsigned int regno,
- unsigned int red,
- unsigned int green,
- unsigned int blue,
- unsigned int transp,
- struct fb_info *info)
+static int lynxfb_ops_setcolreg(unsigned int regno, unsigned int red,
+ unsigned int green, unsigned int blue,
+ unsigned int transp, struct fb_info *info)
{
struct lynxfb_par *par;
struct lynxfb_crtc *crtc;
@@ -556,8 +551,7 @@ static int lynxfb_ops_setcolreg(unsigned int regno,
if (info->fix.visual == FB_VISUAL_TRUECOLOR && regno < 256) {
u32 val;
- if (var->bits_per_pixel == 16 ||
- var->bits_per_pixel == 32 ||
+ if (var->bits_per_pixel == 16 || var->bits_per_pixel == 32 ||
var->bits_per_pixel == 24) {
val = chan_to_field(red, &var->red);
val |= chan_to_field(green, &var->green);
@@ -616,7 +610,8 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
/* chip specific phase */
sm750_dev->accel.de_wait = (sm750_dev->revid == SM750LE_REVISION_ID) ?
- hw_sm750le_de_wait : hw_sm750_de_wait;
+ hw_sm750le_de_wait :
+ hw_sm750_de_wait;
switch (sm750_dev->dataflow) {
case sm750_simul_pri:
output->paths = sm750_pnc;
@@ -670,7 +665,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
static const struct fb_ops lynxfb_ops = {
.owner = THIS_MODULE,
FB_DEFAULT_IOMEM_OPS,
- .fb_check_var = lynxfb_ops_check_var,
+ .fb_check_var = lynxfb_ops_check_var,
.fb_set_par = lynxfb_ops_set_par,
.fb_setcolreg = lynxfb_ops_setcolreg,
.fb_blank = lynxfb_ops_blank,
@@ -680,7 +675,7 @@ static const struct fb_ops lynxfb_ops = {
static const struct fb_ops lynxfb_ops_with_cursor = {
.owner = THIS_MODULE,
FB_DEFAULT_IOMEM_OPS,
- .fb_check_var = lynxfb_ops_check_var,
+ .fb_check_var = lynxfb_ops_check_var,
.fb_set_par = lynxfb_ops_set_par,
.fb_setcolreg = lynxfb_ops_setcolreg,
.fb_blank = lynxfb_ops_blank,
@@ -691,7 +686,7 @@ static const struct fb_ops lynxfb_ops_with_cursor = {
static const struct fb_ops lynxfb_ops_accel = {
.owner = THIS_MODULE,
__FB_DEFAULT_IOMEM_OPS_RDWR,
- .fb_check_var = lynxfb_ops_check_var,
+ .fb_check_var = lynxfb_ops_check_var,
.fb_set_par = lynxfb_ops_set_par,
.fb_setcolreg = lynxfb_ops_setcolreg,
.fb_blank = lynxfb_ops_blank,
@@ -705,7 +700,7 @@ static const struct fb_ops lynxfb_ops_accel = {
static const struct fb_ops lynxfb_ops_accel_with_cursor = {
.owner = THIS_MODULE,
__FB_DEFAULT_IOMEM_OPS_RDWR,
- .fb_check_var = lynxfb_ops_check_var,
+ .fb_check_var = lynxfb_ops_check_var,
.fb_set_par = lynxfb_ops_set_par,
.fb_setcolreg = lynxfb_ops_setcolreg,
.fb_blank = lynxfb_ops_blank,
@@ -728,11 +723,14 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
struct fb_fix_screeninfo *fix;
const struct fb_videomode *pdb[] = {
- lynx750_ext, NULL, vesa_modes,
+ lynx750_ext,
+ NULL,
+ vesa_modes,
};
- int cdb[] = {ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE};
+ int cdb[] = { ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE };
static const char *fix_id[2] = {
- "sm750_fb1", "sm750_fb2",
+ "sm750_fb1",
+ "sm750_fb2",
};
int ret, line_length;
@@ -755,8 +753,8 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
* must be set after crtc member initialized
*/
crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
- crtc->cursor.mmio = sm750_dev->pvReg +
- 0x800f0 + (int)crtc->channel * 0x140;
+ crtc->cursor.mmio =
+ sm750_dev->pvReg + 0x800f0 + (int)crtc->channel * 0x140;
crtc->cursor.max_h = 64;
crtc->cursor.max_w = 64;
@@ -788,8 +786,8 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
}
for (i = 0; i < 3; i++) {
- ret = fb_find_mode(var, info, g_fbmode[index],
- pdb[i], cdb[i], NULL, 8);
+ ret = fb_find_mode(var, info, g_fbmode[index], pdb[i], cdb[i],
+ NULL, 8);
if (ret == 1 || ret == 2)
break;
@@ -901,7 +899,8 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
dev_info(&sm750_dev->pdev->dev,
"find fbmode1 : %s\n", g_fbmode[1]);
} else {
- dev_warn(&sm750_dev->pdev->dev, "How many view you wann set?\n");
+ dev_warn(&sm750_dev->pdev->dev,
+ "How many view you wann set?\n");
}
}
}
@@ -1112,8 +1111,12 @@ static int __init lynxfb_setup(char *options)
}
static const struct pci_device_id smi_pci_table[] = {
- { PCI_DEVICE(0x126f, 0x0750), },
- {0,}
+ {
+ PCI_DEVICE(0x126f, 0x0750),
+ },
+ {
+ 0,
+ }
};
MODULE_DEVICE_TABLE(pci, smi_pci_table);
@@ -1121,11 +1124,11 @@ MODULE_DEVICE_TABLE(pci, smi_pci_table);
static SIMPLE_DEV_PM_OPS(lynxfb_pm_ops, lynxfb_suspend, lynxfb_resume);
static struct pci_driver lynxfb_driver = {
- .name = "sm750fb",
- .id_table = smi_pci_table,
- .probe = lynxfb_pci_probe,
- .remove = lynxfb_pci_remove,
- .driver.pm = &lynxfb_pm_ops,
+ .name = "sm750fb",
+ .id_table = smi_pci_table,
+ .probe = lynxfb_pci_probe,
+ .remove = lynxfb_pci_remove,
+ .driver.pm = &lynxfb_pm_ops,
};
static int __init lynxfb_init(void)
@@ -1155,15 +1158,15 @@ module_exit(lynxfb_exit);
module_param(g_option, charp, 0444);
-MODULE_PARM_DESC(g_option,
- "\n\t\tCommon options:\n"
- "\t\tnoaccel:disable 2d capabilities\n"
- "\t\tnomtrr:disable MTRR attribute for video memory\n"
- "\t\tdualview:dual frame buffer feature enabled\n"
- "\t\tnohwc:disable hardware cursor\n"
- "\t\tUsual example:\n"
- "\t\tinsmod ./sm750fb.ko g_option=\"noaccel,nohwc,1280x1024-8@60\"\n"
- );
+MODULE_PARM_DESC(
+ g_option,
+ "\n\t\tCommon options:\n"
+ "\t\tnoaccel:disable 2d capabilities\n"
+ "\t\tnomtrr:disable MTRR attribute for video memory\n"
+ "\t\tdualview:dual frame buffer feature enabled\n"
+ "\t\tnohwc:disable hardware cursor\n"
+ "\t\tUsual example:\n"
+ "\t\tinsmod ./sm750fb.ko g_option=\"noaccel,nohwc,1280x1024-8@60\"\n");
MODULE_AUTHOR("monk liu <monk.liu@siliconmotion.com>");
MODULE_AUTHOR("Sudip Mukherjee <sudip@vectorindia.org>");
--
2.54.0
^ permalink raw reply related
* Re: [PATCH] staging: sm750fb: Add const to g_fbmode array
From: kernel test robot @ 2026-05-11 15:37 UTC (permalink / raw)
To: Alone, Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
Cc: llvm, oe-kbuild-all, linux-fbdev, linux-staging, linux-kernel,
Chhabilal Dangal
In-Reply-To: <20260509164057.71722-1-yogeshdangal66@gmail.com>
Hi Alone,
kernel test robot noticed the following build errors:
[auto build test ERROR on staging/staging-testing]
url: https://github.com/intel-lab-lkp/linux/commits/Alone/staging-sm750fb-Add-const-to-g_fbmode-array/20260511-155715
base: staging/staging-testing
patch link: https://lore.kernel.org/r/20260509164057.71722-1-yogeshdangal66%40gmail.com
patch subject: [PATCH] staging: sm750fb: Add const to g_fbmode array
config: arm64-randconfig-003-20260511 (https://download.01.org/0day-ci/archive/20260511/202605112333.ORNyLXKe-lkp@intel.com/config)
compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260511/202605112333.ORNyLXKe-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202605112333.ORNyLXKe-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/staging/sm750fb/sm750.c:785:19: error: cannot assign to variable 'g_fbmode' with const-qualified type 'const char *const[2]'
785 | g_fbmode[index] = g_def_fbmode;
| ~~~~~~~~~~~~~~~ ^
drivers/staging/sm750fb/sm750.c:36:27: note: variable 'g_fbmode' declared const here
36 | static const char * const g_fbmode[] = {NULL, NULL};
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/sm750fb/sm750.c:787:20: error: cannot assign to variable 'g_fbmode' with const-qualified type 'const char *const[2]'
787 | g_fbmode[index] = g_fbmode[0];
| ~~~~~~~~~~~~~~~ ^
drivers/staging/sm750fb/sm750.c:36:27: note: variable 'g_fbmode' declared const here
36 | static const char * const g_fbmode[] = {NULL, NULL};
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/sm750fb/sm750.c:896:17: error: cannot assign to variable 'g_fbmode' with const-qualified type 'const char *const[2]'
896 | g_fbmode[0] = opt;
| ~~~~~~~~~~~ ^
drivers/staging/sm750fb/sm750.c:36:27: note: variable 'g_fbmode' declared const here
36 | static const char * const g_fbmode[] = {NULL, NULL};
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/staging/sm750fb/sm750.c:900:17: error: cannot assign to variable 'g_fbmode' with const-qualified type 'const char *const[2]'
900 | g_fbmode[1] = opt;
| ~~~~~~~~~~~ ^
drivers/staging/sm750fb/sm750.c:36:27: note: variable 'g_fbmode' declared const here
36 | static const char * const g_fbmode[] = {NULL, NULL};
| ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
4 errors generated.
vim +785 drivers/staging/sm750fb/sm750.c
81dee67e215b23f Sudip Mukherjee 2015-03-03 719
81dee67e215b23f Sudip Mukherjee 2015-03-03 720 static int lynxfb_set_fbinfo(struct fb_info *info, int index)
81dee67e215b23f Sudip Mukherjee 2015-03-03 721 {
81dee67e215b23f Sudip Mukherjee 2015-03-03 722 int i;
81dee67e215b23f Sudip Mukherjee 2015-03-03 723 struct lynxfb_par *par;
e359b6a863e19f2 Mike Rapoport 2015-10-26 724 struct sm750_dev *sm750_dev;
81dee67e215b23f Sudip Mukherjee 2015-03-03 725 struct lynxfb_crtc *crtc;
81dee67e215b23f Sudip Mukherjee 2015-03-03 726 struct lynxfb_output *output;
81dee67e215b23f Sudip Mukherjee 2015-03-03 727 struct fb_var_screeninfo *var;
81dee67e215b23f Sudip Mukherjee 2015-03-03 728 struct fb_fix_screeninfo *fix;
81dee67e215b23f Sudip Mukherjee 2015-03-03 729
81dee67e215b23f Sudip Mukherjee 2015-03-03 730 const struct fb_videomode *pdb[] = {
81dee67e215b23f Sudip Mukherjee 2015-03-03 731 lynx750_ext, NULL, vesa_modes,
81dee67e215b23f Sudip Mukherjee 2015-03-03 732 };
81dee67e215b23f Sudip Mukherjee 2015-03-03 733 int cdb[] = {ARRAY_SIZE(lynx750_ext), 0, VESA_MODEDB_SIZE};
d0856045f0e9fc9 Hungyu Lin 2026-04-01 734 static const char * const fix_id[2] = {
81dee67e215b23f Sudip Mukherjee 2015-03-03 735 "sm750_fb1", "sm750_fb2",
81dee67e215b23f Sudip Mukherjee 2015-03-03 736 };
81dee67e215b23f Sudip Mukherjee 2015-03-03 737
81dee67e215b23f Sudip Mukherjee 2015-03-03 738 int ret, line_length;
81dee67e215b23f Sudip Mukherjee 2015-03-03 739
81dee67e215b23f Sudip Mukherjee 2015-03-03 740 ret = 0;
81dee67e215b23f Sudip Mukherjee 2015-03-03 741 par = (struct lynxfb_par *)info->par;
e359b6a863e19f2 Mike Rapoport 2015-10-26 742 sm750_dev = par->dev;
81dee67e215b23f Sudip Mukherjee 2015-03-03 743 crtc = &par->crtc;
81dee67e215b23f Sudip Mukherjee 2015-03-03 744 output = &par->output;
81dee67e215b23f Sudip Mukherjee 2015-03-03 745 var = &info->var;
81dee67e215b23f Sudip Mukherjee 2015-03-03 746 fix = &info->fix;
81dee67e215b23f Sudip Mukherjee 2015-03-03 747
81dee67e215b23f Sudip Mukherjee 2015-03-03 748 /* set index */
81dee67e215b23f Sudip Mukherjee 2015-03-03 749 par->index = index;
81dee67e215b23f Sudip Mukherjee 2015-03-03 750 output->channel = &crtc->channel;
81dee67e215b23f Sudip Mukherjee 2015-03-03 751 sm750fb_set_drv(par);
81dee67e215b23f Sudip Mukherjee 2015-03-03 752
d11ac7cbcc266c6 Sudip Mukherjee 2015-08-07 753 /*
d11ac7cbcc266c6 Sudip Mukherjee 2015-08-07 754 * set current cursor variable and proc pointer,
d11ac7cbcc266c6 Sudip Mukherjee 2015-08-07 755 * must be set after crtc member initialized
d11ac7cbcc266c6 Sudip Mukherjee 2015-08-07 756 */
fdc234d85210d91 Benjamin Philip 2021-07-28 757 crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
e359b6a863e19f2 Mike Rapoport 2015-10-26 758 crtc->cursor.mmio = sm750_dev->pvReg +
e359b6a863e19f2 Mike Rapoport 2015-10-26 759 0x800f0 + (int)crtc->channel * 0x140;
81dee67e215b23f Sudip Mukherjee 2015-03-03 760
cd33da26036ea54 Christopher Carbone 2022-08-23 761 crtc->cursor.max_h = 64;
cd33da26036ea54 Christopher Carbone 2022-08-23 762 crtc->cursor.max_w = 64;
39f9137268ee3df Benjamin Philip 2021-07-26 763 crtc->cursor.size = crtc->cursor.max_h * crtc->cursor.max_w * 2 / 8;
e359b6a863e19f2 Mike Rapoport 2015-10-26 764 crtc->cursor.vstart = sm750_dev->pvMem + crtc->cursor.offset;
81dee67e215b23f Sudip Mukherjee 2015-03-03 765
3de08a2d14ff8c7 Lorenzo Stoakes 2015-03-20 766 memset_io(crtc->cursor.vstart, 0, crtc->cursor.size);
f7c8a046577e09d Thomas Zimmermann 2023-11-27 767 if (!g_hwcursor)
52d0744d751d8f1 Arnd Bergmann 2016-11-09 768 sm750_hw_cursor_disable(&crtc->cursor);
81dee67e215b23f Sudip Mukherjee 2015-03-03 769
81dee67e215b23f Sudip Mukherjee 2015-03-03 770 /* set info->fbops, must be set before fb_find_mode */
e359b6a863e19f2 Mike Rapoport 2015-10-26 771 if (!sm750_dev->accel_off) {
81dee67e215b23f Sudip Mukherjee 2015-03-03 772 /* use 2d acceleration */
f7c8a046577e09d Thomas Zimmermann 2023-11-27 773 if (!g_hwcursor)
f7c8a046577e09d Thomas Zimmermann 2023-11-27 774 info->fbops = &lynxfb_ops_accel;
f7c8a046577e09d Thomas Zimmermann 2023-11-27 775 else
f7c8a046577e09d Thomas Zimmermann 2023-11-27 776 info->fbops = &lynxfb_ops_accel_with_cursor;
f7c8a046577e09d Thomas Zimmermann 2023-11-27 777 } else {
f7c8a046577e09d Thomas Zimmermann 2023-11-27 778 if (!g_hwcursor)
81dee67e215b23f Sudip Mukherjee 2015-03-03 779 info->fbops = &lynxfb_ops;
f7c8a046577e09d Thomas Zimmermann 2023-11-27 780 else
f7c8a046577e09d Thomas Zimmermann 2023-11-27 781 info->fbops = &lynxfb_ops_with_cursor;
f7c8a046577e09d Thomas Zimmermann 2023-11-27 782 }
81dee67e215b23f Sudip Mukherjee 2015-03-03 783
81dee67e215b23f Sudip Mukherjee 2015-03-03 784 if (!g_fbmode[index]) {
81dee67e215b23f Sudip Mukherjee 2015-03-03 @785 g_fbmode[index] = g_def_fbmode;
81dee67e215b23f Sudip Mukherjee 2015-03-03 786 if (index)
81dee67e215b23f Sudip Mukherjee 2015-03-03 787 g_fbmode[index] = g_fbmode[0];
81dee67e215b23f Sudip Mukherjee 2015-03-03 788 }
81dee67e215b23f Sudip Mukherjee 2015-03-03 789
81dee67e215b23f Sudip Mukherjee 2015-03-03 790 for (i = 0; i < 3; i++) {
81dee67e215b23f Sudip Mukherjee 2015-03-03 791 ret = fb_find_mode(var, info, g_fbmode[index],
81dee67e215b23f Sudip Mukherjee 2015-03-03 792 pdb[i], cdb[i], NULL, 8);
81dee67e215b23f Sudip Mukherjee 2015-03-03 793
db7fb3588ab4920 Artem Lytkin 2026-02-23 794 if (ret == 1 || ret == 2)
81dee67e215b23f Sudip Mukherjee 2015-03-03 795 break;
81dee67e215b23f Sudip Mukherjee 2015-03-03 796 }
81dee67e215b23f Sudip Mukherjee 2015-03-03 797
81dee67e215b23f Sudip Mukherjee 2015-03-03 798 /* set par */
81dee67e215b23f Sudip Mukherjee 2015-03-03 799 par->info = info;
81dee67e215b23f Sudip Mukherjee 2015-03-03 800
81dee67e215b23f Sudip Mukherjee 2015-03-03 801 /* set info */
e3a3f9f5123683b Mike Rapoport 2015-10-26 802 line_length = ALIGN((var->xres_virtual * var->bits_per_pixel / 8),
e3a3f9f5123683b Mike Rapoport 2015-10-26 803 crtc->line_pad);
81dee67e215b23f Sudip Mukherjee 2015-03-03 804
81dee67e215b23f Sudip Mukherjee 2015-03-03 805 info->pseudo_palette = &par->pseudo_palette[0];
cc59bde1c920ab6 Benjamin Philip 2021-07-28 806 info->screen_base = crtc->v_screen;
81dee67e215b23f Sudip Mukherjee 2015-03-03 807 info->screen_size = line_length * var->yres_virtual;
81dee67e215b23f Sudip Mukherjee 2015-03-03 808
81dee67e215b23f Sudip Mukherjee 2015-03-03 809 /* set info->fix */
81dee67e215b23f Sudip Mukherjee 2015-03-03 810 fix->type = FB_TYPE_PACKED_PIXELS;
81dee67e215b23f Sudip Mukherjee 2015-03-03 811 fix->type_aux = 0;
81dee67e215b23f Sudip Mukherjee 2015-03-03 812 fix->xpanstep = crtc->xpanstep;
81dee67e215b23f Sudip Mukherjee 2015-03-03 813 fix->ypanstep = crtc->ypanstep;
81dee67e215b23f Sudip Mukherjee 2015-03-03 814 fix->ywrapstep = crtc->ywrapstep;
81dee67e215b23f Sudip Mukherjee 2015-03-03 815 fix->accel = FB_ACCEL_SMI;
81dee67e215b23f Sudip Mukherjee 2015-03-03 816
8c475735085a7db Tim Wassink 2025-12-21 817 strscpy(fix->id, fix_id[index], sizeof(fix->id));
81dee67e215b23f Sudip Mukherjee 2015-03-03 818
fdc234d85210d91 Benjamin Philip 2021-07-28 819 fix->smem_start = crtc->o_screen + sm750_dev->vidmem_start;
d11ac7cbcc266c6 Sudip Mukherjee 2015-08-07 820 /*
d11ac7cbcc266c6 Sudip Mukherjee 2015-08-07 821 * according to mmap experiment from user space application,
81dee67e215b23f Sudip Mukherjee 2015-03-03 822 * fix->mmio_len should not larger than virtual size
81dee67e215b23f Sudip Mukherjee 2015-03-03 823 * (xres_virtual x yres_virtual x ByPP)
81dee67e215b23f Sudip Mukherjee 2015-03-03 824 * Below line maybe buggy when user mmap fb dev node and write
81dee67e215b23f Sudip Mukherjee 2015-03-03 825 * data into the bound over virtual size
d11ac7cbcc266c6 Sudip Mukherjee 2015-08-07 826 */
81dee67e215b23f Sudip Mukherjee 2015-03-03 827 fix->smem_len = crtc->vidmem_size;
81dee67e215b23f Sudip Mukherjee 2015-03-03 828 info->screen_size = fix->smem_len;
81dee67e215b23f Sudip Mukherjee 2015-03-03 829 fix->line_length = line_length;
e359b6a863e19f2 Mike Rapoport 2015-10-26 830 fix->mmio_start = sm750_dev->vidreg_start;
e359b6a863e19f2 Mike Rapoport 2015-10-26 831 fix->mmio_len = sm750_dev->vidreg_size;
b610e1193a917f4 Matej Dujava 2020-04-30 832
b610e1193a917f4 Matej Dujava 2020-04-30 833 lynxfb_set_visual_mode(info);
81dee67e215b23f Sudip Mukherjee 2015-03-03 834
81dee67e215b23f Sudip Mukherjee 2015-03-03 835 /* set var */
81dee67e215b23f Sudip Mukherjee 2015-03-03 836 var->activate = FB_ACTIVATE_NOW;
81dee67e215b23f Sudip Mukherjee 2015-03-03 837 var->accel_flags = 0;
81dee67e215b23f Sudip Mukherjee 2015-03-03 838 var->vmode = FB_VMODE_NONINTERLACED;
81dee67e215b23f Sudip Mukherjee 2015-03-03 839
61c507cf652da1b Michel von Czettritz 2015-03-26 840 ret = fb_alloc_cmap(&info->cmap, 256, 0);
61c507cf652da1b Michel von Czettritz 2015-03-26 841 if (ret < 0) {
fbab250eb51d6d6 Artem Lytkin 2026-02-07 842 dev_err(info->device, "Could not allocate memory for cmap.\n");
81dee67e215b23f Sudip Mukherjee 2015-03-03 843 goto exit;
81dee67e215b23f Sudip Mukherjee 2015-03-03 844 }
81dee67e215b23f Sudip Mukherjee 2015-03-03 845
81dee67e215b23f Sudip Mukherjee 2015-03-03 846 exit:
81dee67e215b23f Sudip Mukherjee 2015-03-03 847 lynxfb_ops_check_var(var, info);
81dee67e215b23f Sudip Mukherjee 2015-03-03 848 return ret;
81dee67e215b23f Sudip Mukherjee 2015-03-03 849 }
81dee67e215b23f Sudip Mukherjee 2015-03-03 850
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply
* Re: [PATCH] staging: sm750fb: Add const to g_fbmode array
From: Chhabilal Dangal @ 2026-05-11 10:52 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Sudip Mukherjee, Teddy Wang, linux-fbdev, linux-staging,
linux-kernel
Thanks for catching that! I've now properly configured the kernel:
CONFIG_FB_SM750=m
CONFIG_STAGING=y
CONFIG_FB=y
Ran: make oldconfig
Verified configuration with: cat .config | grep CONFIG_FB_SM750
The patch should compile with these settings enabled. The changes are
minimal (adding const to g_fbmode array) and don't require additional
setup beyond proper kernel configuration.
Thanks for the guidance!
Chhabilal Dangal
^ permalink raw reply
* Re: [PATCH] staging: sm750fb: Add const to g_fbmode array
From: Greg Kroah-Hartman @ 2026-05-11 10:23 UTC (permalink / raw)
To: Alone; +Cc: Sudip Mukherjee, Teddy Wang, linux-fbdev, linux-staging,
linux-kernel
In-Reply-To: <CAF9nfaDEys+8bcnFRVWWoAvyrvPgXmENbASABG+4dBjMinaP5A@mail.gmail.com>
On Mon, May 11, 2026 at 04:04:40PM +0545, Alone wrote:
> Thanks for the feedback. I verified the patch with:
>
> make M=drivers/staging/sm750fb
>
> and it builds successfully. I’ll make sure to compile-test patches before
> submission next time.
I don't think you actually built the file you modified. Be sure the
correct config option is also enabled. Try it yourself and see!
Also, please don't top-post or send html email, the mailing lists reject
that.
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH] staging: sm750fb: Add const to g_fbmode array
From: Greg Kroah-Hartman @ 2026-05-11 7:57 UTC (permalink / raw)
To: Alone; +Cc: Sudip Mukherjee, Teddy Wang, linux-fbdev, linux-staging,
linux-kernel
In-Reply-To: <20260509164057.71722-1-yogeshdangal66@gmail.com>
On Sat, May 09, 2026 at 10:25:57PM +0545, Alone wrote:
> From: Chhabilal Dangal <yogeshdangal66@gmail.com>
>
> Add const qualifier to g_fbmode array since the array
> itself is not modified after initialization.
>
> Signed-off-by: Chhabilal Dangal <yogeshdangal66@gmail.com>
> ---
> drivers/staging/sm750fb/sm750.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index 9f3e3d37e..19c3da654 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -33,7 +33,7 @@
> static int g_hwcursor = 1;
> static int g_noaccel;
> static int g_nomtrr;
> -static const char *g_fbmode[] = {NULL, NULL};
> +static const char * const g_fbmode[] = {NULL, NULL};
> static const char *g_def_fbmode = "1024x768-32@60";
> static char *g_settings;
> static int g_dualview;
> --
> 2.54.0
>
>
Please always test-build your patches :(
^ permalink raw reply
* [PATCH 1/2] dt-bindings: leds: backlight: add Silergy SY7758
From: Alexandre Hamamdjian via B4 Relay @ 2026-05-10 17:08 UTC (permalink / raw)
To: Philippe Simons, Lee Jones, Daniel Thompson, Jingoo Han,
Pavel Machek, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Helge Deller
Cc: dri-devel, linux-leds, devicetree, linux-kernel, linux-fbdev,
Alexandre Hamamdjian
In-Reply-To: <20260511-sy7758-v1-0-999a33081304@gmail.com>
From: Alexandre Hamamdjian <azkali.limited@gmail.com>
The Silergy SY7758 is an I2C-controlled multi-channel LED backlight
driver typically used to drive the edge-lit LED strings of LCD panels
in handheld and embedded devices. Brightness is programmed as a 12-bit
linear value through two 8-bit registers.
Document the binding for the new compatible "silergy,sy7758" so it can
be referenced by board device trees and the matching driver, and add a
MAINTAINERS entry covering both the binding and the upcoming driver.
Co-developed-by: Philippe Simons <simons.philippe@gmail.com>
Signed-off-by: Philippe Simons <simons.philippe@gmail.com>
Signed-off-by: Alexandre Hamamdjian <azkali.limited@gmail.com>
---
.../bindings/leds/backlight/silergy,sy7758.yaml | 47 ++++++++++++++++++++++
MAINTAINERS | 7 ++++
2 files changed, 54 insertions(+)
diff --git a/Documentation/devicetree/bindings/leds/backlight/silergy,sy7758.yaml b/Documentation/devicetree/bindings/leds/backlight/silergy,sy7758.yaml
new file mode 100644
index 000000000000..408029e19e2e
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/backlight/silergy,sy7758.yaml
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/backlight/silergy,sy7758.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Silergy SY7758 I2C LED backlight controller
+
+maintainers:
+ - Alexandre Hamamdjian <azkali.limited@gmail.com>
+ - Philippe Simons <simons.philippe@gmail.com>
+
+description:
+ The Silergy SY7758 is an I2C-controlled multi-channel LED backlight
+ driver typically used to drive the edge-lit LED strings of LCD panels
+ in handheld and embedded devices. Brightness is programmed as a 12-bit
+ linear value through two 8-bit registers.
+
+allOf:
+ - $ref: common.yaml#
+
+properties:
+ compatible:
+ const: silergy,sy7758
+
+ reg:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ backlight@36 {
+ compatible = "silergy,sy7758";
+ reg = <0x36>;
+ max-brightness = <4080>;
+ default-brightness = <1500>;
+ };
+ };
diff --git a/MAINTAINERS b/MAINTAINERS
index f877e5aaf2c7..9c132394ca41 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -24561,6 +24561,13 @@ S: Maintained
F: drivers/input/touchscreen/silead.c
F: drivers/platform/x86/touchscreen_dmi.c
+SILERGY SY7758 BACKLIGHT DRIVER
+M: Alexandre Hamamdjian <azkali.limited@gmail.com>
+M: Philippe Simons <simons.philippe@gmail.com>
+S: Maintained
+F: Documentation/devicetree/bindings/leds/backlight/silergy,sy7758.yaml
+F: drivers/video/backlight/sy7758.c
+
SILICON LABS WIRELESS DRIVERS (for WFxxx series)
M: Jérôme Pouiller <jerome.pouiller@silabs.com>
L: linux-wireless@vger.kernel.org
--
2.54.0
^ permalink raw reply related
* [PATCH 2/2] backlight: sy7758: add Silergy SY7758 backlight driver
From: Alexandre Hamamdjian via B4 Relay @ 2026-05-10 17:08 UTC (permalink / raw)
To: Philippe Simons, Lee Jones, Daniel Thompson, Jingoo Han,
Pavel Machek, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Helge Deller
Cc: dri-devel, linux-leds, devicetree, linux-kernel, linux-fbdev,
Alexandre Hamamdjian
In-Reply-To: <20260511-sy7758-v1-0-999a33081304@gmail.com>
From: Alexandre Hamamdjian <azkali.limited@gmail.com>
Add a driver for the Silergy SY7758 I2C-controlled multi-channel LED
backlight controller. The chip drives the edge-lit LED strings of LCD
panels in handheld and embedded devices, and is for example present on
the Ayaneo Pocket DS handheld where it drives the panel backlight.
The driver registers a backlight class device with a 12-bit linear
brightness range. On the first non-zero update, the chip's mode and
current configuration registers are programmed; subsequent brightness
updates only rewrite the two brightness registers. A mutex serialises
concurrent updates against the deferred init path.
Co-developed-by: Philippe Simons <simons.philippe@gmail.com>
Signed-off-by: Philippe Simons <simons.philippe@gmail.com>
Signed-off-by: Alexandre Hamamdjian <azkali.limited@gmail.com>
---
drivers/video/backlight/Kconfig | 14 ++++
drivers/video/backlight/Makefile | 1 +
drivers/video/backlight/sy7758.c | 169 +++++++++++++++++++++++++++++++++++++++
3 files changed, 184 insertions(+)
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index a7a3fbaf7c29..c529d2861525 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -461,6 +461,20 @@ config BACKLIGHT_SKY81452
To compile this driver as a module, choose M here: the module will
be called sky81452-backlight
+config BACKLIGHT_SY7758
+ tristate "Backlight Driver for Silergy SY7758"
+ depends on I2C
+ select REGMAP_I2C
+ help
+ This enables support for the Silergy SY7758 I2C-controlled
+ multi-channel LED backlight driver, commonly used to drive the
+ edge-lit LED strings of LCD panels in handheld and embedded
+ devices. The driver exposes a 12-bit linear brightness control
+ through the standard backlight class.
+
+ To compile this driver as a module, choose M here: the module
+ will be called sy7758.
+
config BACKLIGHT_TPS65217
tristate "TPS65217 Backlight"
depends on MFD_TPS65217
diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile
index 794820a98ed4..00d3e379b297 100644
--- a/drivers/video/backlight/Makefile
+++ b/drivers/video/backlight/Makefile
@@ -57,6 +57,7 @@ obj-$(CONFIG_BACKLIGHT_QCOM_WLED) += qcom-wled.o
obj-$(CONFIG_BACKLIGHT_RT4831) += rt4831-backlight.o
obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o
obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o
+obj-$(CONFIG_BACKLIGHT_SY7758) += sy7758.o
obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o
obj-$(CONFIG_BACKLIGHT_WM831X) += wm831x_bl.o
obj-$(CONFIG_BACKLIGHT_ARCXCNN) += arcxcnn_bl.o
diff --git a/drivers/video/backlight/sy7758.c b/drivers/video/backlight/sy7758.c
new file mode 100644
index 000000000000..6a318bd62030
--- /dev/null
+++ b/drivers/video/backlight/sy7758.c
@@ -0,0 +1,169 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Backlight driver for the Silergy sy7758
+ *
+ * Copyright (C) 2025 Kancy Joe <kancy2333@outlook.com>
+ */
+
+#include <linux/backlight.h>
+#include <linux/err.h>
+#include <linux/gpio/consumer.h>
+#include <linux/i2c.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/regmap.h>
+
+#define DEFAULT_BRIGHTNESS 1500
+#define MAX_BRIGHTNESS 4080
+#define REG_MAX 0xa9
+
+#define BL_BRT_L 0x10
+#define BL_BRT_H 0x11
+
+static DEFINE_MUTEX(sy7758_update_backlight_mutex);
+
+struct sy7758 {
+ struct i2c_client *client;
+ struct regmap *regmap;
+ bool led_on;
+};
+
+static void sy7758_init(struct sy7758 *sydev);
+
+static const struct regmap_config sy7758_regmap_config = {
+ .reg_bits = 8,
+ .val_bits = 8,
+ .max_register = REG_MAX,
+};
+
+static int sy7758_write(struct sy7758 *sydev, unsigned int reg,
+ unsigned int val)
+{
+ return regmap_write(sydev->regmap, reg, val);
+}
+
+static int sy7758_backlight_update_status(struct backlight_device *backlight_dev)
+{
+ struct sy7758 *sydev = bl_get_data(backlight_dev);
+ unsigned int brightness = backlight_get_brightness(backlight_dev);
+
+ mutex_lock(&sy7758_update_backlight_mutex);
+
+ if (!sydev->led_on && brightness > 0) {
+ sy7758_init(sydev);
+ sydev->led_on = true;
+ } else if (brightness == 0) {
+ sydev->led_on = false;
+ }
+
+ sy7758_write(sydev, BL_BRT_L, brightness & 0xf0);
+
+ sy7758_write(sydev, BL_BRT_H, (brightness >> 8) & 0xf);
+
+ mutex_unlock(&sy7758_update_backlight_mutex);
+ return 0;
+}
+
+static const struct backlight_ops sy7758_backlight_ops = {
+ .options = BL_CORE_SUSPENDRESUME,
+ .update_status = sy7758_backlight_update_status,
+};
+
+static void sy7758_init(struct sy7758 *sydev)
+{
+ sy7758_write(sydev, 0x01, 0x85);
+ sy7758_write(sydev, 0x10, 0x00);
+ sy7758_write(sydev, 0x11, 0x00);
+ sy7758_write(sydev, 0xa5, 0x64);
+ sy7758_write(sydev, 0xa0, 0x55);
+ sy7758_write(sydev, 0xa1, 0x9a);
+ sy7758_write(sydev, 0xa9, 0x80);
+ sy7758_write(sydev, 0xa2, 0x28);
+
+ usleep_range(10000, 11000);
+
+ sy7758_write(sydev, 0x10, 0x40);
+ sy7758_write(sydev, 0x11, 0x01);
+ // Max brightness
+ // 0x10: 0xf0 Low
+ // 0x11: 0x0f High
+
+ // Min brightness
+ // 0x10: 0x10 Low
+ // 0x11: 0x00 High
+ sydev->led_on = true;
+}
+
+static int sy7758_probe(struct i2c_client *client)
+{
+ struct backlight_device *backlight_dev;
+ struct backlight_properties props;
+ struct sy7758 *sydev;
+
+ sydev = devm_kzalloc(&client->dev, sizeof(*sydev), GFP_KERNEL);
+ if (!sydev)
+ return -ENOMEM;
+
+ sydev->client = client;
+ sydev->regmap = devm_regmap_init_i2c(client, &sy7758_regmap_config);
+ if (IS_ERR(sydev->regmap))
+ return dev_err_probe(&client->dev, PTR_ERR(sydev->regmap),
+ "failed to init regmap\n");
+
+ memset(&props, 0, sizeof(props));
+ props.type = BACKLIGHT_RAW;
+ props.max_brightness = MAX_BRIGHTNESS;
+ props.brightness = DEFAULT_BRIGHTNESS;
+ props.scale = BACKLIGHT_SCALE_LINEAR;
+
+ backlight_dev = devm_backlight_device_register(&client->dev, "sy7758-backlight",
+ &client->dev, sydev, &sy7758_backlight_ops, &props);
+ if (IS_ERR(backlight_dev))
+ return dev_err_probe(&client->dev, PTR_ERR(backlight_dev),
+ "failed to register backlight device\n");
+
+ sy7758_init(sydev);
+
+ i2c_set_clientdata(client, backlight_dev);
+ backlight_update_status(backlight_dev);
+
+ return 0;
+}
+
+static void sy7758_remove(struct i2c_client *client)
+{
+ struct backlight_device *backlight_dev = i2c_get_clientdata(client);
+
+ backlight_dev->props.brightness = 0;
+ backlight_update_status(backlight_dev);
+}
+
+static const struct i2c_device_id sy7758_ids[] = {
+ { "sy7758" },
+ {}
+};
+MODULE_DEVICE_TABLE(i2c, sy7758_ids);
+
+static const struct of_device_id sy7758_match_table[] = {
+ {
+ .compatible = "silergy,sy7758",
+ },
+ {},
+};
+MODULE_DEVICE_TABLE(of, sy7758_match_table);
+
+static struct i2c_driver sy7758_driver = {
+ .driver = {
+ .name = "sy7758",
+ .of_match_table = sy7758_match_table,
+ },
+ .probe = sy7758_probe,
+ .remove = sy7758_remove,
+ .id_table = sy7758_ids,
+};
+
+module_i2c_driver(sy7758_driver);
+
+MODULE_DESCRIPTION("Silergy sy7758 Backlight Driver");
+MODULE_AUTHOR("Kancy Joe <kancy2333@outlook.com>");
+MODULE_LICENSE("GPL");
--
2.54.0
^ permalink raw reply related
* [PATCH 0/2] backlight: add support for Silergy SY7758
From: Alexandre Hamamdjian via B4 Relay @ 2026-05-10 17:08 UTC (permalink / raw)
To: Philippe Simons, Lee Jones, Daniel Thompson, Jingoo Han,
Pavel Machek, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Helge Deller
Cc: dri-devel, linux-leds, devicetree, linux-kernel, linux-fbdev,
Alexandre Hamamdjian
The Silergy SY7758 is an I2C-controlled multi-channel LED backlight
driver used to drive the edge-lit LED strings of LCD panels. It is
present on the Ayaneo Pocket DS handheld, where it drives the panel
backlight, and is required before the panel can be lit.
This series adds the device tree binding for the new "silergy,sy7758"
compatible and the matching driver. The driver registers a backlight
class device with a 12-bit linear brightness range and programs the
chip's mode and current configuration registers on the first non-zero
brightness update.
The Ayaneo Pocket DS device tree, posted as a separate series, depends
on the binding introduced here to describe its panel backlight.
Signed-off-by: Alexandre Hamamdjian <azkali.limited@gmail.com>
---
Alexandre Hamamdjian (2):
dt-bindings: leds: backlight: add Silergy SY7758
backlight: sy7758: add Silergy SY7758 backlight driver
.../bindings/leds/backlight/silergy,sy7758.yaml | 47 ++++++
MAINTAINERS | 7 +
drivers/video/backlight/Kconfig | 14 ++
drivers/video/backlight/Makefile | 1 +
drivers/video/backlight/sy7758.c | 169 +++++++++++++++++++++
5 files changed, 238 insertions(+)
---
base-commit: e98d21c170b01ddef366f023bbfcf6b31509fa83
change-id: 20260510-sy7758-e46d85fd0876
Best regards,
--
Alexandre Hamamdjian <azkali.limited@gmail.com>
^ permalink raw reply
* [PATCH] ARM: move Risc PC-specific <asm/hardware/iomd.h> header into mach-rpc
From: Ethan Nelson-Moore @ 2026-05-10 3:10 UTC (permalink / raw)
To: linux-arm-kernel, linux-i2c, linux-input, linux-fbdev
Cc: Russell King, Ethan Nelson-Moore, Andi Shyti, Dmitry Torokhov,
Helge Deller, Kees Cook
The <asm/hardware/iomd.h> header is specific to the IOMD chip used on
the Risc PC. Move it into mach-rpc to avoid polluting asm/hardware/
with machine-specific headers.
Also take the opportunity to remove a comment with the file path from
the header, which is bad style.
Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
---
MAINTAINERS | 1 -
arch/arm/mach-rpc/dma.c | 2 +-
arch/arm/{include/asm/hardware => mach-rpc/include/mach}/iomd.h | 2 --
arch/arm/mach-rpc/irq.c | 2 +-
arch/arm/mach-rpc/riscpc.c | 2 +-
arch/arm/mach-rpc/time.c | 2 +-
drivers/i2c/busses/i2c-acorn.c | 2 +-
drivers/input/mouse/rpcmouse.c | 2 +-
drivers/input/serio/rpckbd.c | 2 +-
drivers/video/fbdev/acornfb.h | 2 +-
10 files changed, 8 insertions(+), 11 deletions(-)
rename arch/arm/{include/asm/hardware => mach-rpc/include/mach}/iomd.h (98%)
diff --git a/MAINTAINERS b/MAINTAINERS
index 211cc683e25b..6a1da8903c04 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3398,7 +3398,6 @@ M: Russell King <linux@armlinux.org.uk>
L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
S: Maintained
W: http://www.armlinux.org.uk/
-F: arch/arm/include/asm/hardware/iomd.h
F: arch/arm/mach-rpc/
F: drivers/net/ethernet/8390/etherh.c
F: drivers/net/ethernet/i825xx/ether1*
diff --git a/arch/arm/mach-rpc/dma.c b/arch/arm/mach-rpc/dma.c
index 50e0f97afd75..717a81475670 100644
--- a/arch/arm/mach-rpc/dma.c
+++ b/arch/arm/mach-rpc/dma.c
@@ -20,7 +20,7 @@
#include <linux/uaccess.h>
#include <asm/mach/dma.h>
-#include <asm/hardware/iomd.h>
+#include <mach/iomd.h>
struct iomd_dma {
struct dma_struct dma;
diff --git a/arch/arm/include/asm/hardware/iomd.h b/arch/arm/mach-rpc/include/mach/iomd.h
similarity index 98%
rename from arch/arm/include/asm/hardware/iomd.h
rename to arch/arm/mach-rpc/include/mach/iomd.h
index e3f130345ebc..2a3f4a5f3fd9 100644
--- a/arch/arm/include/asm/hardware/iomd.h
+++ b/arch/arm/mach-rpc/include/mach/iomd.h
@@ -1,7 +1,5 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
- * arch/arm/include/asm/hardware/iomd.h
- *
* Copyright (C) 1999 Russell King
*
* This file contains information out the IOMD ASIC used in the
diff --git a/arch/arm/mach-rpc/irq.c b/arch/arm/mach-rpc/irq.c
index e924c9b813ab..649d81874c86 100644
--- a/arch/arm/mach-rpc/irq.c
+++ b/arch/arm/mach-rpc/irq.c
@@ -4,7 +4,7 @@
#include <linux/io.h>
#include <asm/mach/irq.h>
-#include <asm/hardware/iomd.h>
+#include <mach/iomd.h>
#include <asm/irq.h>
#include <asm/fiq.h>
diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
index f70fb9c4b0cb..d068f5e4873d 100644
--- a/arch/arm/mach-rpc/riscpc.c
+++ b/arch/arm/mach-rpc/riscpc.c
@@ -22,7 +22,7 @@
#include <asm/elf.h>
#include <asm/mach-types.h>
#include <mach/hardware.h>
-#include <asm/hardware/iomd.h>
+#include <mach/iomd.h>
#include <asm/page.h>
#include <asm/domain.h>
#include <asm/setup.h>
diff --git a/arch/arm/mach-rpc/time.c b/arch/arm/mach-rpc/time.c
index ad93c4dfafcd..566113f9774f 100644
--- a/arch/arm/mach-rpc/time.c
+++ b/arch/arm/mach-rpc/time.c
@@ -17,7 +17,7 @@
#include <linux/io.h>
#include <mach/hardware.h>
-#include <asm/hardware/iomd.h>
+#include <mach/iomd.h>
#include <asm/mach/time.h>
diff --git a/drivers/i2c/busses/i2c-acorn.c b/drivers/i2c/busses/i2c-acorn.c
index 99b6b1c3fd9e..703b4a42f466 100644
--- a/drivers/i2c/busses/i2c-acorn.c
+++ b/drivers/i2c/busses/i2c-acorn.c
@@ -13,7 +13,7 @@
#include <linux/io.h>
#include <mach/hardware.h>
-#include <asm/hardware/iomd.h>
+#include <mach/iomd.h>
#define FORCE_ONES 0xdc
#define SCL 0x02
diff --git a/drivers/input/mouse/rpcmouse.c b/drivers/input/mouse/rpcmouse.c
index 6774029e0a1a..475c3ca22fd4 100644
--- a/drivers/input/mouse/rpcmouse.c
+++ b/drivers/input/mouse/rpcmouse.c
@@ -23,7 +23,7 @@
#include <mach/hardware.h>
#include <asm/irq.h>
-#include <asm/hardware/iomd.h>
+#include <mach/iomd.h>
MODULE_AUTHOR("Vojtech Pavlik, Russell King");
MODULE_DESCRIPTION("Acorn RiscPC mouse driver");
diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c
index 4d817850ba3b..e452ad07e2fa 100644
--- a/drivers/input/serio/rpckbd.c
+++ b/drivers/input/serio/rpckbd.c
@@ -17,7 +17,7 @@
#include <linux/slab.h>
#include <mach/hardware.h>
-#include <asm/hardware/iomd.h>
+#include <mach/iomd.h>
MODULE_AUTHOR("Vojtech Pavlik, Russell King");
MODULE_DESCRIPTION("Acorn RiscPC PS/2 keyboard controller driver");
diff --git a/drivers/video/fbdev/acornfb.h b/drivers/video/fbdev/acornfb.h
index f8df4ecb4fd7..e65388587f80 100644
--- a/drivers/video/fbdev/acornfb.h
+++ b/drivers/video/fbdev/acornfb.h
@@ -7,7 +7,7 @@
* Frame buffer code for Acorn platforms
*/
#if defined(HAS_VIDC20)
-#include <asm/hardware/iomd.h>
+#include <mach/iomd.h>
#define VIDC_PALETTE_SIZE 256
#define VIDC_NAME "VIDC20"
#endif
--
2.43.0
^ permalink raw reply related
* [PATCH] ARM: mach-rpc: fix zImage build after recent font-related changes
From: Ethan Nelson-Moore @ 2026-05-10 2:39 UTC (permalink / raw)
To: linux-arm-kernel, linux-fbdev
Cc: Russell King, Ethan Nelson-Moore, Helge Deller, Thomas Zimmermann,
Kees Cook
The text display code used in the Risc PC kernel image decompression
code uses arch/arm/boot/compressed/font.c, which includes
lib/fonts/font_acorn_8x8.c, which further includes <linux/font.h>.
Since commit 97df8960240a ("lib/fonts: Provide helpers for calculating
glyph pitch and size") <linux/font.h> contains inline functions that
require __do_div64, which is not linked into the ARM kernel
decompressor. This makes Risc PC zImages fail to build.
Resolve this issue in the least intrusive way possible by preventing
the inclusion of <linux/font.h> (and the definition of a struct that
relies on it) when the decompressor is being built.
Fixes: 97df8960240a ("lib/fonts: Provide helpers for calculating glyph pitch and size")
Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
---
arch/arm/boot/compressed/Makefile | 6 +++++-
lib/fonts/font_acorn_8x8.c | 2 ++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index a159120d1e42..0e198a6ce447 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -157,4 +157,8 @@ $(obj)/piggy_data: $(obj)/../Image FORCE
$(obj)/piggy.o: $(obj)/piggy_data
-CFLAGS_font.o := -Dstatic=
+# Defining _VIDEO_FONT_H prevents including <linux/font.h>, which contains
+# inline functions that require __do_div64, which is not linked into the
+# decompressor. OMIT_FONT_DESC is used in lib/fonts/font_acorn_8x8.c to omit the
+# definition of the font's font_desc structure, which requires <linux/font.h>.
+CFLAGS_font.o := -Dstatic= -D_VIDEO_FONT_H -DOMIT_FONT_DESC
diff --git a/lib/fonts/font_acorn_8x8.c b/lib/fonts/font_acorn_8x8.c
index 36c51016769d..6b5291c23fc8 100644
--- a/lib/fonts/font_acorn_8x8.c
+++ b/lib/fonts/font_acorn_8x8.c
@@ -265,6 +265,7 @@ static const struct font_data acorndata_8x8 = {
/* FF */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
} };
+#ifndef OMIT_FONT_DESC /* Used by arch/arm/boot/compressed/Makefile */
const struct font_desc font_acorn_8x8 = {
.idx = ACORN8x8_IDX,
.name = "Acorn8x8",
@@ -278,3 +279,4 @@ const struct font_desc font_acorn_8x8 = {
.pref = 0,
#endif
};
+#endif /* OMIT_FONT_DESC */
--
2.43.0
^ permalink raw reply related
* [PATCH] fbdev: make sh_mobile_lcdc independent of FB_DEVICE
From: Melih Emik @ 2026-05-09 18:27 UTC (permalink / raw)
To: Helge Deller, linux-fbdev, dri-devel
Cc: Thomas Zimmermann, Wei Liu, Prasanna Kumar T S M, Zsolt Kajtar,
Mukesh Rathor, linux-kernel
CONFIG_FB_DEVICE controls the fbdev character device interface. SH Mobile
LCDC does not need that interface to build framebuffer support. Tying the
driver option to FB_DEVICE unnecessarily prevents it from being enabled
where device node support is disabled.
Relax the Kconfig dependency so the driver can be built independently of
the fbdev device interface.
Signed-off-by: Melih Emik <melihemik@noirlang.tr>
---
drivers/video/fbdev/Kconfig | 1 -
drivers/video/fbdev/sh_mobile_lcdcfb.c | 6 ++++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 085d3a202148..762c4369e00f 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -1521,7 +1521,6 @@ config FB_SH_MOBILE_LCDC
tristate "SuperH Mobile LCDC framebuffer support"
depends on FB && HAVE_CLK && HAS_IOMEM
depends on SUPERH || COMPILE_TEST
- depends on FB_DEVICE
depends on BACKLIGHT_CLASS_DEVICE
select FB_BACKLIGHT
select FB_DEFERRED_IO
diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c
index 72969fe8e513..b522b76b402d 100644
--- a/drivers/video/fbdev/sh_mobile_lcdcfb.c
+++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c
@@ -1511,7 +1511,7 @@ sh_mobile_lcdc_overlay_fb_unregister(struct sh_mobile_lcdc_overlay *ovl)
{
struct fb_info *info = ovl->info;
- if (info == NULL || info->dev == NULL)
+ if (!info || !refcount_read(&info->count))
return;
unregister_framebuffer(ovl->info);
@@ -1983,7 +1983,7 @@ static const struct fb_ops sh_mobile_lcdc_ops = {
static void
sh_mobile_lcdc_channel_fb_unregister(struct sh_mobile_lcdc_chan *ch)
{
- if (ch->info && ch->info->dev)
+ if (ch->info && refcount_read(&ch->info->count))
unregister_framebuffer(ch->info);
}
@@ -2640,7 +2640,9 @@ static int sh_mobile_lcdc_probe(struct platform_device *pdev)
static struct platform_driver sh_mobile_lcdc_driver = {
.driver = {
.name = "sh_mobile_lcdc_fb",
+#ifdef CONFIG_FB_DEVICE
.dev_groups = overlay_sysfs_groups,
+#endif
.pm = &sh_mobile_lcdc_dev_pm_ops,
},
.probe = sh_mobile_lcdc_probe,
--
2.54.0
^ permalink raw reply related
* [PATCH] staging: sm750fb: Add const to g_fbmode array
From: Alone @ 2026-05-09 16:40 UTC (permalink / raw)
To: Sudip Mukherjee, Teddy Wang, Greg Kroah-Hartman
Cc: linux-fbdev, linux-staging, linux-kernel, Chhabilal Dangal
From: Chhabilal Dangal <yogeshdangal66@gmail.com>
Add const qualifier to g_fbmode array since the array
itself is not modified after initialization.
Signed-off-by: Chhabilal Dangal <yogeshdangal66@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 9f3e3d37e..19c3da654 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -33,7 +33,7 @@
static int g_hwcursor = 1;
static int g_noaccel;
static int g_nomtrr;
-static const char *g_fbmode[] = {NULL, NULL};
+static const char * const g_fbmode[] = {NULL, NULL};
static const char *g_def_fbmode = "1024x768-32@60";
static char *g_settings;
static int g_dualview;
--
2.54.0
^ permalink raw reply related
* [PATCH] fbdev: sunxvr2500: replace printk with device-aware logging functions
From: Rahman Mahmutović @ 2026-05-09 13:57 UTC (permalink / raw)
To: linux-fbdev; +Cc: deller, dri-devel, linux-kernel, Rahman Mahmutović
Replace all printk() calls with appropriate device-aware logging
functions to properly associate log messages with the PCI device.
- Use pci_err() for errors where struct pci_dev is available
- Use pci_info() for info messages where struct pci_dev is available
- Use dev_err() for errors where only struct fb_info is available
Remove redundant 's3d:' prefix and pci_name() calls as device-aware
functions include device identification automatically.
Assisted-by: Claude:claude-sonnet-4-6
Signed-off-by: Rahman Mahmutović <mahmutovicrahman5@gmail.com>
---
drivers/video/fbdev/sunxvr2500.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/drivers/video/fbdev/sunxvr2500.c b/drivers/video/fbdev/sunxvr2500.c
index 42426d09b..3a36e7524 100644
--- a/drivers/video/fbdev/sunxvr2500.c
+++ b/drivers/video/fbdev/sunxvr2500.c
@@ -38,8 +38,7 @@ static int s3d_get_props(struct s3d_info *sp)
sp->depth = of_getintprop_default(sp->of_node, "depth", 8);
if (!sp->width || !sp->height) {
- printk(KERN_ERR "s3d: Critical properties missing for %s\n",
- pci_name(sp->pdev));
+ pci_err(sp->pdev, "Critical properties missing\n");
return -EINVAL;
}
@@ -107,7 +106,7 @@ static int s3d_set_fbinfo(struct s3d_info *sp)
var->transp.length = 0;
if (fb_alloc_cmap(&info->cmap, 256, 0)) {
- printk(KERN_ERR "s3d: Cannot allocate color map.\n");
+ dev_err(info->dev, "Cannot allocate color map\n");
return -ENOMEM;
}
@@ -127,8 +126,7 @@ static int s3d_pci_register(struct pci_dev *pdev,
err = pci_enable_device(pdev);
if (err < 0) {
- printk(KERN_ERR "s3d: Cannot enable PCI device %s\n",
- pci_name(pdev));
+ pci_err(pdev, "Cannot enable PCI device\n");
goto err_out;
}
@@ -143,8 +141,7 @@ static int s3d_pci_register(struct pci_dev *pdev,
sp->pdev = pdev;
sp->of_node = pci_device_to_OF_node(pdev);
if (!sp->of_node) {
- printk(KERN_ERR "s3d: Cannot find OF node of %s\n",
- pci_name(pdev));
+ pci_err(pdev, "Cannot find OF node\n");
err = -ENODEV;
goto err_release_fb;
}
@@ -153,8 +150,7 @@ static int s3d_pci_register(struct pci_dev *pdev,
err = pci_request_region(pdev, 1, "s3d framebuffer");
if (err < 0) {
- printk("s3d: Cannot request region 1 for %s\n",
- pci_name(pdev));
+ pci_err(pdev, "Cannot request region 1\n");
goto err_release_fb;
}
@@ -194,12 +190,11 @@ static int s3d_pci_register(struct pci_dev *pdev,
pci_set_drvdata(pdev, info);
- printk("s3d: Found device at %s\n", pci_name(pdev));
+ pci_info(pdev, "Found device\n");
err = register_framebuffer(info);
if (err < 0) {
- printk(KERN_ERR "s3d: Could not register framebuffer %s\n",
- pci_name(pdev));
+ pci_err(pdev, "Could not register framebuffer\n");
goto err_unmap_fb;
}
--
2.43.0
^ permalink raw reply related
* [PATCH] fbdev: chipsfb: add missing MODULE_DESCRIPTION() macro
From: Rahman Mahmutović @ 2026-05-09 13:18 UTC (permalink / raw)
To: linux-fbdev; +Cc: deller, dri-devel, linux-kernel, Rahman Mahmutović
The chipsfb driver is missing the MODULE_DESCRIPTION macro which
is required for all kernel modules.
Assisted-by: Claude:claude-sonnet-4-6
Signed-off-by: Rahman Mahmutović <mahmutovicrahman5@gmail.com>
---
drivers/video/fbdev/chipsfb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/video/fbdev/chipsfb.c b/drivers/video/fbdev/chipsfb.c
index 33caf0b99..946e30fcb 100644
--- a/drivers/video/fbdev/chipsfb.c
+++ b/drivers/video/fbdev/chipsfb.c
@@ -526,4 +526,5 @@ static void __exit chipsfb_exit(void)
pci_unregister_driver(&chipsfb_driver);
}
+MODULE_DESCRIPTION("Chips & Technologies 65550 frame buffer driver");
MODULE_LICENSE("GPL");
--
2.43.0
^ permalink raw reply related
* Re: [PATCH] video: fbdev: remove Hercules monochrome ISA graphics adapter driver
From: Thomas Zimmermann @ 2026-05-08 12:08 UTC (permalink / raw)
To: Ethan Nelson-Moore, linux-fbdev
Cc: Ferenc Bakonyi, Helge Deller, Jakub Kicinski, Andrew Morton,
Namjae Jeon, Hisam Mehboob, Martin Kepplinger-Novaković,
Diego Viola, Wei Liu, Prasanna Kumar T S M, robgithub,
Hardik Phalet
In-Reply-To: <20260503045653.33522-1-enelsonmoore@gmail.com>
Hi
Am 03.05.26 um 06:56 schrieb Ethan Nelson-Moore:
> The hgafb supports graphics adapters compatible with the Hercules
> adapter from 1984. These were ISA cards or onboard devices that
> supported monochrome 720x348 graphics. This driver was created in 1999
> by Ferenc Bakonyi. In the entire Git history (since Linux 2.6.12-rc2),
> there has only been one commit in 2010 which indicated that the driver
> was in use, commit 529ed806d454 ("video: Fix the HGA framebuffer
> driver"). The commit message states:
> Only tested with fbcon, since most fbdev-based software appears
> to only support 12bpp and up. It does not appear that this driver has
> worked for at least the entire 2.6.x series, perhaps since 2002.
> Given the age and limited capabilities of the hardware and the lack of
> users, remove this driver and move the former maintainer to CREDITS.
>
> Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
FWIW
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> CREDITS | 3 +
> MAINTAINERS | 7 -
> drivers/video/fbdev/Kconfig | 13 -
> drivers/video/fbdev/Makefile | 1 -
> drivers/video/fbdev/hgafb.c | 685 -----------------------------------
> 5 files changed, 3 insertions(+), 706 deletions(-)
> delete mode 100644 drivers/video/fbdev/hgafb.c
>
> diff --git a/CREDITS b/CREDITS
> index 17962bdd6dbd..59d5de3eeb5b 100644
> --- a/CREDITS
> +++ b/CREDITS
> @@ -197,6 +197,9 @@ S: Hauptstrasse 19
> S: 79837 St. Blasien
> S: Germany
>
> +N: Ferenc Bakonyi
> +D: Hercules graphics adapter framebuffer driver
> +
> N: Krishna Balasubramanian
> E: balasub@cis.ohio-state.edu
> D: Wrote SYS V IPC (part of standard kernel since 0.99.10)
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 882214b0e7db..3194befa6a13 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -11373,13 +11373,6 @@ F: Documentation/filesystems/hfsplus.rst
> F: fs/hfsplus/
> F: include/linux/hfs_common.h
>
> -HGA FRAMEBUFFER DRIVER
> -M: Ferenc Bakonyi <fero@drama.obuda.kando.hu>
> -L: linux-nvidia@lists.surfsouth.com
> -S: Maintained
> -W: http://drama.obuda.kando.hu/~fero/cgi-bin/hgafb.shtml
> -F: drivers/video/fbdev/hgafb.c
> -
> HIBERNATION (aka Software Suspend, aka swsusp)
> M: "Rafael J. Wysocki" <rafael@kernel.org>
> R: Pavel Machek <pavel@kernel.org>
> diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
> index 1c73d560f196..085d3a202148 100644
> --- a/drivers/video/fbdev/Kconfig
> +++ b/drivers/video/fbdev/Kconfig
> @@ -453,19 +453,6 @@ config FB_N411
> This enables support for the Apollo display controller in its
> Hecuba form using the n411 devkit.
>
> -config FB_HGA
> - tristate "Hercules mono graphics support"
> - depends on FB && X86
> - select FB_IOMEM_FOPS
> - help
> - Say Y here if you have a Hercules mono graphics card.
> -
> - To compile this driver as a module, choose M here: the
> - module will be called hgafb.
> -
> - As this card technology is at least 25 years old,
> - most people will answer N here.
> -
> config FB_GBE
> bool "SGI Graphics Backend frame buffer support"
> depends on (FB = y) && HAS_IOMEM
> diff --git a/drivers/video/fbdev/Makefile b/drivers/video/fbdev/Makefile
> index 36a18d958ba0..0b17c878154d 100644
> --- a/drivers/video/fbdev/Makefile
> +++ b/drivers/video/fbdev/Makefile
> @@ -59,7 +59,6 @@ obj-$(CONFIG_FB_ATARI) += atafb.o c2p_iplan2.o atafb_mfb.o \
> obj-$(CONFIG_FB_MAC) += macfb.o
> obj-$(CONFIG_FB_HECUBA) += hecubafb.o
> obj-$(CONFIG_FB_N411) += n411.o
> -obj-$(CONFIG_FB_HGA) += hgafb.o
> obj-$(CONFIG_FB_XVR500) += sunxvr500.o
> obj-$(CONFIG_FB_XVR2500) += sunxvr2500.o
> obj-$(CONFIG_FB_XVR1000) += sunxvr1000.o
> diff --git a/drivers/video/fbdev/hgafb.c b/drivers/video/fbdev/hgafb.c
> deleted file mode 100644
> index d32fd1c5217c..000000000000
> --- a/drivers/video/fbdev/hgafb.c
> +++ /dev/null
> @@ -1,685 +0,0 @@
> -/*
> - * linux/drivers/video/hgafb.c -- Hercules graphics adaptor frame buffer device
> - *
> - * Created 25 Nov 1999 by Ferenc Bakonyi (fero@drama.obuda.kando.hu)
> - * Based on skeletonfb.c by Geert Uytterhoeven and
> - * mdacon.c by Andrew Apted
> - *
> - * History:
> - *
> - * - Revision 0.1.8 (23 Oct 2002): Ported to new framebuffer api.
> - *
> - * - Revision 0.1.7 (23 Jan 2001): fix crash resulting from MDA only cards
> - * being detected as Hercules. (Paul G.)
> - * - Revision 0.1.6 (17 Aug 2000): new style structs
> - * documentation
> - * - Revision 0.1.5 (13 Mar 2000): spinlocks instead of saveflags();cli();etc
> - * minor fixes
> - * - Revision 0.1.4 (24 Jan 2000): fixed a bug in hga_card_detect() for
> - * HGA-only systems
> - * - Revision 0.1.3 (22 Jan 2000): modified for the new fb_info structure
> - * screen is cleared after rmmod
> - * virtual resolutions
> - * module parameter 'nologo={0|1}'
> - * the most important: boot logo :)
> - * - Revision 0.1.0 (6 Dec 1999): faster scrolling and minor fixes
> - * - First release (25 Nov 1999)
> - *
> - * This file is subject to the terms and conditions of the GNU General Public
> - * License. See the file COPYING in the main directory of this archive
> - * for more details.
> - */
> -
> -#include <linux/module.h>
> -#include <linux/kernel.h>
> -#include <linux/errno.h>
> -#include <linux/spinlock.h>
> -#include <linux/string.h>
> -#include <linux/mm.h>
> -#include <linux/delay.h>
> -#include <linux/fb.h>
> -#include <linux/init.h>
> -#include <linux/ioport.h>
> -#include <linux/platform_device.h>
> -#include <asm/io.h>
> -#include <asm/vga.h>
> -
> -#if 0
> -#define DPRINTK(args...) printk(KERN_DEBUG __FILE__": " ##args)
> -#else
> -#define DPRINTK(args...)
> -#endif
> -
> -#if 0
> -#define CHKINFO(ret) if (info != &fb_info) { printk(KERN_DEBUG __FILE__": This should never happen, line:%d \n", __LINE__); return ret; }
> -#else
> -#define CHKINFO(ret)
> -#endif
> -
> -/* Description of the hardware layout */
> -
> -static void __iomem *hga_vram; /* Base of video memory */
> -static unsigned long hga_vram_len; /* Size of video memory */
> -
> -#define HGA_ROWADDR(row) ((row%4)*8192 + (row>>2)*90)
> -#define HGA_TXT 0
> -#define HGA_GFX 1
> -
> -static inline u8 __iomem * rowaddr(struct fb_info *info, u_int row)
> -{
> - return info->screen_base + HGA_ROWADDR(row);
> -}
> -
> -static int hga_mode = -1; /* 0 = txt, 1 = gfx mode */
> -
> -static enum { TYPE_HERC, TYPE_HERCPLUS, TYPE_HERCCOLOR } hga_type;
> -static char *hga_type_name;
> -
> -#define HGA_INDEX_PORT 0x3b4 /* Register select port */
> -#define HGA_VALUE_PORT 0x3b5 /* Register value port */
> -#define HGA_MODE_PORT 0x3b8 /* Mode control port */
> -#define HGA_STATUS_PORT 0x3ba /* Status and Config port */
> -#define HGA_GFX_PORT 0x3bf /* Graphics control port */
> -
> -/* HGA register values */
> -
> -#define HGA_CURSOR_BLINKING 0x00
> -#define HGA_CURSOR_OFF 0x20
> -#define HGA_CURSOR_SLOWBLINK 0x60
> -
> -#define HGA_MODE_GRAPHICS 0x02
> -#define HGA_MODE_VIDEO_EN 0x08
> -#define HGA_MODE_BLINK_EN 0x20
> -#define HGA_MODE_GFX_PAGE1 0x80
> -
> -#define HGA_STATUS_HSYNC 0x01
> -#define HGA_STATUS_VSYNC 0x80
> -#define HGA_STATUS_VIDEO 0x08
> -
> -#define HGA_CONFIG_COL132 0x08
> -#define HGA_GFX_MODE_EN 0x01
> -#define HGA_GFX_PAGE_EN 0x02
> -
> -/* Global locks */
> -
> -static DEFINE_SPINLOCK(hga_reg_lock);
> -
> -/* Framebuffer driver structures */
> -
> -static const struct fb_var_screeninfo hga_default_var = {
> - .xres = 720,
> - .yres = 348,
> - .xres_virtual = 720,
> - .yres_virtual = 348,
> - .bits_per_pixel = 1,
> - .red = {0, 1, 0},
> - .green = {0, 1, 0},
> - .blue = {0, 1, 0},
> - .transp = {0, 0, 0},
> - .height = -1,
> - .width = -1,
> -};
> -
> -static struct fb_fix_screeninfo hga_fix = {
> - .id = "HGA",
> - .type = FB_TYPE_PACKED_PIXELS, /* (not sure) */
> - .visual = FB_VISUAL_MONO10,
> - .xpanstep = 8,
> - .ypanstep = 8,
> - .line_length = 90,
> - .accel = FB_ACCEL_NONE
> -};
> -
> -/* Don't assume that tty1 will be the initial current console. */
> -static int release_io_port = 0;
> -static int release_io_ports = 0;
> -static bool nologo = 0;
> -
> -/* -------------------------------------------------------------------------
> - *
> - * Low level hardware functions
> - *
> - * ------------------------------------------------------------------------- */
> -
> -static void write_hga_b(unsigned int val, unsigned char reg)
> -{
> - outb_p(reg, HGA_INDEX_PORT);
> - outb_p(val, HGA_VALUE_PORT);
> -}
> -
> -static void write_hga_w(unsigned int val, unsigned char reg)
> -{
> - outb_p(reg, HGA_INDEX_PORT); outb_p(val >> 8, HGA_VALUE_PORT);
> - outb_p(reg+1, HGA_INDEX_PORT); outb_p(val & 0xff, HGA_VALUE_PORT);
> -}
> -
> -static int test_hga_b(unsigned char val, unsigned char reg)
> -{
> - outb_p(reg, HGA_INDEX_PORT);
> - outb (val, HGA_VALUE_PORT);
> - udelay(20); val = (inb_p(HGA_VALUE_PORT) == val);
> - return val;
> -}
> -
> -static void hga_clear_screen(void)
> -{
> - unsigned char fillchar = 0xbf; /* magic */
> - unsigned long flags;
> -
> - spin_lock_irqsave(&hga_reg_lock, flags);
> - if (hga_mode == HGA_TXT)
> - fillchar = ' ';
> - else if (hga_mode == HGA_GFX)
> - fillchar = 0x00;
> - spin_unlock_irqrestore(&hga_reg_lock, flags);
> - if (fillchar != 0xbf)
> - memset_io(hga_vram, fillchar, hga_vram_len);
> -}
> -
> -static void hga_txt_mode(void)
> -{
> - unsigned long flags;
> -
> - spin_lock_irqsave(&hga_reg_lock, flags);
> - outb_p(HGA_MODE_VIDEO_EN | HGA_MODE_BLINK_EN, HGA_MODE_PORT);
> - outb_p(0x00, HGA_GFX_PORT);
> - outb_p(0x00, HGA_STATUS_PORT);
> -
> - write_hga_b(0x61, 0x00); /* horizontal total */
> - write_hga_b(0x50, 0x01); /* horizontal displayed */
> - write_hga_b(0x52, 0x02); /* horizontal sync pos */
> - write_hga_b(0x0f, 0x03); /* horizontal sync width */
> -
> - write_hga_b(0x19, 0x04); /* vertical total */
> - write_hga_b(0x06, 0x05); /* vertical total adjust */
> - write_hga_b(0x19, 0x06); /* vertical displayed */
> - write_hga_b(0x19, 0x07); /* vertical sync pos */
> -
> - write_hga_b(0x02, 0x08); /* interlace mode */
> - write_hga_b(0x0d, 0x09); /* maximum scanline */
> - write_hga_b(0x0c, 0x0a); /* cursor start */
> - write_hga_b(0x0d, 0x0b); /* cursor end */
> -
> - write_hga_w(0x0000, 0x0c); /* start address */
> - write_hga_w(0x0000, 0x0e); /* cursor location */
> -
> - hga_mode = HGA_TXT;
> - spin_unlock_irqrestore(&hga_reg_lock, flags);
> -}
> -
> -static void hga_gfx_mode(void)
> -{
> - unsigned long flags;
> -
> - spin_lock_irqsave(&hga_reg_lock, flags);
> - outb_p(0x00, HGA_STATUS_PORT);
> - outb_p(HGA_GFX_MODE_EN, HGA_GFX_PORT);
> - outb_p(HGA_MODE_VIDEO_EN | HGA_MODE_GRAPHICS, HGA_MODE_PORT);
> -
> - write_hga_b(0x35, 0x00); /* horizontal total */
> - write_hga_b(0x2d, 0x01); /* horizontal displayed */
> - write_hga_b(0x2e, 0x02); /* horizontal sync pos */
> - write_hga_b(0x07, 0x03); /* horizontal sync width */
> -
> - write_hga_b(0x5b, 0x04); /* vertical total */
> - write_hga_b(0x02, 0x05); /* vertical total adjust */
> - write_hga_b(0x57, 0x06); /* vertical displayed */
> - write_hga_b(0x57, 0x07); /* vertical sync pos */
> -
> - write_hga_b(0x02, 0x08); /* interlace mode */
> - write_hga_b(0x03, 0x09); /* maximum scanline */
> - write_hga_b(0x00, 0x0a); /* cursor start */
> - write_hga_b(0x00, 0x0b); /* cursor end */
> -
> - write_hga_w(0x0000, 0x0c); /* start address */
> - write_hga_w(0x0000, 0x0e); /* cursor location */
> -
> - hga_mode = HGA_GFX;
> - spin_unlock_irqrestore(&hga_reg_lock, flags);
> -}
> -
> -static void hga_show_logo(struct fb_info *info)
> -{
> -/*
> - void __iomem *dest = hga_vram;
> - char *logo = linux_logo_bw;
> - int x, y;
> -
> - for (y = 134; y < 134 + 80 ; y++) * this needs some cleanup *
> - for (x = 0; x < 10 ; x++)
> - writeb(~*(logo++),(dest + HGA_ROWADDR(y) + x + 40));
> -*/
> -}
> -
> -static void hga_pan(unsigned int xoffset, unsigned int yoffset)
> -{
> - unsigned int base;
> - unsigned long flags;
> -
> - base = (yoffset / 8) * 90 + xoffset;
> - spin_lock_irqsave(&hga_reg_lock, flags);
> - write_hga_w(base, 0x0c); /* start address */
> - spin_unlock_irqrestore(&hga_reg_lock, flags);
> - DPRINTK("hga_pan: base:%d\n", base);
> -}
> -
> -static void hga_blank(int blank_mode)
> -{
> - unsigned long flags;
> -
> - spin_lock_irqsave(&hga_reg_lock, flags);
> - if (blank_mode) {
> - outb_p(0x00, HGA_MODE_PORT); /* disable video */
> - } else {
> - outb_p(HGA_MODE_VIDEO_EN | HGA_MODE_GRAPHICS, HGA_MODE_PORT);
> - }
> - spin_unlock_irqrestore(&hga_reg_lock, flags);
> -}
> -
> -static int hga_card_detect(struct platform_device *pdev)
> -{
> - int count = 0;
> - void __iomem *p, *q;
> - unsigned short p_save, q_save;
> -
> - hga_vram_len = 0x08000;
> -
> - if (!devm_request_mem_region(&pdev->dev, 0xb0000, hga_vram_len, "hgafb")) {
> - dev_err(&pdev->dev, "cannot reserve video memory at 0xb0000\n");
> - return -EBUSY;
> - }
> -
> - hga_vram = ioremap(0xb0000, hga_vram_len);
> - if (!hga_vram)
> - return -ENOMEM;
> -
> - if (request_region(0x3b0, 12, "hgafb"))
> - release_io_ports = 1;
> - if (request_region(0x3bf, 1, "hgafb"))
> - release_io_port = 1;
> -
> - /* do a memory check */
> -
> - p = hga_vram;
> - q = hga_vram + 0x01000;
> -
> - p_save = readw(p); q_save = readw(q);
> -
> - writew(0xaa55, p); if (readw(p) == 0xaa55) count++;
> - writew(0x55aa, p); if (readw(p) == 0x55aa) count++;
> - writew(p_save, p);
> -
> - if (count != 2)
> - goto error;
> -
> - /* Ok, there is definitely a card registering at the correct
> - * memory location, so now we do an I/O port test.
> - */
> -
> - if (!test_hga_b(0x66, 0x0f)) /* cursor low register */
> - goto error;
> -
> - if (!test_hga_b(0x99, 0x0f)) /* cursor low register */
> - goto error;
> -
> - /* See if the card is a Hercules, by checking whether the vsync
> - * bit of the status register is changing. This test lasts for
> - * approximately 1/10th of a second.
> - */
> -
> - p_save = q_save = inb_p(HGA_STATUS_PORT) & HGA_STATUS_VSYNC;
> -
> - for (count=0; count < 50000 && p_save == q_save; count++) {
> - q_save = inb(HGA_STATUS_PORT) & HGA_STATUS_VSYNC;
> - udelay(2);
> - }
> -
> - if (p_save == q_save)
> - goto error;
> -
> - switch (inb_p(HGA_STATUS_PORT) & 0x70) {
> - case 0x10:
> - hga_type = TYPE_HERCPLUS;
> - hga_type_name = "HerculesPlus";
> - break;
> - case 0x50:
> - hga_type = TYPE_HERCCOLOR;
> - hga_type_name = "HerculesColor";
> - break;
> - default:
> - hga_type = TYPE_HERC;
> - hga_type_name = "Hercules";
> - break;
> - }
> - return 0;
> -error:
> - if (release_io_ports)
> - release_region(0x3b0, 12);
> - if (release_io_port)
> - release_region(0x3bf, 1);
> -
> - iounmap(hga_vram);
> -
> - pr_err("hgafb: HGA card not detected.\n");
> -
> - return -EINVAL;
> -}
> -
> -/**
> - * hgafb_open - open the framebuffer device
> - * @info: pointer to fb_info object containing info for current hga board
> - * @init: open by console system or userland.
> - *
> - * Returns: %0
> - */
> -
> -static int hgafb_open(struct fb_info *info, int init)
> -{
> - hga_gfx_mode();
> - hga_clear_screen();
> - if (!nologo) hga_show_logo(info);
> - return 0;
> -}
> -
> -/**
> - * hgafb_release - open the framebuffer device
> - * @info: pointer to fb_info object containing info for current hga board
> - * @init: open by console system or userland.
> - *
> - * Returns: %0
> - */
> -
> -static int hgafb_release(struct fb_info *info, int init)
> -{
> - hga_txt_mode();
> - hga_clear_screen();
> - return 0;
> -}
> -
> -/**
> - * hgafb_setcolreg - set color registers
> - * @regno:register index to set
> - * @red:red value, unused
> - * @green:green value, unused
> - * @blue:blue value, unused
> - * @transp:transparency value, unused
> - * @info:unused
> - *
> - * This callback function is used to set the color registers of a HGA
> - * board. Since we have only two fixed colors only @regno is checked.
> - * A zero is returned on success and 1 for failure.
> - *
> - * Returns: %0
> - */
> -
> -static int hgafb_setcolreg(u_int regno, u_int red, u_int green, u_int blue,
> - u_int transp, struct fb_info *info)
> -{
> - if (regno > 1)
> - return 1;
> - return 0;
> -}
> -
> -/**
> - * hgafb_pan_display - pan or wrap the display
> - * @var:contains new xoffset, yoffset and vmode values
> - * @info:pointer to fb_info object containing info for current hga board
> - *
> - * This function looks only at xoffset, yoffset and the %FB_VMODE_YWRAP
> - * flag in @var. If input parameters are correct it calls hga_pan() to
> - * program the hardware. @info->var is updated to the new values.
> - *
> - * Returns: %0 on success or %-EINVAL for failure.
> - */
> -
> -static int hgafb_pan_display(struct fb_var_screeninfo *var,
> - struct fb_info *info)
> -{
> - if (var->vmode & FB_VMODE_YWRAP) {
> - if (var->yoffset >= info->var.yres_virtual ||
> - var->xoffset)
> - return -EINVAL;
> - } else {
> - if (var->xoffset + info->var.xres > info->var.xres_virtual
> - || var->yoffset + info->var.yres > info->var.yres_virtual
> - || var->yoffset % 8)
> - return -EINVAL;
> - }
> -
> - hga_pan(var->xoffset, var->yoffset);
> - return 0;
> -}
> -
> -/**
> - * hgafb_blank - (un)blank the screen
> - * @blank_mode:blanking method to use
> - * @info:unused
> - *
> - * Blank the screen if blank_mode != 0, else unblank.
> - * Implements VESA suspend and powerdown modes on hardware that supports
> - * disabling hsync/vsync:
> - * @blank_mode == 2 means suspend vsync,
> - * @blank_mode == 3 means suspend hsync,
> - * @blank_mode == 4 means powerdown.
> - *
> - * Returns: %0
> - */
> -
> -static int hgafb_blank(int blank_mode, struct fb_info *info)
> -{
> - hga_blank(blank_mode);
> - return 0;
> -}
> -
> -/*
> - * Accel functions
> - */
> -static void hgafb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
> -{
> - u_int rows, y;
> - u8 __iomem *dest;
> -
> - y = rect->dy;
> -
> - for (rows = rect->height; rows--; y++) {
> - dest = rowaddr(info, y) + (rect->dx >> 3);
> - switch (rect->rop) {
> - case ROP_COPY:
> - memset_io(dest, rect->color, (rect->width >> 3));
> - break;
> - case ROP_XOR:
> - fb_writeb(~(fb_readb(dest)), dest);
> - break;
> - }
> - }
> -}
> -
> -static void hgafb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
> -{
> - u_int rows, y1, y2;
> - u8 __iomem *src;
> - u8 __iomem *dest;
> -
> - if (area->dy <= area->sy) {
> - y1 = area->sy;
> - y2 = area->dy;
> -
> - for (rows = area->height; rows--; ) {
> - src = rowaddr(info, y1) + (area->sx >> 3);
> - dest = rowaddr(info, y2) + (area->dx >> 3);
> - memmove(dest, src, (area->width >> 3));
> - y1++;
> - y2++;
> - }
> - } else {
> - y1 = area->sy + area->height - 1;
> - y2 = area->dy + area->height - 1;
> -
> - for (rows = area->height; rows--;) {
> - src = rowaddr(info, y1) + (area->sx >> 3);
> - dest = rowaddr(info, y2) + (area->dx >> 3);
> - memmove(dest, src, (area->width >> 3));
> - y1--;
> - y2--;
> - }
> - }
> -}
> -
> -static void hgafb_imageblit(struct fb_info *info, const struct fb_image *image)
> -{
> - u8 __iomem *dest;
> - u8 *cdat = (u8 *) image->data;
> - u_int rows, y = image->dy;
> - u_int x;
> - u8 d;
> -
> - for (rows = image->height; rows--; y++) {
> - for (x = 0; x < image->width; x+= 8) {
> - d = *cdat++;
> - dest = rowaddr(info, y) + ((image->dx + x)>> 3);
> - fb_writeb(d, dest);
> - }
> - }
> -}
> -
> -static const struct fb_ops hgafb_ops = {
> - .owner = THIS_MODULE,
> - .fb_open = hgafb_open,
> - .fb_release = hgafb_release,
> - __FB_DEFAULT_IOMEM_OPS_RDWR,
> - .fb_setcolreg = hgafb_setcolreg,
> - .fb_pan_display = hgafb_pan_display,
> - .fb_blank = hgafb_blank,
> - .fb_fillrect = hgafb_fillrect,
> - .fb_copyarea = hgafb_copyarea,
> - .fb_imageblit = hgafb_imageblit,
> - __FB_DEFAULT_IOMEM_OPS_MMAP,
> -};
> -
> -/* ------------------------------------------------------------------------- *
> - *
> - * Functions in fb_info
> - *
> - * ------------------------------------------------------------------------- */
> -
> -/* ------------------------------------------------------------------------- */
> -
> - /*
> - * Initialization
> - */
> -
> -static int hgafb_probe(struct platform_device *pdev)
> -{
> - struct fb_info *info;
> - int ret;
> -
> - ret = hga_card_detect(pdev);
> - if (ret)
> - return ret;
> -
> - printk(KERN_INFO "hgafb: %s with %ldK of memory detected.\n",
> - hga_type_name, hga_vram_len/1024);
> -
> - info = framebuffer_alloc(0, &pdev->dev);
> - if (!info) {
> - iounmap(hga_vram);
> - return -ENOMEM;
> - }
> -
> - hga_fix.smem_start = (unsigned long)hga_vram;
> - hga_fix.smem_len = hga_vram_len;
> -
> - info->flags = FBINFO_HWACCEL_YPAN;
> - info->var = hga_default_var;
> - info->fix = hga_fix;
> - info->monspecs.hfmin = 0;
> - info->monspecs.hfmax = 0;
> - info->monspecs.vfmin = 10000;
> - info->monspecs.vfmax = 10000;
> - info->monspecs.dpms = 0;
> - info->fbops = &hgafb_ops;
> - info->screen_base = hga_vram;
> -
> - if (register_framebuffer(info) < 0) {
> - framebuffer_release(info);
> - iounmap(hga_vram);
> - return -EINVAL;
> - }
> -
> - fb_info(info, "%s frame buffer device\n", info->fix.id);
> - platform_set_drvdata(pdev, info);
> - return 0;
> -}
> -
> -static void hgafb_remove(struct platform_device *pdev)
> -{
> - struct fb_info *info = platform_get_drvdata(pdev);
> -
> - hga_txt_mode();
> - hga_clear_screen();
> -
> - if (info) {
> - unregister_framebuffer(info);
> - framebuffer_release(info);
> - }
> -
> - iounmap(hga_vram);
> -
> - if (release_io_ports)
> - release_region(0x3b0, 12);
> -
> - if (release_io_port)
> - release_region(0x3bf, 1);
> -}
> -
> -static struct platform_driver hgafb_driver = {
> - .probe = hgafb_probe,
> - .remove = hgafb_remove,
> - .driver = {
> - .name = "hgafb",
> - },
> -};
> -
> -static struct platform_device *hgafb_device;
> -
> -static int __init hgafb_init(void)
> -{
> - int ret;
> -
> - if (fb_get_options("hgafb", NULL))
> - return -ENODEV;
> -
> - ret = platform_driver_register(&hgafb_driver);
> -
> - if (!ret) {
> - hgafb_device = platform_device_register_simple("hgafb", 0, NULL, 0);
> -
> - if (IS_ERR(hgafb_device)) {
> - platform_driver_unregister(&hgafb_driver);
> - ret = PTR_ERR(hgafb_device);
> - }
> - }
> -
> - return ret;
> -}
> -
> -static void __exit hgafb_exit(void)
> -{
> - platform_device_unregister(hgafb_device);
> - platform_driver_unregister(&hgafb_driver);
> -}
> -
> -/* -------------------------------------------------------------------------
> - *
> - * Modularization
> - *
> - * ------------------------------------------------------------------------- */
> -
> -MODULE_AUTHOR("Ferenc Bakonyi <fero@drama.obuda.kando.hu>");
> -MODULE_DESCRIPTION("FBDev driver for Hercules Graphics Adaptor");
> -MODULE_LICENSE("GPL");
> -
> -module_param(nologo, bool, 0);
> -MODULE_PARM_DESC(nologo, "Disables startup logo if != 0 (default=0)");
> -module_init(hgafb_init);
> -module_exit(hgafb_exit);
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
^ permalink raw reply
* Re: [PATCH v2 0/2] Remove redundant X86 dependency for the cgbc backlight driver
From: Lee Jones @ 2026-05-07 13:25 UTC (permalink / raw)
To: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller,
Thomas Richard
Cc: Thomas Petazzoni, dri-devel, linux-fbdev, linux-kernel
In-Reply-To: <20260427-backlight-cgbc-remove-x86-dependency-v2-0-da9f2375a34a@bootlin.com>
On Mon, 27 Apr 2026 11:40:32 +0200, Thomas Richard wrote:
> For this second iteration, I just added Daniel's RB tags.
Applied, thanks!
[1/2] backlight: cgbc: Remove redundant X86 dependency
commit: db8e26c435698222b333cafcbc043dfdf083d591
[2/2] MAINTAINERS: Add cgbc backlight driver
commit: acea35b567d0f610d533ca661f4106ac12583f78
--
Lee Jones [李琼斯]
^ permalink raw reply
* Re: [PATCH] staging: sm750fb: add const to g_fbmode array
From: Chaitanya Sabnis @ 2026-05-06 10:44 UTC (permalink / raw)
To: Ahmet Sezgin Duran
Cc: sudipm.mukherjee, teddy.wang, gregkh, linux-fbdev, linux-staging,
linux-kernel
In-Reply-To: <5113f014-f0fb-406a-9b3c-725acff62c9f@sezginduran.net>
On Wed, May 6, 2026 Ahmet Sezgin Duran wrote:
Are you sure that you had enabled the module? When I apply and try to
compile your patch, I get these errors:
Hi Ahmet,
You are completely right, and I apologize. I fell into the trap of
running make M=drivers/staging/sm750fb/ without verifying that
CONFIG_FB_SM750 was actually enabled in my .config first. My local
build silently skipped the compilation, which led me to falsely
believe the syntax was valid.
Looking at the errors you provided, it is clear that g_fbmode is
dynamically assigned during module setup (lines 896, 900), meaning the
checkpatch suggestion to make it const conflicts with the driver's
logic.
Please drop this patch. I will ensure my .config is properly set to
build the specific modules I am touching before submitting in the
future.
Thank you for catching this and for your time reviewing it.
Regards,
Chaitanya
On Wed, May 6, 2026 at 4:06 PM Ahmet Sezgin Duran <ahmet@sezginduran.net> wrote:
>
> On 5/6/26 10:14 AM, Chaitanya Sabnis wrote:
> > On Wed, May 6, 2026 at 11:57 AM Ahmet Sezgin Duran ahmet@sezginduran.net wrote:
> >
> > Did you compile these changes?
> >
> > Yes, I have verified the changes by compiling the driver with: make
> > M=drivers/staging/sm750fb/
> >
> > The build completed successfully without errors.
> >
> > Regards,
> > Chaitanya
>
> Are you sure that you had enabled the module? When I apply and try to
> compile your patch, I get these errors:
>
> >
> > CC [M] drivers/staging/sm750fb/sm750.o
> > drivers/staging/sm750fb/sm750.c: In function ‘lynxfb_set_fbinfo’:
> > drivers/staging/sm750fb/sm750.c:785:33: error: assignment of
> read-only location ‘g_fbmode[index]’
> > 785 | g_fbmode[index] = g_def_fbmode;
> > | ^
> > drivers/staging/sm750fb/sm750.c:787:41: error: assignment of
> read-only location ‘g_fbmode[index]’
> > 787 | g_fbmode[index] = g_fbmode[0];
> > | ^
> > drivers/staging/sm750fb/sm750.c: In function ‘sm750fb_setup’:
> > drivers/staging/sm750fb/sm750.c:896:45: error: assignment of
> read-only location ‘g_fbmode[0]’
> > 896 | g_fbmode[0] = opt;
> > | ^
> > drivers/staging/sm750fb/sm750.c:900:45: error: assignment of
> read-only location ‘g_fbmode[1]’
> > 900 | g_fbmode[1] = opt;
> > | ^
>
> Regards,
> Ahmet Sezgin Duran
^ permalink raw reply
* Re: [PATCH] staging: sm750fb: add const to g_fbmode array
From: Ahmet Sezgin Duran @ 2026-05-06 10:36 UTC (permalink / raw)
To: Chaitanya Sabnis
Cc: sudipm.mukherjee, teddy.wang, gregkh, linux-fbdev, linux-staging,
linux-kernel
In-Reply-To: <CABjkosGtM-bju-gn9QtBfOMKMUsoYFb22noWjELnNi6B_ZBQ3Q@mail.gmail.com>
On 5/6/26 10:14 AM, Chaitanya Sabnis wrote:
> On Wed, May 6, 2026 at 11:57 AM Ahmet Sezgin Duran ahmet@sezginduran.net wrote:
>
> Did you compile these changes?
>
> Yes, I have verified the changes by compiling the driver with: make
> M=drivers/staging/sm750fb/
>
> The build completed successfully without errors.
>
> Regards,
> Chaitanya
Are you sure that you had enabled the module? When I apply and try to
compile your patch, I get these errors:
>
> CC [M] drivers/staging/sm750fb/sm750.o
> drivers/staging/sm750fb/sm750.c: In function ‘lynxfb_set_fbinfo’:
> drivers/staging/sm750fb/sm750.c:785:33: error: assignment of
read-only location ‘g_fbmode[index]’
> 785 | g_fbmode[index] = g_def_fbmode;
> | ^
> drivers/staging/sm750fb/sm750.c:787:41: error: assignment of
read-only location ‘g_fbmode[index]’
> 787 | g_fbmode[index] = g_fbmode[0];
> | ^
> drivers/staging/sm750fb/sm750.c: In function ‘sm750fb_setup’:
> drivers/staging/sm750fb/sm750.c:896:45: error: assignment of
read-only location ‘g_fbmode[0]’
> 896 | g_fbmode[0] = opt;
> | ^
> drivers/staging/sm750fb/sm750.c:900:45: error: assignment of
read-only location ‘g_fbmode[1]’
> 900 | g_fbmode[1] = opt;
> | ^
Regards,
Ahmet Sezgin Duran
^ permalink raw reply
* Re: Plan to fix nvidia_wmi_ec backlight issues, help wanted
From: Armin Wolf @ 2026-05-06 7:46 UTC (permalink / raw)
To: Daniel Dadap, Hans de Goede
Cc: Lee Jones, Daniel Thompson, Jingoo Han, Helge Deller,
Rafael J. Wysocki, dri-devel@lists.freedesktop.org, linux-fbdev,
linux-acpi, platform-driver-x86@vger.kernel.org
In-Reply-To: <afoR5jUHLPXpYJ8a@ddadap-lakeline.nvidia.com>
Am 05.05.26 um 17:51 schrieb Daniel Dadap:
> Thanks, Hans -
>
> On Tue, May 05, 2026 at 11:52:55AM +0200, Hans de Goede wrote:
>> <resend adding pdx86 list, sorry>
>>
>> Hi All,
>>
>> A while ago Nvidia introduced a new Nvidia specific firmware method
>> for controlling the backlight on laptops with runtime switchable
>> Nvidia hybrid graphics.
>>
>> This is supported through the nvidia-wmi-ec-backlight driver, but has
>> never worked 100%.
>>
>> The new WMI firmware interface has a method to ask the firmware if
>> the backlight is controlled though the EC and this the new WMI interface
>> should be used; or if it is directly controlled by the GPU and the GPU
>> driver's native backlight support should be used.
>>
>> There are several bugs in the implementation of this on various laptops:
>>
>> 1. The method to get the backlight control source sometimes does not
>> report the correct value.
>>
>> 2. On some laptop models which method (native-gpu vs nvidia-wmi) works
>> changes at runtime, e.g. when plugging in a charger.
>>
>> Known affected laptop models/bug reports about this:
>> - Acer Predator PH315-55: needs acpi_backlight=native
>> - Dell G15 5515 with RTX 3050: *needs* acpi_backlight=native
>> - Dell G15 5515 with RTX 3060: *breaks* with acpi_backlight=native
>> - Lenovo Legion Slim 7 2021
>> - https://bugzilla.kernel.org/show_bug.cgi?id=217026
>> - https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/work_items/784
>> - https://gitlab.freedesktop.org/drm/amd/-/issues/4512
>> - https://bugzilla.suse.com/show_bug.cgi?id=1217750
>
> I believe there were also a couple of cases where different builds of the
> same notebook (as far as DMI quirks tables could detect) would be driven
> by different methods, exacerbating problem (1) because adding a quirtk to
> fix one notebook would break other versions of the "same" notebook. (Oh,
> maybe that's the two G15 5515 bugs linked above.)
>
>>
>> It turns out that under Windows both a WMI backlight driver and a GPU
>> native backlight driver get installed and Windows simply always calls
>> both when the backlight changes working around these kind of firmware
>> bugs.
>>
>
> Yes, it's frustrating that so many notebooks have implementations of this
> interface that have bugs that get masked by Windows always using both of
> the interfaces. I wonder whether Windows behaves this way because bugs of
> this type are so prevalent, or if the bugs are prevalent because Windows
> always behaved that way so nobody noticed.
I suspect that both scenarios apply :(
That being said, i am asking myself if "both interfaces" also includes
the backlight interface from the iGPU. If not then we could simply use a
notifier to dynamically tie the WMI device to the Nvidia GPU backlight
interface.
>> When this first came up, about 2 years ago, I came up with the below
>> plan to fix this. Nvidia was supposed to work in implementing this,
>> but so far an implementation of this plan has not happened.
>>
>> Note I do not have time to work on this myself. I'm posting this here
>> in the hope that either Nvidia will pick this up after all; or that
>> someone else can make this happen.
>>
>> I'm more then happy to help answering any questions which may come up
>> while implementing this; and to review the resulting patches.
>>
>
> Sorry about that - I totally forgot about this proposal. I'm still happy
> to help here, although if someone else is especially eager to implement
> these changes, I'm also happy to answer questions, test, review, and help
> in other ways as bandwidth allows. I have some clarifying questions about
> the plan - it's been some time since we talked about this, so I apologize
> if I've already asked these questions and you've already answered them.
>
>>
>> The plan
>> ========
>>
>> 1. Modify the core backlight code to allow registering a backlight-device
>> for in kernel use only, disabling the registering of a class device under
>> /sys/class/backlight .
>>
>> 2. Add a new backlight-aggregate.c backlight driver, which exports a
>> devm_backlight_aggregate_register_or_add() function. Drivers can call
>> this passing in an existing backlight-device (with its sysfs interface
>> disabled). This either creates a singleton /sys/class/backlight/aggregate
>> device, or adds the passed in backlight to the existing singleton instance
>> if it already exists.
>>
>> This new driver always exposes a range of 0-255 to userspace. This acts
>> as a proxie for any backlight-devices registered to be part of
>> the aggregate, forwarding any brightness set calls to all backlights,
>> scaled to their actual range. For reads this will report the last set
>> brightness value (starting with the value of the first registered
>> backlight-device).
>>
>> 3. Add a new nvidia_wmi_ec_and_native type to drivers/acpi/video_detect.c
>> for both DMI quirks and commandline handling.
>>
>
> So by default both the native and GPU drivers would register a "normal"
> backlight handler, and if the "both" quirk is set (or if requested via
> kernel command line) they'll register with the aggregate device?
>
> Would it make sense to make this more generic, with a parameter which
> can be set via command line or quirks for which backlight devices to
> aggregate? And then maybe instead of a new "nvidia_wmi_ec_and_native"
> backlight type in video_detect.c, it could be called "aggregate" or
> something else along those lines, used in combination with the list of
> backlight types to aggregate.
>
> Have we seen systems where both the iGPU and dGPU register their own
> native handlers? I vaguely recall seeing such a system, but I do not
> keep careful notes about this sort of thing, so I'm not certain. If
> there are indeed such systems, then "native" might not be specific
> enough, and it may be necessary to explicitly name backlight drivers
> individually in order to aggregate them.
>>
>> 4. Modify acpi_video_backlight_use_native() to also return true if
>> the __acpi_video_get_backlight_type() call there returns the new
>> acpi_backlight_nvidia_wmi_ec_and_native.
>
>> 5. Add a new devm_backlight_device_register_native() helper which
>> calls __acpi_video_get_backlight_type(true, NULL) and if that returns
>> the new nvidia_wmi_ec_and_native type then registers the passed in
>> backlight with the flag to not register a sysfs class interface and
>> then on success calls the new devm_backlight_aggregate_register_or_add()
>> with the just registered backlight device; and if the returned type
>> instead is acpi_backlight_native register the passed in backlight
>> normally through devm_backlight_device_register()
>>
>> 5. Modify the i915 and amdgpu drivers to use the new
>> devm_backlight_device_register_native() helper. Since this new helper
>> checks the backlight-type itself, drop acpi_video_backlight_use_native()
>> checks *if* the registration is the only thing guarded by that check.
>>
>> 6. drivers/platform/x86/nvidia-wmi-ec-backlight.c to not return
>> early from probe when acpi_video_get_backlight_type() returns
>> the new nvidia_wmi_ec_and_native type and for that type make it
>> registers its backlight with the flag to not register a sysfs class
>> interface and then on success calls the new
>> devm_backlight_aggregate_register_or_add().
>>
>
> There still isn't anything tying a particular sysfs backlight interface
> node to a specific display panel, right? Is there a plan to eventually
> support this? How would this interact with that plan? I'm just a little
> worried about designing ourselves into a corner that makes things harder
> to untangle individual devices later if the need arises.
Good point. I think it would be better if the GPU drivers themself
figure out if a given DRM connector belongs to the internal panel.
They could then register with a notifier that notifies the WMI driver
whenever the "official" backlight interface was changed to update the EC
state as needed.
If only the Nvidia GPU is supposed to interact with this WMI device,
then we could implement this as a private interface inside nova/noveau.
Otherwise we might need to come up with a more generic API.
Thanks,
Armin Wolf
>> Regards,
>>
>> Hans
>>
>
^ permalink raw reply
* Re: [PATCH] staging: sm750fb: add const to g_fbmode array
From: Chaitanya Sabnis @ 2026-05-06 7:14 UTC (permalink / raw)
To: Ahmet Sezgin Duran
Cc: sudipm.mukherjee, teddy.wang, gregkh, linux-fbdev, linux-staging,
linux-kernel
In-Reply-To: <fcfbdb1a-188a-4ab1-b7cc-b2c430d2cca4@sezginduran.net>
On Wed, May 6, 2026 at 11:57 AM Ahmet Sezgin Duran ahmet@sezginduran.net wrote:
Did you compile these changes?
Yes, I have verified the changes by compiling the driver with: make
M=drivers/staging/sm750fb/
The build completed successfully without errors.
Regards,
Chaitanya
^ permalink raw reply
* Re: [PATCH] staging: sm750fb: add const to g_fbmode array
From: Ahmet Sezgin Duran @ 2026-05-06 6:27 UTC (permalink / raw)
To: Chaitanya Sabnis, sudipm.mukherjee, teddy.wang, gregkh
Cc: linux-fbdev, linux-staging, linux-kernel
In-Reply-To: <20260506035641.5060-1-chaitanya.msabnis@gmail.com>
On 5/6/26 6:56 AM, Chaitanya Sabnis wrote:
> Fix a checkpatch warning by changing the `g_fbmode` array of
> pointers to be `static const char * const`. This ensures that both
> the strings and the array of pointers are placed in read-only memory,
> preventing unintended modifications and improving security.
>
> Signed-off-by: Chaitanya Sabnis <chaitanya.msabnis@gmail.com>
> ---
> drivers/staging/sm750fb/sm750.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
> index dec1f6b88a7d..08d4979c6755 100644
> --- a/drivers/staging/sm750fb/sm750.c
> +++ b/drivers/staging/sm750fb/sm750.c
> @@ -33,7 +33,7 @@
> static int g_hwcursor = 1;
> static int g_noaccel;
> static int g_nomtrr;
> -static const char *g_fbmode[] = {NULL, NULL};
> +static const char * const g_fbmode[] = {NULL, NULL};
> static const char *g_def_fbmode = "1024x768-32@60";
> static char *g_settings;
> static int g_dualview;
Did you compile these changes?
Regards,
Ahmet Sezgin Duran
^ permalink raw reply
* [PATCH] staging: sm750fb: add const to g_fbmode array
From: Chaitanya Sabnis @ 2026-05-06 3:56 UTC (permalink / raw)
To: sudipm.mukherjee, teddy.wang, gregkh
Cc: linux-fbdev, linux-staging, linux-kernel, Chaitanya Sabnis
Fix a checkpatch warning by changing the `g_fbmode` array of
pointers to be `static const char * const`. This ensures that both
the strings and the array of pointers are placed in read-only memory,
preventing unintended modifications and improving security.
Signed-off-by: Chaitanya Sabnis <chaitanya.msabnis@gmail.com>
---
drivers/staging/sm750fb/sm750.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index dec1f6b88a7d..08d4979c6755 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -33,7 +33,7 @@
static int g_hwcursor = 1;
static int g_noaccel;
static int g_nomtrr;
-static const char *g_fbmode[] = {NULL, NULL};
+static const char * const g_fbmode[] = {NULL, NULL};
static const char *g_def_fbmode = "1024x768-32@60";
static char *g_settings;
static int g_dualview;
--
2.43.0
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox