aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-18 18:08:12 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-18 18:08:12 -0500
commit673ab8783b596cda5b616b317b1a1b47480c66fd (patch)
treed3fc9bb4279720c53d0dc69c2a34c40635cf05f3 /arch/x86
parentd7b96ca5d08a8f2f836feb2b3b3bd721d2837a8e (diff)
parent3cf23841b4b76eb94d3f8d0fb3627690e4431413 (diff)
Merge branch 'akpm' (more patches from Andrew)
Merge patches from Andrew Morton: "Most of the rest of MM, plus a few dribs and drabs. I still have quite a few irritating patches left around: ones with dubious testing results, lack of review, ones which should have gone via maintainer trees but the maintainers are slack, etc. I need to be more activist in getting these things wrapped up outside the merge window, but they're such a PITA." * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (48 commits) mm/vmscan.c: avoid possible deadlock caused by too_many_isolated() vmscan: comment too_many_isolated() mm/kmemleak.c: remove obsolete simple_strtoul mm/memory_hotplug.c: improve comments mm/hugetlb: create hugetlb cgroup file in hugetlb_init mm/mprotect.c: coding-style cleanups Documentation: ABI: /sys/devices/system/node/ slub: drop mutex before deleting sysfs entry memcg: add comments clarifying aspects of cache attribute propagation kmem: add slab-specific documentation about the kmem controller slub: slub-specific propagation changes slab: propagate tunable values memcg: aggregate memcg cache values in slabinfo memcg/sl[au]b: shrink dead caches memcg/sl[au]b: track all the memcg children of a kmem_cache memcg: destroy memcg caches sl[au]b: allocate objects from memcg cache sl[au]b: always get the cache from its page in kmem_cache_free() memcg: skip memcg kmem allocations in specified code regions memcg: infrastructure to match an allocation to the right cache ...
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/platform/iris/iris.c67
1 files changed, 57 insertions, 10 deletions
diff --git a/arch/x86/platform/iris/iris.c b/arch/x86/platform/iris/iris.c
index 5917eb56b313..e6cb80f620af 100644
--- a/arch/x86/platform/iris/iris.c
+++ b/arch/x86/platform/iris/iris.c
@@ -23,6 +23,7 @@
23 23
24#include <linux/moduleparam.h> 24#include <linux/moduleparam.h>
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/platform_device.h>
26#include <linux/kernel.h> 27#include <linux/kernel.h>
27#include <linux/errno.h> 28#include <linux/errno.h>
28#include <linux/delay.h> 29#include <linux/delay.h>
@@ -62,29 +63,75 @@ static void iris_power_off(void)
62 * by reading its input port and seeing whether the read value is 63 * by reading its input port and seeing whether the read value is
63 * meaningful. 64 * meaningful.
64 */ 65 */
65static int iris_init(void) 66static int iris_probe(struct platform_device *pdev)
66{ 67{
67 unsigned char status; 68 unsigned char status = inb(IRIS_GIO_INPUT);
68 if (force != 1) {
69 printk(KERN_ERR "The force parameter has not been set to 1 so the Iris poweroff handler will not be installed.\n");
70 return -ENODEV;
71 }
72 status = inb(IRIS_GIO_INPUT);
73 if (status == IRIS_GIO_NODEV) { 69 if (status == IRIS_GIO_NODEV) {
74 printk(KERN_ERR "This machine does not seem to be an Iris. Power_off handler not installed.\n"); 70 printk(KERN_ERR "This machine does not seem to be an Iris. "
71 "Power off handler not installed.\n");
75 return -ENODEV; 72 return -ENODEV;
76 } 73 }
77 old_pm_power_off = pm_power_off; 74 old_pm_power_off = pm_power_off;
78 pm_power_off = &iris_power_off; 75 pm_power_off = &iris_power_off;
79 printk(KERN_INFO "Iris power_off handler installed.\n"); 76 printk(KERN_INFO "Iris power_off handler installed.\n");
80
81 return 0; 77 return 0;
82} 78}
83 79
84static void iris_exit(void) 80static int iris_remove(struct platform_device *pdev)
85{ 81{
86 pm_power_off = old_pm_power_off; 82 pm_power_off = old_pm_power_off;
87 printk(KERN_INFO "Iris power_off handler uninstalled.\n"); 83 printk(KERN_INFO "Iris power_off handler uninstalled.\n");
84 return 0;
85}
86
87static struct platform_driver iris_driver = {
88 .driver = {
89 .name = "iris",
90 .owner = THIS_MODULE,
91 },
92 .probe = iris_probe,
93 .remove = iris_remove,
94};
95
96static struct resource iris_resources[] = {
97 {
98 .start = IRIS_GIO_BASE,
99 .end = IRIS_GIO_OUTPUT,
100 .flags = IORESOURCE_IO,
101 .name = "address"
102 }
103};
104
105static struct platform_device *iris_device;
106
107static int iris_init(void)
108{
109 int ret;
110 if (force != 1) {
111 printk(KERN_ERR "The force parameter has not been set to 1."
112 " The Iris poweroff handler will not be installed.\n");
113 return -ENODEV;
114 }
115 ret = platform_driver_register(&iris_driver);
116 if (ret < 0) {
117 printk(KERN_ERR "Failed to register iris platform driver: %d\n",
118 ret);
119 return ret;
120 }
121 iris_device = platform_device_register_simple("iris", (-1),
122 iris_resources, ARRAY_SIZE(iris_resources));
123 if (IS_ERR(iris_device)) {
124 printk(KERN_ERR "Failed to register iris platform device\n");
125 platform_driver_unregister(&iris_driver);
126 return PTR_ERR(iris_device);
127 }
128 return 0;
129}
130
131static void iris_exit(void)
132{
133 platform_device_unregister(iris_device);
134 platform_driver_unregister(&iris_driver);
88} 135}
89 136
90module_init(iris_init); 137module_init(iris_init);