From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794064687; b=2toDmMdmzMNumo4Fa6KukuFTdxk9XA54ArNfR+ycwiiHEyC5ABKWRocmGRzVlInPgxqY sCt7XoJFbSMVwtFZcS7EoBTAKlpEXTVU+NUbqHBKnJRyNJzXY9o/ajVCcHBq8pj6yk809 gZrFdpfK09OrclzsqXeBb/JV0AOtCWqv2hjWY/zA/8GIAqDeY2Plcx8F64ONlCoR4Fn7k MlrY1Qkw8zLHNw82oSZD9w+DGJJ0UtUnXZlRaoaJFXO/weAQlWGnS4X4pHGWl3/u8QFwJ QEklk+/s4v4OQI6PBJXNFVxJSS/zr85vN79rb2xbykkc2XKYhafsdVWJsn14D+z+5Tg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794064687; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=GDM18OPlMx594s69wd2xHmlelESd6ZU2MGikaGaNvDM=; b=rkU6smr5TVREi/iu/ITT0SZ4jFT6kVTbgDvKv/REfXAOsi3LD5aBQNdPeC/zP78R1VIO i3Y5TwRM2GzX4MVfIUWw96+Ks+Y/GmYxD/PuUyEIa2mKUldp/1ysB9ZhZIBHWX9dFhr// T/geITiKrJG63JJXQDplHiE5RBg3WN7N85reNp4NrlPQRZQbdxdnioEcSyDijX5uKxypP mwaNj2mjwGihJnhKC50VFOVBPi/tNKA8Gl0/OfFZOt2ZRKEjxG2cO8YzAyTa1PUX7c7bP fyl9MkliltpAAPVtVmTtm2QZn5im8KrS534bT/Bc2S1Rl00BezEBFd3gDkgQkgFSYDA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=yslFVJlH; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 612FC606B8AE; Sat, 7 Nov 2026 15:18:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=yslFVJlH Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D3441F0089F; Sat, 7 Nov 2026 15:18:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1794064687; bh=GDM18OPlMx594s69wd2xHmlelESd6ZU2MGikaGaNvDM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=yslFVJlH2ZkaJRE/IAD+rEHof8yWtzseR5H9VfQqErmStNJW0CQRg67nD4dpti9+9 WjlMWJ35WX8OlTBKwJTu9budpuiT/ZTkSdbn5cj4rs7DXdVZ5nH4C+NGUhO/JD/vbA lW3QeuPdVDlv36UeHjbCB2VN0gekIn5aqiye4O8E= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Karl Mehltretter , Helge Deller , Sasha Levin Subject: [PATCH 7.3 0681/1257] fbdev: sh_mobile_lcdcfb: Restore the per-overlay sysfs attributes Date: Sat, 7 Nov 2026 08:49:37 -0500 Message-ID: <20261107134958.076295659@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261107134939.434104957@linuxfoundation.org> References: <20261107134939.434104957@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Karl Mehltretter [ Upstream commit 317a8be730919177956be32422ebe00cf7e46710 ] The ovl_* files documented in Documentation/ABI/testing/sysfs-devices-platform-sh_mobile_lcdc_fb no longer exist. Commit a979182a2453 ("fbdev: lcdcfb: Register sysfs groups through driver core") moved the attributes from each overlay's framebuffer device to the platform driver's dev_groups and renamed them overlay_*. There is now only one set of attributes for the whole LCDC. The callbacks still expect dev_get_drvdata() to return a struct fb_info, but the platform device holds struct sh_mobile_lcdc_priv, so they access the wrong structure. Restore the documented names and register the group on each overlay's framebuffer device with device_add_groups(). Remove it with device_remove_groups() before unregistering the framebuffer. Skip creation when dev_of_fbinfo(info) is NULL, as the old device_create_file() calls did. Drop the CONFIG_FB_DEVICE guard, since the driver already depends on it. Fixes: a979182a2453 ("fbdev: lcdcfb: Register sysfs groups through driver core") Cc: stable@vger.kernel.org Assisted-by: LLM Signed-off-by: Karl Mehltretter Signed-off-by: Helge Deller Signed-off-by: Sasha Levin --- drivers/video/fbdev/sh_mobile_lcdcfb.c | 39 +++++++++++++++++--------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/drivers/video/fbdev/sh_mobile_lcdcfb.c b/drivers/video/fbdev/sh_mobile_lcdcfb.c index e8324b01700f6..5743c96d54814 100644 --- a/drivers/video/fbdev/sh_mobile_lcdcfb.c +++ b/drivers/video/fbdev/sh_mobile_lcdcfb.c @@ -1337,22 +1337,24 @@ overlay_rop3_store(struct device *dev, struct device_attribute *attr, return count; } -static DEVICE_ATTR_RW(overlay_alpha); -static DEVICE_ATTR_RW(overlay_mode); -static DEVICE_ATTR_RW(overlay_position); -static DEVICE_ATTR_RW(overlay_rop3); - -static struct attribute *overlay_sysfs_attrs[] __maybe_unused = { - &dev_attr_overlay_alpha.attr, - &dev_attr_overlay_mode.attr, - &dev_attr_overlay_position.attr, - &dev_attr_overlay_rop3.attr, +static struct device_attribute dev_attr_ovl_alpha = + __ATTR(ovl_alpha, 0644, overlay_alpha_show, overlay_alpha_store); +static struct device_attribute dev_attr_ovl_mode = + __ATTR(ovl_mode, 0644, overlay_mode_show, overlay_mode_store); +static struct device_attribute dev_attr_ovl_position = + __ATTR(ovl_position, 0644, overlay_position_show, overlay_position_store); +static struct device_attribute dev_attr_ovl_rop3 = + __ATTR(ovl_rop3, 0644, overlay_rop3_show, overlay_rop3_store); + +static struct attribute *overlay_sysfs_attrs[] = { + &dev_attr_ovl_alpha.attr, + &dev_attr_ovl_mode.attr, + &dev_attr_ovl_position.attr, + &dev_attr_ovl_rop3.attr, NULL, }; -#ifdef CONFIG_FB_DEVICE ATTRIBUTE_GROUPS(overlay_sysfs); -#endif static const struct fb_fix_screeninfo sh_mobile_lcdc_overlay_fix = { .id = "SH Mobile LCDC", @@ -1510,9 +1512,10 @@ 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 || !dev_of_fbinfo(info)) return; + device_remove_groups(dev_of_fbinfo(info), overlay_sysfs_groups); unregister_framebuffer(ovl->info); } @@ -1530,6 +1533,15 @@ sh_mobile_lcdc_overlay_fb_register(struct sh_mobile_lcdc_overlay *ovl) if (ret < 0) return ret; + /* The framebuffer device is optional, see fb_device_create(). */ + if (dev_of_fbinfo(info)) { + ret = device_add_groups(dev_of_fbinfo(info), overlay_sysfs_groups); + if (ret < 0) { + unregister_framebuffer(info); + return ret; + } + } + dev_info(lcdc->dev, "registered %s/overlay %u as %dx%d %dbpp.\n", dev_name(lcdc->dev), ovl->index, info->var.xres, info->var.yres, info->var.bits_per_pixel); @@ -2637,7 +2649,6 @@ static int sh_mobile_lcdc_probe(struct platform_device *pdev) static struct platform_driver sh_mobile_lcdc_driver = { .driver = { .name = "sh_mobile_lcdc_fb", - .dev_groups = overlay_sysfs_groups, .pm = &sh_mobile_lcdc_dev_pm_ops, }, .probe = sh_mobile_lcdc_probe, -- 2.53.0