summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2011-12-19 01:11:57 +0100
committerKay Sievers <kay.sievers@vrfy.org>2011-12-19 01:11:57 +0100
commit826c4772346e7747894ccd769a2b3ce94e3736af (patch)
tree22f5a6bc598e073d21204392b9f86ab6ec4791eb
parentb1179ec76b8eb71637339379804a1b69df48d366 (diff)
downloadpatches-826c4772346e7747894ccd769a2b3ce94e3736af.tar.gz
add remainig power and s390 conversions
-rw-r--r--11-s390-time.patch556
-rw-r--r--12-power-cmm.patch172
-rw-r--r--13-power-qe_ic.patch48
-rw-r--r--14-power-suspend.patch92
-rw-r--r--series5
5 files changed, 873 insertions, 0 deletions
diff --git a/11-s390-time.patch b/11-s390-time.patch
new file mode 100644
index 0000000..db5046d
--- /dev/null
+++ b/11-s390-time.patch
@@ -0,0 +1,556 @@
+---
+ arch/s390/kernel/time.c | 260 ++++++++++++++++++++++++------------------------
+ 1 file changed, 131 insertions(+), 129 deletions(-)
+
+--- a/arch/s390/kernel/time.c
++++ b/arch/s390/kernel/time.c
+@@ -27,7 +27,7 @@
+ #include <linux/cpu.h>
+ #include <linux/stop_machine.h>
+ #include <linux/time.h>
+-#include <linux/sysdev.h>
++#include <linux/device.h>
+ #include <linux/delay.h>
+ #include <linux/init.h>
+ #include <linux/smp.h>
+@@ -1116,34 +1116,35 @@ out_unlock:
+ /*
+ * Sysfs interface functions
+ */
+-static struct sysdev_class etr_sysclass = {
+- .name = "etr",
++static struct bus_type etr_subsys = {
++ .name = "etr",
++ .dev_name = "etr",
+ };
+
+-static struct sys_device etr_port0_dev = {
++static struct device etr_port0_dev = {
+ .id = 0,
+- .cls = &etr_sysclass,
++ .bus = &etr_subsys,
+ };
+
+-static struct sys_device etr_port1_dev = {
++static struct device etr_port1_dev = {
+ .id = 1,
+- .cls = &etr_sysclass,
++ .cls = &etr_subsys,
+ };
+
+ /*
+- * ETR class attributes
++ * ETR subsys attributes
+ */
+-static ssize_t etr_stepping_port_show(struct sysdev_class *class,
+- struct sysdev_class_attribute *attr,
++static ssize_t etr_stepping_port_show(struct device *dev,
++ struct device_attribute *attr,
+ char *buf)
+ {
+ return sprintf(buf, "%i\n", etr_port0.esw.p);
+ }
+
+-static SYSDEV_CLASS_ATTR(stepping_port, 0400, etr_stepping_port_show, NULL);
++static DEVICE_ATTR(stepping_port, 0400, etr_stepping_port_show, NULL);
+
+-static ssize_t etr_stepping_mode_show(struct sysdev_class *class,
+- struct sysdev_class_attribute *attr,
++static ssize_t etr_stepping_mode_show(struct device *dev,
++ struct device_attribute *attr,
+ char *buf)
+ {
+ char *mode_str;
+@@ -1157,12 +1158,12 @@ static ssize_t etr_stepping_mode_show(st
+ return sprintf(buf, "%s\n", mode_str);
+ }
+
+-static SYSDEV_CLASS_ATTR(stepping_mode, 0400, etr_stepping_mode_show, NULL);
++static DEVICE_ATTR(stepping_mode, 0400, etr_stepping_mode_show, NULL);
+
+ /*
+ * ETR port attributes
+ */
+-static inline struct etr_aib *etr_aib_from_dev(struct sys_device *dev)
++static inline struct etr_aib *etr_aib_from_dev(struct device *dev)
+ {
+ if (dev == &etr_port0_dev)
+ return etr_port0_online ? &etr_port0 : NULL;
+@@ -1170,8 +1171,8 @@ static inline struct etr_aib *etr_aib_fr
+ return etr_port1_online ? &etr_port1 : NULL;
+ }
+
+-static ssize_t etr_online_show(struct sys_device *dev,
+- struct sysdev_attribute *attr,
++static ssize_t etr_online_show(struct device *dev,
++ struct device_attribute *attr,
+ char *buf)
+ {
+ unsigned int online;
+@@ -1180,8 +1181,8 @@ static ssize_t etr_online_show(struct sy
+ return sprintf(buf, "%i\n", online);
+ }
+
+-static ssize_t etr_online_store(struct sys_device *dev,
+- struct sysdev_attribute *attr,
++static ssize_t etr_online_store(struct device *dev,
++ struct device_attribute *attr,
+ const char *buf, size_t count)
+ {
+ unsigned int value;
+@@ -1218,20 +1219,20 @@ out:
+ return count;
+ }
+
+-static SYSDEV_ATTR(online, 0600, etr_online_show, etr_online_store);
++static DEVICE_ATTR(online, 0600, etr_online_show, etr_online_store);
+
+-static ssize_t etr_stepping_control_show(struct sys_device *dev,
+- struct sysdev_attribute *attr,
++static ssize_t etr_stepping_control_show(struct device *dev,
++ struct device_attribute *attr,
+ char *buf)
+ {
+ return sprintf(buf, "%i\n", (dev == &etr_port0_dev) ?
+ etr_eacr.e0 : etr_eacr.e1);
+ }
+
+-static SYSDEV_ATTR(stepping_control, 0400, etr_stepping_control_show, NULL);
++static DEVICE_ATTR(stepping_control, 0400, etr_stepping_control_show, NULL);
+
+-static ssize_t etr_mode_code_show(struct sys_device *dev,
+- struct sysdev_attribute *attr, char *buf)
++static ssize_t etr_mode_code_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
+ {
+ if (!etr_port0_online && !etr_port1_online)
+ /* Status word is not uptodate if both ports are offline. */
+@@ -1240,10 +1241,10 @@ static ssize_t etr_mode_code_show(struct
+ etr_port0.esw.psc0 : etr_port0.esw.psc1);
+ }
+
+-static SYSDEV_ATTR(state_code, 0400, etr_mode_code_show, NULL);
++static DEVICE_ATTR(state_code, 0400, etr_mode_code_show, NULL);
+
+-static ssize_t etr_untuned_show(struct sys_device *dev,
+- struct sysdev_attribute *attr, char *buf)
++static ssize_t etr_untuned_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
+ {
+ struct etr_aib *aib = etr_aib_from_dev(dev);
+
+@@ -1252,10 +1253,10 @@ static ssize_t etr_untuned_show(struct s
+ return sprintf(buf, "%i\n", aib->edf1.u);
+ }
+
+-static SYSDEV_ATTR(untuned, 0400, etr_untuned_show, NULL);
++static DEVICE_ATTR(untuned, 0400, etr_untuned_show, NULL);
+
+-static ssize_t etr_network_id_show(struct sys_device *dev,
+- struct sysdev_attribute *attr, char *buf)
++static ssize_t etr_network_id_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
+ {
+ struct etr_aib *aib = etr_aib_from_dev(dev);
+
+@@ -1264,10 +1265,10 @@ static ssize_t etr_network_id_show(struc
+ return sprintf(buf, "%i\n", aib->edf1.net_id);
+ }
+
+-static SYSDEV_ATTR(network, 0400, etr_network_id_show, NULL);
++static DEVICE_ATTR(network, 0400, etr_network_id_show, NULL);
+
+-static ssize_t etr_id_show(struct sys_device *dev,
+- struct sysdev_attribute *attr, char *buf)
++static ssize_t etr_id_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
+ {
+ struct etr_aib *aib = etr_aib_from_dev(dev);
+
+@@ -1276,10 +1277,10 @@ static ssize_t etr_id_show(struct sys_de
+ return sprintf(buf, "%i\n", aib->edf1.etr_id);
+ }
+
+-static SYSDEV_ATTR(id, 0400, etr_id_show, NULL);
++static DEVICE_ATTR(id, 0400, etr_id_show, NULL);
+
+-static ssize_t etr_port_number_show(struct sys_device *dev,
+- struct sysdev_attribute *attr, char *buf)
++static ssize_t etr_port_number_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
+ {
+ struct etr_aib *aib = etr_aib_from_dev(dev);
+
+@@ -1288,10 +1289,10 @@ static ssize_t etr_port_number_show(stru
+ return sprintf(buf, "%i\n", aib->edf1.etr_pn);
+ }
+
+-static SYSDEV_ATTR(port, 0400, etr_port_number_show, NULL);
++static DEVICE_ATTR(port, 0400, etr_port_number_show, NULL);
+
+-static ssize_t etr_coupled_show(struct sys_device *dev,
+- struct sysdev_attribute *attr, char *buf)
++static ssize_t etr_coupled_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
+ {
+ struct etr_aib *aib = etr_aib_from_dev(dev);
+
+@@ -1300,10 +1301,10 @@ static ssize_t etr_coupled_show(struct s
+ return sprintf(buf, "%i\n", aib->edf3.c);
+ }
+
+-static SYSDEV_ATTR(coupled, 0400, etr_coupled_show, NULL);
++static DEVICE_ATTR(coupled, 0400, etr_coupled_show, NULL);
+
+-static ssize_t etr_local_time_show(struct sys_device *dev,
+- struct sysdev_attribute *attr, char *buf)
++static ssize_t etr_local_time_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
+ {
+ struct etr_aib *aib = etr_aib_from_dev(dev);
+
+@@ -1312,10 +1313,10 @@ static ssize_t etr_local_time_show(struc
+ return sprintf(buf, "%i\n", aib->edf3.blto);
+ }
+
+-static SYSDEV_ATTR(local_time, 0400, etr_local_time_show, NULL);
++static DEVICE_ATTR(local_time, 0400, etr_local_time_show, NULL);
+
+-static ssize_t etr_utc_offset_show(struct sys_device *dev,
+- struct sysdev_attribute *attr, char *buf)
++static ssize_t etr_utc_offset_show(struct device *dev,
++ struct device_attribute *attr, char *buf)
+ {
+ struct etr_aib *aib = etr_aib_from_dev(dev);
+
+@@ -1324,64 +1325,64 @@ static ssize_t etr_utc_offset_show(struc
+ return sprintf(buf, "%i\n", aib->edf3.buo);
+ }
+
+-static SYSDEV_ATTR(utc_offset, 0400, etr_utc_offset_show, NULL);
++static DEVICE_ATTR(utc_offset, 0400, etr_utc_offset_show, NULL);
+
+-static struct sysdev_attribute *etr_port_attributes[] = {
+- &attr_online,
+- &attr_stepping_control,
+- &attr_state_code,
+- &attr_untuned,
+- &attr_network,
+- &attr_id,
+- &attr_port,
+- &attr_coupled,
+- &attr_local_time,
+- &attr_utc_offset,
++static struct device_attribute *etr_port_attributes[] = {
++ &dev_attr_online,
++ &dev_attr_stepping_control,
++ &dev_attr_state_code,
++ &dev_attr_untuned,
++ &dev_attr_network,
++ &dev_attr_id,
++ &dev_attr_port,
++ &dev_attr_coupled,
++ &dev_attr_local_time,
++ &dev_attr_utc_offset,
+ NULL
+ };
+
+-static int __init etr_register_port(struct sys_device *dev)
++static int __init etr_register_port(struct device *dev)
+ {
+- struct sysdev_attribute **attr;
++ struct device_attribute **attr;
+ int rc;
+
+- rc = sysdev_register(dev);
++ rc = devic_register(dev);
+ if (rc)
+ goto out;
+ for (attr = etr_port_attributes; *attr; attr++) {
+- rc = sysdev_create_file(dev, *attr);
++ rc = device_create_file(dev, *attr);
+ if (rc)
+ goto out_unreg;
+ }
+ return 0;
+ out_unreg:
+ for (; attr >= etr_port_attributes; attr--)
+- sysdev_remove_file(dev, *attr);
+- sysdev_unregister(dev);
++ device_remove_file(dev, *attr);
++ device_unregister(dev);
+ out:
+ return rc;
+ }
+
+-static void __init etr_unregister_port(struct sys_device *dev)
++static void __init etr_unregister_port(struct device *dev)
+ {
+- struct sysdev_attribute **attr;
++ struct device_attribute **attr;
+
+ for (attr = etr_port_attributes; *attr; attr++)
+- sysdev_remove_file(dev, *attr);
+- sysdev_unregister(dev);
++ device_remove_file(dev, *attr);
++ device_unregister(dev);
+ }
+
+ static int __init etr_init_sysfs(void)
+ {
+ int rc;
+
+- rc = sysdev_class_register(&etr_sysclass);
++ rc = subsys_system_register(&etr_subsys, NULL);
+ if (rc)
+ goto out;
+- rc = sysdev_class_create_file(&etr_sysclass, &attr_stepping_port);
++ rc = device_create_file(etr_subsys.dev_root, &dev_attr_stepping_port);
+ if (rc)
+- goto out_unreg_class;
+- rc = sysdev_class_create_file(&etr_sysclass, &attr_stepping_mode);
++ goto out_unreg_subsys;
++ rc = device_create_file(etr_subsys.dev_root, &dev_attr_stepping_mode);
+ if (rc)
+ goto out_remove_stepping_port;
+ rc = etr_register_port(&etr_port0_dev);
+@@ -1395,11 +1396,11 @@ static int __init etr_init_sysfs(void)
+ out_remove_port0:
+ etr_unregister_port(&etr_port0_dev);
+ out_remove_stepping_mode:
+- sysdev_class_remove_file(&etr_sysclass, &attr_stepping_mode);
++ device_remove_file(etr_subsys.dev_root, &dev_attr_stepping_mode);
+ out_remove_stepping_port:
+- sysdev_class_remove_file(&etr_sysclass, &attr_stepping_port);
+-out_unreg_class:
+- sysdev_class_unregister(&etr_sysclass);
++ device_remove_file(etr_subsys.dev_root, &dev_attr_stepping_port);
++out_unreg_subsys:
++ bus_unregister(&etr_subsys);
+ out:
+ return rc;
+ }
+@@ -1599,14 +1600,15 @@ out_unlock:
+ }
+
+ /*
+- * STP class sysfs interface functions
++ * STP subsys sysfs interface functions
+ */
+-static struct sysdev_class stp_sysclass = {
+- .name = "stp",
++static struct bus_type stp_subsys = {
++ .name = "stp",
++ .dev_name = "stp",
+ };
+
+-static ssize_t stp_ctn_id_show(struct sysdev_class *class,
+- struct sysdev_class_attribute *attr,
++static ssize_t stp_ctn_id_show(struct device *dev,
++ struct device_attribute *attr,
+ char *buf)
+ {
+ if (!stp_online)
+@@ -1615,10 +1617,10 @@ static ssize_t stp_ctn_id_show(struct sy
+ *(unsigned long long *) stp_info.ctnid);
+ }
+
+-static SYSDEV_CLASS_ATTR(ctn_id, 0400, stp_ctn_id_show, NULL);
++static DEVICE_ATTR(ctn_id, 0400, stp_ctn_id_show, NULL);
+
+-static ssize_t stp_ctn_type_show(struct sysdev_class *class,
+- struct sysdev_class_attribute *attr,
++static ssize_t stp_ctn_type_show(struct device *dev,
++ struct device_attribute *attr,
+ char *buf)
+ {
+ if (!stp_online)
+@@ -1626,10 +1628,10 @@ static ssize_t stp_ctn_type_show(struct
+ return sprintf(buf, "%i\n", stp_info.ctn);
+ }
+
+-static SYSDEV_CLASS_ATTR(ctn_type, 0400, stp_ctn_type_show, NULL);
++static DEVICE_ATTR(ctn_type, 0400, stp_ctn_type_show, NULL);
+
+-static ssize_t stp_dst_offset_show(struct sysdev_class *class,
+- struct sysdev_class_attribute *attr,
++static ssize_t stp_dst_offset_show(struct device *dev,
++ struct device_attribute *attr,
+ char *buf)
+ {
+ if (!stp_online || !(stp_info.vbits & 0x2000))
+@@ -1637,10 +1639,10 @@ static ssize_t stp_dst_offset_show(struc
+ return sprintf(buf, "%i\n", (int)(s16) stp_info.dsto);
+ }
+
+-static SYSDEV_CLASS_ATTR(dst_offset, 0400, stp_dst_offset_show, NULL);
++static DEVICE_ATTR(dst_offset, 0400, stp_dst_offset_show, NULL);
+
+-static ssize_t stp_leap_seconds_show(struct sysdev_class *class,
+- struct sysdev_class_attribute *attr,
++static ssize_t stp_leap_seconds_show(struct device *dev,
++ struct device_attribute *attr,
+ char *buf)
+ {
+ if (!stp_online || !(stp_info.vbits & 0x8000))
+@@ -1648,10 +1650,10 @@ static ssize_t stp_leap_seconds_show(str
+ return sprintf(buf, "%i\n", (int)(s16) stp_info.leaps);
+ }
+
+-static SYSDEV_CLASS_ATTR(leap_seconds, 0400, stp_leap_seconds_show, NULL);
++static DEVICE_ATTR(leap_seconds, 0400, stp_leap_seconds_show, NULL);
+
+-static ssize_t stp_stratum_show(struct sysdev_class *class,
+- struct sysdev_class_attribute *attr,
++static ssize_t stp_stratum_show(struct device *dev,
++ struct device_attribute *attr,
+ char *buf)
+ {
+ if (!stp_online)
+@@ -1659,10 +1661,10 @@ static ssize_t stp_stratum_show(struct s
+ return sprintf(buf, "%i\n", (int)(s16) stp_info.stratum);
+ }
+
+-static SYSDEV_CLASS_ATTR(stratum, 0400, stp_stratum_show, NULL);
++static DEVICE_ATTR(stratum, 0400, stp_stratum_show, NULL);
+
+-static ssize_t stp_time_offset_show(struct sysdev_class *class,
+- struct sysdev_class_attribute *attr,
++static ssize_t stp_time_offset_show(struct device *dev,
++ struct device_attribute *attr,
+ char *buf)
+ {
+ if (!stp_online || !(stp_info.vbits & 0x0800))
+@@ -1670,10 +1672,10 @@ static ssize_t stp_time_offset_show(stru
+ return sprintf(buf, "%i\n", (int) stp_info.tto);
+ }
+
+-static SYSDEV_CLASS_ATTR(time_offset, 0400, stp_time_offset_show, NULL);
++static DEVICE_ATTR(time_offset, 0400, stp_time_offset_show, NULL);
+
+-static ssize_t stp_time_zone_offset_show(struct sysdev_class *class,
+- struct sysdev_class_attribute *attr,
++static ssize_t stp_time_zone_offset_show(struct device *dev,
++ struct device_attribute *attr,
+ char *buf)
+ {
+ if (!stp_online || !(stp_info.vbits & 0x4000))
+@@ -1681,11 +1683,11 @@ static ssize_t stp_time_zone_offset_show
+ return sprintf(buf, "%i\n", (int)(s16) stp_info.tzo);
+ }
+
+-static SYSDEV_CLASS_ATTR(time_zone_offset, 0400,
++static DEVICE_ATTR(time_zone_offset, 0400,
+ stp_time_zone_offset_show, NULL);
+
+-static ssize_t stp_timing_mode_show(struct sysdev_class *class,
+- struct sysdev_class_attribute *attr,
++static ssize_t stp_timing_mode_show(struct device *dev,
++ struct device_attribute *attr,
+ char *buf)
+ {
+ if (!stp_online)
+@@ -1693,10 +1695,10 @@ static ssize_t stp_timing_mode_show(stru
+ return sprintf(buf, "%i\n", stp_info.tmd);
+ }
+
+-static SYSDEV_CLASS_ATTR(timing_mode, 0400, stp_timing_mode_show, NULL);
++static DEVICE_ATTR(timing_mode, 0400, stp_timing_mode_show, NULL);
+
+-static ssize_t stp_timing_state_show(struct sysdev_class *class,
+- struct sysdev_class_attribute *attr,
++static ssize_t stp_timing_state_show(struct device *dev,
++ struct device_attribute *attr,
+ char *buf)
+ {
+ if (!stp_online)
+@@ -1704,17 +1706,17 @@ static ssize_t stp_timing_state_show(str
+ return sprintf(buf, "%i\n", stp_info.tst);
+ }
+
+-static SYSDEV_CLASS_ATTR(timing_state, 0400, stp_timing_state_show, NULL);
++static DEVICE_ATTR(timing_state, 0400, stp_timing_state_show, NULL);
+
+-static ssize_t stp_online_show(struct sysdev_class *class,
+- struct sysdev_class_attribute *attr,
++static ssize_t stp_online_show(struct device *dev,
++ struct device_attribute *attr,
+ char *buf)
+ {
+ return sprintf(buf, "%i\n", stp_online);
+ }
+
+-static ssize_t stp_online_store(struct sysdev_class *class,
+- struct sysdev_class_attribute *attr,
++static ssize_t stp_online_store(struct device *dev,
++ struct device_attribute *attr,
+ const char *buf, size_t count)
+ {
+ unsigned int value;
+@@ -1736,47 +1738,47 @@ static ssize_t stp_online_store(struct s
+ }
+
+ /*
+- * Can't use SYSDEV_CLASS_ATTR because the attribute should be named
+- * stp/online but attr_online already exists in this file ..
++ * Can't use DEVICE_ATTR because the attribute should be named
++ * stp/online but dev_attr_online already exists in this file ..
+ */
+-static struct sysdev_class_attribute attr_stp_online = {
++static struct device_attribute dev_attr_stp_online = {
+ .attr = { .name = "online", .mode = 0600 },
+ .show = stp_online_show,
+ .store = stp_online_store,
+ };
+
+-static struct sysdev_class_attribute *stp_attributes[] = {
+- &attr_ctn_id,
+- &attr_ctn_type,
+- &attr_dst_offset,
+- &attr_leap_seconds,
+- &attr_stp_online,
+- &attr_stratum,
+- &attr_time_offset,
+- &attr_time_zone_offset,
+- &attr_timing_mode,
+- &attr_timing_state,
++static struct device_attribute *stp_attributes[] = {
++ &dev_attr_ctn_id,
++ &dev_attr_ctn_type,
++ &dev_attr_dst_offset,
++ &dev_attr_leap_seconds,
++ &dev_attr_stp_online,
++ &dev_attr_stratum,
++ &dev_attr_time_offset,
++ &dev_attr_time_zone_offset,
++ &dev_attr_timing_mode,
++ &dev_attr_timing_state,
+ NULL
+ };
+
+ static int __init stp_init_sysfs(void)
+ {
+- struct sysdev_class_attribute **attr;
++ struct device_attribute **attr;
+ int rc;
+
+- rc = sysdev_class_register(&stp_sysclass);
++ rc = subsys_system_register(&stp_subsys, NULL);
+ if (rc)
+ goto out;
+ for (attr = stp_attributes; *attr; attr++) {
+- rc = sysdev_class_create_file(&stp_sysclass, *attr);
++ rc = device_create_file(stp_subsys.dev_root, *attr);
+ if (rc)
+ goto out_unreg;
+ }
+ return 0;
+ out_unreg:
+ for (; attr >= stp_attributes; attr--)
+- sysdev_class_remove_file(&stp_sysclass, *attr);
+- sysdev_class_unregister(&stp_sysclass);
++ device_remove_file(&stp_subsys.dev_root, *attr);
++ bus_unregister(&stp_subsys);
+ out:
+ return rc;
+ }
diff --git a/12-power-cmm.patch b/12-power-cmm.patch
new file mode 100644
index 0000000..720bdd5
--- /dev/null
+++ b/12-power-cmm.patch
@@ -0,0 +1,172 @@
+---
+ arch/powerpc/platforms/pseries/cmm.c | 67 +++++++++++++++++------------------
+ 1 file changed, 34 insertions(+), 33 deletions(-)
+
+--- a/arch/powerpc/platforms/pseries/cmm.c
++++ b/arch/powerpc/platforms/pseries/cmm.c
+@@ -33,7 +33,7 @@
+ #include <linux/sched.h>
+ #include <linux/stringify.h>
+ #include <linux/swap.h>
+-#include <linux/sysdev.h>
++#include <linux/device.h>
+ #include <asm/firmware.h>
+ #include <asm/hvcall.h>
+ #include <asm/mmu.h>
+@@ -65,7 +65,7 @@ static unsigned int oom_kb = CMM_OOM_KB;
+ static unsigned int cmm_debug = CMM_DEBUG;
+ static unsigned int cmm_disabled = CMM_DISABLE;
+ static unsigned long min_mem_mb = CMM_MIN_MEM_MB;
+-static struct sys_device cmm_sysdev;
++static struct device cmm_dev;
+
+ MODULE_AUTHOR("Brian King <brking@linux.vnet.ibm.com>");
+ MODULE_DESCRIPTION("IBM System p Collaborative Memory Manager");
+@@ -347,25 +347,25 @@ static int cmm_thread(void *dummy)
+ }
+
+ #define CMM_SHOW(name, format, args...) \
+- static ssize_t show_##name(struct sys_device *dev, \
+- struct sysdev_attribute *attr, \
++ static ssize_t show_##name(struct device *dev, \
++ struct device_attribute *attr, \
+ char *buf) \
+ { \
+ return sprintf(buf, format, ##args); \
+ } \
+- static SYSDEV_ATTR(name, S_IRUGO, show_##name, NULL)
++ static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL)
+
+ CMM_SHOW(loaned_kb, "%lu\n", PAGES2KB(loaned_pages));
+ CMM_SHOW(loaned_target_kb, "%lu\n", PAGES2KB(loaned_pages_target));
+
+-static ssize_t show_oom_pages(struct sys_device *dev,
+- struct sysdev_attribute *attr, char *buf)
++static ssize_t show_oom_pages(struct device *dev,
++ struct device_attribute *attr, char *buf)
+ {
+ return sprintf(buf, "%lu\n", PAGES2KB(oom_freed_pages));
+ }
+
+-static ssize_t store_oom_pages(struct sys_device *dev,
+- struct sysdev_attribute *attr,
++static ssize_t store_oom_pages(struct device *dev,
++ struct device_attribute *attr,
+ const char *buf, size_t count)
+ {
+ unsigned long val = simple_strtoul (buf, NULL, 10);
+@@ -379,17 +379,18 @@ static ssize_t store_oom_pages(struct sy
+ return count;
+ }
+
+-static SYSDEV_ATTR(oom_freed_kb, S_IWUSR| S_IRUGO,
++static DEVICE_ATTR(oom_freed_kb, S_IWUSR| S_IRUGO,
+ show_oom_pages, store_oom_pages);
+
+-static struct sysdev_attribute *cmm_attrs[] = {
+- &attr_loaned_kb,
+- &attr_loaned_target_kb,
+- &attr_oom_freed_kb,
++static struct device_attribute *cmm_attrs[] = {
++ &dev_attr_loaned_kb,
++ &dev_attr_loaned_target_kb,
++ &dev_attr_oom_freed_kb,
+ };
+
+-static struct sysdev_class cmm_sysdev_class = {
++static struct bus_type cmm_subsys = {
+ .name = "cmm",
++ .dev_name = "cmm",
+ };
+
+ /**
+@@ -398,21 +399,21 @@ static struct sysdev_class cmm_sysdev_cl
+ * Return value:
+ * 0 on success / other on failure
+ **/
+-static int cmm_sysfs_register(struct sys_device *sysdev)
++static int cmm_sysfs_register(struct device *dev)
+ {
+ int i, rc;
+
+- if ((rc = sysdev_class_register(&cmm_sysdev_class)))
++ if ((rc = subsys_system_register(&cmm_subsys, NULL)))
+ return rc;
+
+- sysdev->id = 0;
+- sysdev->cls = &cmm_sysdev_class;
++ dev->id = 0;
++ dev->bus = &cmm_subsys;
+
+- if ((rc = sysdev_register(sysdev)))
+- goto class_unregister;
++ if ((rc = device_register(dev)))
++ goto subsys_unregister;
+
+ for (i = 0; i < ARRAY_SIZE(cmm_attrs); i++) {
+- if ((rc = sysdev_create_file(sysdev, cmm_attrs[i])))
++ if ((rc = device_create_file(dev, cmm_attrs[i])))
+ goto fail;
+ }
+
+@@ -420,10 +421,10 @@ static int cmm_sysfs_register(struct sys
+
+ fail:
+ while (--i >= 0)
+- sysdev_remove_file(sysdev, cmm_attrs[i]);
+- sysdev_unregister(sysdev);
+-class_unregister:
+- sysdev_class_unregister(&cmm_sysdev_class);
++ device_remove_file(dev, cmm_attrs[i]);
++ device_unregister(dev);
++subsys_unregister:
++ bus_unregister(&cmm_subsys);
+ return rc;
+ }
+
+@@ -431,14 +432,14 @@ class_unregister:
+ * cmm_unregister_sysfs - Unregister from sysfs
+ *
+ **/
+-static void cmm_unregister_sysfs(struct sys_device *sysdev)
++static void cmm_unregister_sysfs(struct device *dev)
+ {
+ int i;
+
+ for (i = 0; i < ARRAY_SIZE(cmm_attrs); i++)
+- sysdev_remove_file(sysdev, cmm_attrs[i]);
+- sysdev_unregister(sysdev);
+- sysdev_class_unregister(&cmm_sysdev_class);
++ device_remove_file(dev, cmm_attrs[i]);
++ device_unregister(dev);
++ bus_unregister(&cmm_subsys);
+ }
+
+ /**
+@@ -657,7 +658,7 @@ static int cmm_init(void)
+ if ((rc = register_reboot_notifier(&cmm_reboot_nb)))
+ goto out_oom_notifier;
+
+- if ((rc = cmm_sysfs_register(&cmm_sysdev)))
++ if ((rc = cmm_sysfs_register(&cmm_dev)))
+ goto out_reboot_notifier;
+
+ if (register_memory_notifier(&cmm_mem_nb) ||
+@@ -678,7 +679,7 @@ static int cmm_init(void)
+ out_unregister_notifier:
+ unregister_memory_notifier(&cmm_mem_nb);
+ unregister_memory_isolate_notifier(&cmm_mem_isolate_nb);
+- cmm_unregister_sysfs(&cmm_sysdev);
++ cmm_unregister_sysfs(&cmm_dev);
+ out_reboot_notifier:
+ unregister_reboot_notifier(&cmm_reboot_nb);
+ out_oom_notifier:
+@@ -701,7 +702,7 @@ static void cmm_exit(void)
+ unregister_memory_notifier(&cmm_mem_nb);
+ unregister_memory_isolate_notifier(&cmm_mem_isolate_nb);
+ cmm_free_pages(loaned_pages);
+- cmm_unregister_sysfs(&cmm_sysdev);
++ cmm_unregister_sysfs(&cmm_dev);
+ }
+
+ /**
diff --git a/13-power-qe_ic.patch b/13-power-qe_ic.patch
new file mode 100644
index 0000000..7023889
--- /dev/null
+++ b/13-power-qe_ic.patch
@@ -0,0 +1,48 @@
+---
+ arch/powerpc/sysdev/qe_lib/qe_ic.c | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+--- a/arch/powerpc/sysdev/qe_lib/qe_ic.c
++++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c
+@@ -22,7 +22,7 @@
+ #include <linux/stddef.h>
+ #include <linux/sched.h>
+ #include <linux/signal.h>
+-#include <linux/sysdev.h>
++#include <linux/device.h>
+ #include <linux/device.h>
+ #include <linux/bootmem.h>
+ #include <linux/spinlock.h>
+@@ -484,13 +484,14 @@ int qe_ic_set_high_priority(unsigned int
+ return 0;
+ }
+
+-static struct sysdev_class qe_ic_sysclass = {
++static struct bus_type qe_ic_subsys = {
+ .name = "qe_ic",
++ .dev_name = "qe_ic",
+ };
+
+-static struct sys_device device_qe_ic = {
++static struct device device_qe_ic = {
+ .id = 0,
+- .cls = &qe_ic_sysclass,
++ .bus = &qe_ic_subsys,
+ };
+
+ static int __init init_qe_ic_sysfs(void)
+@@ -499,12 +500,12 @@ static int __init init_qe_ic_sysfs(void)
+
+ printk(KERN_DEBUG "Registering qe_ic with sysfs...\n");
+
+- rc = sysdev_class_register(&qe_ic_sysclass);
++ rc = subsys_system_register(&qe_ic_subsys, NULL);
+ if (rc) {
+ printk(KERN_ERR "Failed registering qe_ic sys class\n");
+ return -ENODEV;
+ }
+- rc = sysdev_register(&device_qe_ic);
++ rc = device_register(&device_qe_ic);
+ if (rc) {
+ printk(KERN_ERR "Failed registering qe_ic sys device\n");
+ return -ENODEV;
diff --git a/14-power-suspend.patch b/14-power-suspend.patch
new file mode 100644
index 0000000..0997728
--- /dev/null
+++ b/14-power-suspend.patch
@@ -0,0 +1,92 @@
+---
+ arch/powerpc/platforms/pseries/suspend.c | 33 +++++++++++++++----------------
+ 1 file changed, 17 insertions(+), 16 deletions(-)
+
+--- a/arch/powerpc/platforms/pseries/suspend.c
++++ b/arch/powerpc/platforms/pseries/suspend.c
+@@ -26,7 +26,7 @@
+ #include <asm/rtas.h>
+
+ static u64 stream_id;
+-static struct sys_device suspend_sysdev;
++static struct device suspend_dev;
+ static DECLARE_COMPLETION(suspend_work);
+ static struct rtas_suspend_me_data suspend_data;
+ static atomic_t suspending;
+@@ -110,8 +110,8 @@ static int pseries_prepare_late(void)
+
+ /**
+ * store_hibernate - Initiate partition hibernation
+- * @classdev: sysdev class struct
+- * @attr: class device attribute struct
++ * @dev: subsys root device
++ * @attr: device attribute struct
+ * @buf: buffer
+ * @count: buffer size
+ *
+@@ -121,8 +121,8 @@ static int pseries_prepare_late(void)
+ * Return value:
+ * number of bytes printed to buffer / other on failure
+ **/
+-static ssize_t store_hibernate(struct sysdev_class *classdev,
+- struct sysdev_class_attribute *attr,
++static ssize_t store_hibernate(struct device *dev,
++ struct device_attribute *attr,
+ const char *buf, size_t count)
+ {
+ int rc;
+@@ -148,10 +148,11 @@ static ssize_t store_hibernate(struct sy
+ return rc;
+ }
+
+-static SYSDEV_CLASS_ATTR(hibernate, S_IWUSR, NULL, store_hibernate);
++static DEVICE_ATTR(hibernate, S_IWUSR, NULL, store_hibernate);
+
+-static struct sysdev_class suspend_sysdev_class = {
++static struct bus_type suspend_subsys = {
+ .name = "power",
++ .dev_name = "power",
+ };
+
+ static const struct platform_suspend_ops pseries_suspend_ops = {
+@@ -167,23 +168,23 @@ static const struct platform_suspend_ops
+ * Return value:
+ * 0 on success / other on failure
+ **/
+-static int pseries_suspend_sysfs_register(struct sys_device *sysdev)
++static int pseries_suspend_sysfs_register(struct device *dev)
+ {
+ int rc;
+
+- if ((rc = sysdev_class_register(&suspend_sysdev_class)))
++ if ((rc = subsys_system_register(&suspend_subsys, NULL)))
+ return rc;
+
+- sysdev->id = 0;
+- sysdev->cls = &suspend_sysdev_class;
++ dev->id = 0;
++ dev->bus = &suspend_subsys;
+
+- if ((rc = sysdev_class_create_file(&suspend_sysdev_class, &attr_hibernate)))
+- goto class_unregister;
++ if ((rc = device_create_file(suspend_subsys.dev_root, &dev_attr_hibernate)))
++ goto subsys_unregister;
+
+ return 0;
+
+-class_unregister:
+- sysdev_class_unregister(&suspend_sysdev_class);
++subsys_unregister:
++ bus_unregister(&suspend_subsys);
+ return rc;
+ }
+
+@@ -204,7 +205,7 @@ static int __init pseries_suspend_init(v
+ if (suspend_data.token == RTAS_UNKNOWN_SERVICE)
+ return 0;
+
+- if ((rc = pseries_suspend_sysfs_register(&suspend_sysdev)))
++ if ((rc = pseries_suspend_sysfs_register(&suspend_dev)))
+ return rc;
+
+ ppc_md.suspend_disable_cpu = pseries_suspend_cpu;
diff --git a/series b/series
index d983a19..fcf3ee5 100644
--- a/series
+++ b/series
@@ -6,4 +6,9 @@
08-xen.patch
09-cpu.patch
10-memory.patch
+11-s390-time.patch
+12-power-cmm.patch
+13-power-qe_ic.patch
+14-power-suspend.patch
99-core-remove.patch
+