aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2012-01-06 14:42:52 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2012-01-06 14:42:52 -0500
commitff4b8a57f0aaa2882d444ca44b2b9b333d22a4df (patch)
treed851c923f85566572112d4c0f884cff388a3cc05 /drivers/xen
parent805a6af8dba5dfdd35ec35dc52ec0122400b2610 (diff)
parentea04018e6bc5ddb2f0466c0e5b986bd4901b7e8e (diff)
Merge branch 'driver-core-next' into Linux 3.2
This resolves the conflict in the arch/arm/mach-s3c64xx/s3c6400.c file, and it fixes the build error in the arch/x86/kernel/microcode_core.c file, that the merge did not catch. The microcode_core.c patch was provided by Stephen Rothwell <sfr@canb.auug.org.au> who was invaluable in the merge issues involved with the large sysdev removal process in the driver-core tree. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/xen-balloon.c86
-rw-r--r--drivers/xen/xen-selfballoon.c76
2 files changed, 81 insertions, 81 deletions
diff --git a/drivers/xen/xen-balloon.c b/drivers/xen/xen-balloon.c
index 9cc2259c9992..3832e303c33a 100644
--- a/drivers/xen/xen-balloon.c
+++ b/drivers/xen/xen-balloon.c
@@ -32,7 +32,6 @@
32 32
33#include <linux/kernel.h> 33#include <linux/kernel.h>
34#include <linux/module.h> 34#include <linux/module.h>
35#include <linux/sysdev.h>
36#include <linux/capability.h> 35#include <linux/capability.h>
37 36
38#include <xen/xen.h> 37#include <xen/xen.h>
@@ -46,9 +45,9 @@
46 45
47#define BALLOON_CLASS_NAME "xen_memory" 46#define BALLOON_CLASS_NAME "xen_memory"
48 47
49static struct sys_device balloon_sysdev; 48static struct device balloon_dev;
50 49
51static int register_balloon(struct sys_device *sysdev); 50static int register_balloon(struct device *dev);
52 51
53/* React to a change in the target key */ 52/* React to a change in the target key */
54static void watch_target(struct xenbus_watch *watch, 53static void watch_target(struct xenbus_watch *watch,
@@ -98,9 +97,9 @@ static int __init balloon_init(void)
98 97
99 pr_info("xen-balloon: Initialising balloon driver.\n"); 98 pr_info("xen-balloon: Initialising balloon driver.\n");
100 99
101 register_balloon(&balloon_sysdev); 100 register_balloon(&balloon_dev);
102 101
103 register_xen_selfballooning(&balloon_sysdev); 102 register_xen_selfballooning(&balloon_dev);
104 103
105 register_xenstore_notifier(&xenstore_notifier); 104 register_xenstore_notifier(&xenstore_notifier);
106 105
@@ -117,31 +116,31 @@ static void balloon_exit(void)
117module_exit(balloon_exit); 116module_exit(balloon_exit);
118 117
119#define BALLOON_SHOW(name, format, args...) \ 118#define BALLOON_SHOW(name, format, args...) \
120 static ssize_t show_##name(struct sys_device *dev, \ 119 static ssize_t show_##name(struct device *dev, \
121 struct sysdev_attribute *attr, \ 120 struct device_attribute *attr, \
122 char *buf) \ 121 char *buf) \
123 { \ 122 { \
124 return sprintf(buf, format, ##args); \ 123 return sprintf(buf, format, ##args); \
125 } \ 124 } \
126 static SYSDEV_ATTR(name, S_IRUGO, show_##name, NULL) 125 static DEVICE_ATTR(name, S_IRUGO, show_##name, NULL)
127 126
128BALLOON_SHOW(current_kb, "%lu\n", PAGES2KB(balloon_stats.current_pages)); 127BALLOON_SHOW(current_kb, "%lu\n", PAGES2KB(balloon_stats.current_pages));
129BALLOON_SHOW(low_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_low)); 128BALLOON_SHOW(low_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_low));
130BALLOON_SHOW(high_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_high)); 129BALLOON_SHOW(high_kb, "%lu\n", PAGES2KB(balloon_stats.balloon_high));
131 130
132static SYSDEV_ULONG_ATTR(schedule_delay, 0444, balloon_stats.schedule_delay); 131static DEVICE_ULONG_ATTR(schedule_delay, 0444, balloon_stats.schedule_delay);
133static SYSDEV_ULONG_ATTR(max_schedule_delay, 0644, balloon_stats.max_schedule_delay); 132static DEVICE_ULONG_ATTR(max_schedule_delay, 0644, balloon_stats.max_schedule_delay);
134static SYSDEV_ULONG_ATTR(retry_count, 0444, balloon_stats.retry_count); 133static DEVICE_ULONG_ATTR(retry_count, 0444, balloon_stats.retry_count);
135static SYSDEV_ULONG_ATTR(max_retry_count, 0644, balloon_stats.max_retry_count); 134static DEVICE_ULONG_ATTR(max_retry_count, 0644, balloon_stats.max_retry_count);
136 135
137static ssize_t show_target_kb(struct sys_device *dev, struct sysdev_attribute *attr, 136static ssize_t show_target_kb(struct device *dev, struct device_attribute *attr,
138 char *buf) 137 char *buf)
139{ 138{
140 return sprintf(buf, "%lu\n", PAGES2KB(balloon_stats.target_pages)); 139 return sprintf(buf, "%lu\n", PAGES2KB(balloon_stats.target_pages));
141} 140}
142 141
143static ssize_t store_target_kb(struct sys_device *dev, 142static ssize_t store_target_kb(struct device *dev,
144 struct sysdev_attribute *attr, 143 struct device_attribute *attr,
145 const char *buf, 144 const char *buf,
146 size_t count) 145 size_t count)
147{ 146{
@@ -158,11 +157,11 @@ static ssize_t store_target_kb(struct sys_device *dev,
158 return count; 157 return count;
159} 158}
160 159
161static SYSDEV_ATTR(target_kb, S_IRUGO | S_IWUSR, 160static DEVICE_ATTR(target_kb, S_IRUGO | S_IWUSR,
162 show_target_kb, store_target_kb); 161 show_target_kb, store_target_kb);
163 162
164 163
165static ssize_t show_target(struct sys_device *dev, struct sysdev_attribute *attr, 164static ssize_t show_target(struct device *dev, struct device_attribute *attr,
166 char *buf) 165 char *buf)
167{ 166{
168 return sprintf(buf, "%llu\n", 167 return sprintf(buf, "%llu\n",
@@ -170,8 +169,8 @@ static ssize_t show_target(struct sys_device *dev, struct sysdev_attribute *attr
170 << PAGE_SHIFT); 169 << PAGE_SHIFT);
171} 170}
172 171
173static ssize_t store_target(struct sys_device *dev, 172static ssize_t store_target(struct device *dev,
174 struct sysdev_attribute *attr, 173 struct device_attribute *attr,
175 const char *buf, 174 const char *buf,
176 size_t count) 175 size_t count)
177{ 176{
@@ -188,23 +187,23 @@ static ssize_t store_target(struct sys_device *dev,
188 return count; 187 return count;
189} 188}
190 189
191static SYSDEV_ATTR(target, S_IRUGO | S_IWUSR, 190static DEVICE_ATTR(target, S_IRUGO | S_IWUSR,
192 show_target, store_target); 191 show_target, store_target);
193 192
194 193
195static struct sysdev_attribute *balloon_attrs[] = { 194static struct device_attribute *balloon_attrs[] = {
196 &attr_target_kb, 195 &dev_attr_target_kb,
197 &attr_target, 196 &dev_attr_target,
198 &attr_schedule_delay.attr, 197 &dev_attr_schedule_delay.attr,
199 &attr_max_schedule_delay.attr, 198 &dev_attr_max_schedule_delay.attr,
200 &attr_retry_count.attr, 199 &dev_attr_retry_count.attr,
201 &attr_max_retry_count.attr 200 &dev_attr_max_retry_count.attr
202}; 201};
203 202
204static struct attribute *balloon_info_attrs[] = { 203static struct attribute *balloon_info_attrs[] = {
205 &attr_current_kb.attr, 204 &dev_attr_current_kb.attr,
206 &attr_low_kb.attr, 205 &dev_attr_low_kb.attr,
207 &attr_high_kb.attr, 206 &dev_attr_high_kb.attr,
208 NULL 207 NULL
209}; 208};
210 209
@@ -213,34 +212,35 @@ static struct attribute_group balloon_info_group = {
213 .attrs = balloon_info_attrs 212 .attrs = balloon_info_attrs
214}; 213};
215 214
216static struct sysdev_class balloon_sysdev_class = { 215static struct bus_type balloon_subsys = {
217 .name = BALLOON_CLASS_NAME 216 .name = BALLOON_CLASS_NAME,
217 .dev_name = BALLOON_CLASS_NAME,
218}; 218};
219 219
220static int register_balloon(struct sys_device *sysdev) 220static int register_balloon(struct device *dev)
221{ 221{
222 int i, error; 222 int i, error;
223 223
224 error = sysdev_class_register(&balloon_sysdev_class); 224 error = bus_register(&balloon_subsys);
225 if (error) 225 if (error)
226 return error; 226 return error;
227 227
228 sysdev->id = 0; 228 dev->id = 0;
229 sysdev->cls = &balloon_sysdev_class; 229 dev->bus = &balloon_subsys;
230 230
231 error = sysdev_register(sysdev); 231 error = device_register(dev);
232 if (error) { 232 if (error) {
233 sysdev_class_unregister(&balloon_sysdev_class); 233 bus_unregister(&balloon_subsys);
234 return error; 234 return error;
235 } 235 }
236 236
237 for (i = 0; i < ARRAY_SIZE(balloon_attrs); i++) { 237 for (i = 0; i < ARRAY_SIZE(balloon_attrs); i++) {
238 error = sysdev_create_file(sysdev, balloon_attrs[i]); 238 error = device_create_file(dev, balloon_attrs[i]);
239 if (error) 239 if (error)
240 goto fail; 240 goto fail;
241 } 241 }
242 242
243 error = sysfs_create_group(&sysdev->kobj, &balloon_info_group); 243 error = sysfs_create_group(&dev->kobj, &balloon_info_group);
244 if (error) 244 if (error)
245 goto fail; 245 goto fail;
246 246
@@ -248,9 +248,9 @@ static int register_balloon(struct sys_device *sysdev)
248 248
249 fail: 249 fail:
250 while (--i >= 0) 250 while (--i >= 0)
251 sysdev_remove_file(sysdev, balloon_attrs[i]); 251 device_remove_file(dev, balloon_attrs[i]);
252 sysdev_unregister(sysdev); 252 device_unregister(dev);
253 sysdev_class_unregister(&balloon_sysdev_class); 253 bus_unregister(&balloon_subsys);
254 return error; 254 return error;
255} 255}
256 256
diff --git a/drivers/xen/xen-selfballoon.c b/drivers/xen/xen-selfballoon.c
index d93c70857e03..767ff656d5a7 100644
--- a/drivers/xen/xen-selfballoon.c
+++ b/drivers/xen/xen-selfballoon.c
@@ -74,6 +74,7 @@
74#include <linux/mman.h> 74#include <linux/mman.h>
75#include <linux/module.h> 75#include <linux/module.h>
76#include <linux/workqueue.h> 76#include <linux/workqueue.h>
77#include <linux/device.h>
77#include <xen/balloon.h> 78#include <xen/balloon.h>
78#include <xen/tmem.h> 79#include <xen/tmem.h>
79#include <xen/xen.h> 80#include <xen/xen.h>
@@ -266,21 +267,20 @@ static void selfballoon_process(struct work_struct *work)
266 267
267#ifdef CONFIG_SYSFS 268#ifdef CONFIG_SYSFS
268 269
269#include <linux/sysdev.h>
270#include <linux/capability.h> 270#include <linux/capability.h>
271 271
272#define SELFBALLOON_SHOW(name, format, args...) \ 272#define SELFBALLOON_SHOW(name, format, args...) \
273 static ssize_t show_##name(struct sys_device *dev, \ 273 static ssize_t show_##name(struct device *dev, \
274 struct sysdev_attribute *attr, \ 274 struct device_attribute *attr, \
275 char *buf) \ 275 char *buf) \
276 { \ 276 { \
277 return sprintf(buf, format, ##args); \ 277 return sprintf(buf, format, ##args); \
278 } 278 }
279 279
280SELFBALLOON_SHOW(selfballooning, "%d\n", xen_selfballooning_enabled); 280SELFBALLOON_SHOW(selfballooning, "%d\n", xen_selfballooning_enabled);
281 281
282static ssize_t store_selfballooning(struct sys_device *dev, 282static ssize_t store_selfballooning(struct device *dev,
283 struct sysdev_attribute *attr, 283 struct device_attribute *attr,
284 const char *buf, 284 const char *buf,
285 size_t count) 285 size_t count)
286{ 286{
@@ -303,13 +303,13 @@ static ssize_t store_selfballooning(struct sys_device *dev,
303 return count; 303 return count;
304} 304}
305 305
306static SYSDEV_ATTR(selfballooning, S_IRUGO | S_IWUSR, 306static DEVICE_ATTR(selfballooning, S_IRUGO | S_IWUSR,
307 show_selfballooning, store_selfballooning); 307 show_selfballooning, store_selfballooning);
308 308
309SELFBALLOON_SHOW(selfballoon_interval, "%d\n", selfballoon_interval); 309SELFBALLOON_SHOW(selfballoon_interval, "%d\n", selfballoon_interval);
310 310
311static ssize_t store_selfballoon_interval(struct sys_device *dev, 311static ssize_t store_selfballoon_interval(struct device *dev,
312 struct sysdev_attribute *attr, 312 struct device_attribute *attr,
313 const char *buf, 313 const char *buf,
314 size_t count) 314 size_t count)
315{ 315{
@@ -325,13 +325,13 @@ static ssize_t store_selfballoon_interval(struct sys_device *dev,
325 return count; 325 return count;
326} 326}
327 327
328static SYSDEV_ATTR(selfballoon_interval, S_IRUGO | S_IWUSR, 328static DEVICE_ATTR(selfballoon_interval, S_IRUGO | S_IWUSR,
329 show_selfballoon_interval, store_selfballoon_interval); 329 show_selfballoon_interval, store_selfballoon_interval);
330 330
331SELFBALLOON_SHOW(selfballoon_downhys, "%d\n", selfballoon_downhysteresis); 331SELFBALLOON_SHOW(selfballoon_downhys, "%d\n", selfballoon_downhysteresis);
332 332
333static ssize_t store_selfballoon_downhys(struct sys_device *dev, 333static ssize_t store_selfballoon_downhys(struct device *dev,
334 struct sysdev_attribute *attr, 334 struct device_attribute *attr,
335 const char *buf, 335 const char *buf,
336 size_t count) 336 size_t count)
337{ 337{
@@ -347,14 +347,14 @@ static ssize_t store_selfballoon_downhys(struct sys_device *dev,
347 return count; 347 return count;
348} 348}
349 349
350static SYSDEV_ATTR(selfballoon_downhysteresis, S_IRUGO | S_IWUSR, 350static DEVICE_ATTR(selfballoon_downhysteresis, S_IRUGO | S_IWUSR,
351 show_selfballoon_downhys, store_selfballoon_downhys); 351 show_selfballoon_downhys, store_selfballoon_downhys);
352 352
353 353
354SELFBALLOON_SHOW(selfballoon_uphys, "%d\n", selfballoon_uphysteresis); 354SELFBALLOON_SHOW(selfballoon_uphys, "%d\n", selfballoon_uphysteresis);
355 355
356static ssize_t store_selfballoon_uphys(struct sys_device *dev, 356static ssize_t store_selfballoon_uphys(struct device *dev,
357 struct sysdev_attribute *attr, 357 struct device_attribute *attr,
358 const char *buf, 358 const char *buf,
359 size_t count) 359 size_t count)
360{ 360{
@@ -370,14 +370,14 @@ static ssize_t store_selfballoon_uphys(struct sys_device *dev,
370 return count; 370 return count;
371} 371}
372 372
373static SYSDEV_ATTR(selfballoon_uphysteresis, S_IRUGO | S_IWUSR, 373static DEVICE_ATTR(selfballoon_uphysteresis, S_IRUGO | S_IWUSR,
374 show_selfballoon_uphys, store_selfballoon_uphys); 374 show_selfballoon_uphys, store_selfballoon_uphys);
375 375
376SELFBALLOON_SHOW(selfballoon_min_usable_mb, "%d\n", 376SELFBALLOON_SHOW(selfballoon_min_usable_mb, "%d\n",
377 selfballoon_min_usable_mb); 377 selfballoon_min_usable_mb);
378 378
379static ssize_t store_selfballoon_min_usable_mb(struct sys_device *dev, 379static ssize_t store_selfballoon_min_usable_mb(struct device *dev,
380 struct sysdev_attribute *attr, 380 struct device_attribute *attr,
381 const char *buf, 381 const char *buf,
382 size_t count) 382 size_t count)
383{ 383{
@@ -393,7 +393,7 @@ static ssize_t store_selfballoon_min_usable_mb(struct sys_device *dev,
393 return count; 393 return count;
394} 394}
395 395
396static SYSDEV_ATTR(selfballoon_min_usable_mb, S_IRUGO | S_IWUSR, 396static DEVICE_ATTR(selfballoon_min_usable_mb, S_IRUGO | S_IWUSR,
397 show_selfballoon_min_usable_mb, 397 show_selfballoon_min_usable_mb,
398 store_selfballoon_min_usable_mb); 398 store_selfballoon_min_usable_mb);
399 399
@@ -401,8 +401,8 @@ static SYSDEV_ATTR(selfballoon_min_usable_mb, S_IRUGO | S_IWUSR,
401#ifdef CONFIG_FRONTSWAP 401#ifdef CONFIG_FRONTSWAP
402SELFBALLOON_SHOW(frontswap_selfshrinking, "%d\n", frontswap_selfshrinking); 402SELFBALLOON_SHOW(frontswap_selfshrinking, "%d\n", frontswap_selfshrinking);
403 403
404static ssize_t store_frontswap_selfshrinking(struct sys_device *dev, 404static ssize_t store_frontswap_selfshrinking(struct device *dev,
405 struct sysdev_attribute *attr, 405 struct device_attribute *attr,
406 const char *buf, 406 const char *buf,
407 size_t count) 407 size_t count)
408{ 408{
@@ -424,13 +424,13 @@ static ssize_t store_frontswap_selfshrinking(struct sys_device *dev,
424 return count; 424 return count;
425} 425}
426 426
427static SYSDEV_ATTR(frontswap_selfshrinking, S_IRUGO | S_IWUSR, 427static DEVICE_ATTR(frontswap_selfshrinking, S_IRUGO | S_IWUSR,
428 show_frontswap_selfshrinking, store_frontswap_selfshrinking); 428 show_frontswap_selfshrinking, store_frontswap_selfshrinking);
429 429
430SELFBALLOON_SHOW(frontswap_inertia, "%d\n", frontswap_inertia); 430SELFBALLOON_SHOW(frontswap_inertia, "%d\n", frontswap_inertia);
431 431
432static ssize_t store_frontswap_inertia(struct sys_device *dev, 432static ssize_t store_frontswap_inertia(struct device *dev,
433 struct sysdev_attribute *attr, 433 struct device_attribute *attr,
434 const char *buf, 434 const char *buf,
435 size_t count) 435 size_t count)
436{ 436{
@@ -447,13 +447,13 @@ static ssize_t store_frontswap_inertia(struct sys_device *dev,
447 return count; 447 return count;
448} 448}
449 449
450static SYSDEV_ATTR(frontswap_inertia, S_IRUGO | S_IWUSR, 450static DEVICE_ATTR(frontswap_inertia, S_IRUGO | S_IWUSR,
451 show_frontswap_inertia, store_frontswap_inertia); 451 show_frontswap_inertia, store_frontswap_inertia);
452 452
453SELFBALLOON_SHOW(frontswap_hysteresis, "%d\n", frontswap_hysteresis); 453SELFBALLOON_SHOW(frontswap_hysteresis, "%d\n", frontswap_hysteresis);
454 454
455static ssize_t store_frontswap_hysteresis(struct sys_device *dev, 455static ssize_t store_frontswap_hysteresis(struct device *dev,
456 struct sysdev_attribute *attr, 456 struct device_attribute *attr,
457 const char *buf, 457 const char *buf,
458 size_t count) 458 size_t count)
459{ 459{
@@ -469,21 +469,21 @@ static ssize_t store_frontswap_hysteresis(struct sys_device *dev,
469 return count; 469 return count;
470} 470}
471 471
472static SYSDEV_ATTR(frontswap_hysteresis, S_IRUGO | S_IWUSR, 472static DEVICE_ATTR(frontswap_hysteresis, S_IRUGO | S_IWUSR,
473 show_frontswap_hysteresis, store_frontswap_hysteresis); 473 show_frontswap_hysteresis, store_frontswap_hysteresis);
474 474
475#endif /* CONFIG_FRONTSWAP */ 475#endif /* CONFIG_FRONTSWAP */
476 476
477static struct attribute *selfballoon_attrs[] = { 477static struct attribute *selfballoon_attrs[] = {
478 &attr_selfballooning.attr, 478 &dev_attr_selfballooning.attr,
479 &attr_selfballoon_interval.attr, 479 &dev_attr_selfballoon_interval.attr,
480 &attr_selfballoon_downhysteresis.attr, 480 &dev_attr_selfballoon_downhysteresis.attr,
481 &attr_selfballoon_uphysteresis.attr, 481 &dev_attr_selfballoon_uphysteresis.attr,
482 &attr_selfballoon_min_usable_mb.attr, 482 &dev_attr_selfballoon_min_usable_mb.attr,
483#ifdef CONFIG_FRONTSWAP 483#ifdef CONFIG_FRONTSWAP
484 &attr_frontswap_selfshrinking.attr, 484 &dev_attr_frontswap_selfshrinking.attr,
485 &attr_frontswap_hysteresis.attr, 485 &dev_attr_frontswap_hysteresis.attr,
486 &attr_frontswap_inertia.attr, 486 &dev_attr_frontswap_inertia.attr,
487#endif 487#endif
488 NULL 488 NULL
489}; 489};
@@ -494,12 +494,12 @@ static struct attribute_group selfballoon_group = {
494}; 494};
495#endif 495#endif
496 496
497int register_xen_selfballooning(struct sys_device *sysdev) 497int register_xen_selfballooning(struct device *dev)
498{ 498{
499 int error = -1; 499 int error = -1;
500 500
501#ifdef CONFIG_SYSFS 501#ifdef CONFIG_SYSFS
502 error = sysfs_create_group(&sysdev->kobj, &selfballoon_group); 502 error = sysfs_create_group(&dev->kobj, &selfballoon_group);
503#endif 503#endif
504 return error; 504 return error;
505} 505}