Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

power: suspend - convert sysdev_class to a regular subsystem

After all sysdev classes are ported to regular driver core entities, the
sysdev implementation will be entirely removed from the kernel.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Kay Sievers and committed by
Greg Kroah-Hartman
86ba41d0 cfde779f

+17 -16
+17 -16
arch/powerpc/platforms/pseries/suspend.c
··· 26 26 #include <asm/rtas.h> 27 27 28 28 static u64 stream_id; 29 - static struct sys_device suspend_sysdev; 29 + static struct device suspend_dev; 30 30 static DECLARE_COMPLETION(suspend_work); 31 31 static struct rtas_suspend_me_data suspend_data; 32 32 static atomic_t suspending; ··· 110 110 111 111 /** 112 112 * store_hibernate - Initiate partition hibernation 113 - * @classdev: sysdev class struct 114 - * @attr: class device attribute struct 113 + * @dev: subsys root device 114 + * @attr: device attribute struct 115 115 * @buf: buffer 116 116 * @count: buffer size 117 117 * ··· 121 121 * Return value: 122 122 * number of bytes printed to buffer / other on failure 123 123 **/ 124 - static ssize_t store_hibernate(struct sysdev_class *classdev, 125 - struct sysdev_class_attribute *attr, 124 + static ssize_t store_hibernate(struct device *dev, 125 + struct device_attribute *attr, 126 126 const char *buf, size_t count) 127 127 { 128 128 int rc; ··· 148 148 return rc; 149 149 } 150 150 151 - static SYSDEV_CLASS_ATTR(hibernate, S_IWUSR, NULL, store_hibernate); 151 + static DEVICE_ATTR(hibernate, S_IWUSR, NULL, store_hibernate); 152 152 153 - static struct sysdev_class suspend_sysdev_class = { 153 + static struct bus_type suspend_subsys = { 154 154 .name = "power", 155 + .dev_name = "power", 155 156 }; 156 157 157 158 static const struct platform_suspend_ops pseries_suspend_ops = { ··· 168 167 * Return value: 169 168 * 0 on success / other on failure 170 169 **/ 171 - static int pseries_suspend_sysfs_register(struct sys_device *sysdev) 170 + static int pseries_suspend_sysfs_register(struct device *dev) 172 171 { 173 172 int rc; 174 173 175 - if ((rc = sysdev_class_register(&suspend_sysdev_class))) 174 + if ((rc = subsys_system_register(&suspend_subsys, NULL))) 176 175 return rc; 177 176 178 - sysdev->id = 0; 179 - sysdev->cls = &suspend_sysdev_class; 177 + dev->id = 0; 178 + dev->bus = &suspend_subsys; 180 179 181 - if ((rc = sysdev_class_create_file(&suspend_sysdev_class, &attr_hibernate))) 182 - goto class_unregister; 180 + if ((rc = device_create_file(suspend_subsys.dev_root, &dev_attr_hibernate))) 181 + goto subsys_unregister; 183 182 184 183 return 0; 185 184 186 - class_unregister: 187 - sysdev_class_unregister(&suspend_sysdev_class); 185 + subsys_unregister: 186 + bus_unregister(&suspend_subsys); 188 187 return rc; 189 188 } 190 189 ··· 205 204 if (suspend_data.token == RTAS_UNKNOWN_SERVICE) 206 205 return 0; 207 206 208 - if ((rc = pseries_suspend_sysfs_register(&suspend_sysdev))) 207 + if ((rc = pseries_suspend_sysfs_register(&suspend_dev))) 209 208 return rc; 210 209 211 210 ppc_md.suspend_disable_cpu = pseries_suspend_cpu;