aboutsummaryrefslogtreecommitdiffstats
path: root/0002-driver-core-class-fix-block-class-problem-when-remov.patch
blob: 521337e3e03bf2693dd229d972ee0b00065bfa9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From 6ecddadae3f779408bfa6a1b0c81e7728a00395e Mon Sep 17 00:00:00 2001
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Tue, 7 Mar 2023 08:43:59 +0100
Subject: [PATCH 2/2] driver core: class: fix block class problem when removing
 CONFIG_SYSFS_DEPRECATED*

In removing the CONFIG_SYSFS_DEPRECATED and CONFIG_SYSFS_DEPRECATED_V2
config options, I messed up in the __class_register() function and got
the logic incorrect.  Fix this all up by just removing the special case
of a block device class logic in this function, as that is what is
intended.

In testing, this solves the boot problem on my systems, hopefully on
others as well.

Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Fixes: 721da5cee9d4 ("driver core: remove CONFIG_SYSFS_DEPRECATED and CONFIG_SYSFS_DEPRECATED_V2")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/base/class.c |    6 ------
 1 file changed, 6 deletions(-)

--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -178,13 +178,7 @@ int __class_register(struct class *cls,
 	if (!cls->dev_kobj)
 		cls->dev_kobj = sysfs_dev_char_kobj;
 
-#if defined(CONFIG_BLOCK)
-	/* let the block class directory show up in the root of sysfs */
-	if (cls != &block_class)
-		cp->subsys.kobj.kset = class_kset;
-#else
 	cp->subsys.kobj.kset = class_kset;
-#endif
 	cp->subsys.kobj.ktype = &class_ktype;
 	cp->class = cls;
 	cls->p = cp;