diff options
author | Douglas Thompson <dougthompson@xmission.com> | 2007-07-19 04:50:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 13:04:54 -0400 |
commit | 86aa8cb7bc47fe786df073246055d69d98e6330a (patch) | |
tree | 391f85de03e0deeb44aa73f62633cc750a4cf609 /drivers | |
parent | 542b25881a6ae1bf0804d4d39bf8b4d2cfc25e42 (diff) |
drivers/edac: cleanup workq ifdefs
The origin of this code comes from patches at sourceforge, that
allow EDAC to be updated to various kernels. With kernel version 2.6.20 a
new workq system was installed, thus the patches needed to be modified
based on the kernel version. For submitting to the latest kernel.org
those #ifdefs are removed
Signed-off-by: Douglas Thompson <dougthompson@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/edac/edac_core.h | 13 | ||||
-rw-r--r-- | drivers/edac/edac_device.c | 11 | ||||
-rw-r--r-- | drivers/edac/edac_mc.c | 10 | ||||
-rw-r--r-- | drivers/edac/edac_pci.c | 10 |
4 files changed, 1 insertions, 43 deletions
diff --git a/drivers/edac/edac_core.h b/drivers/edac/edac_core.h index c511ad4de901..b955c58672e2 100644 --- a/drivers/edac/edac_core.h +++ b/drivers/edac/edac_core.h | |||
@@ -395,11 +395,8 @@ struct mem_ctl_info { | |||
395 | struct completion kobj_complete; | 395 | struct completion kobj_complete; |
396 | 396 | ||
397 | /* work struct for this MC */ | 397 | /* work struct for this MC */ |
398 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) | ||
399 | struct delayed_work work; | 398 | struct delayed_work work; |
400 | #else | 399 | |
401 | struct work_struct work; | ||
402 | #endif | ||
403 | /* the internal state of this controller instance */ | 400 | /* the internal state of this controller instance */ |
404 | int op_state; | 401 | int op_state; |
405 | }; | 402 | }; |
@@ -530,11 +527,7 @@ struct edac_device_ctl_info { | |||
530 | /* the internal state of this controller instance */ | 527 | /* the internal state of this controller instance */ |
531 | int op_state; | 528 | int op_state; |
532 | /* work struct for this instance */ | 529 | /* work struct for this instance */ |
533 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) | ||
534 | struct delayed_work work; | 530 | struct delayed_work work; |
535 | #else | ||
536 | struct work_struct work; | ||
537 | #endif | ||
538 | 531 | ||
539 | /* pointer to edac polling checking routine: | 532 | /* pointer to edac polling checking routine: |
540 | * If NOT NULL: points to polling check routine | 533 | * If NOT NULL: points to polling check routine |
@@ -647,11 +640,7 @@ struct edac_pci_ctl_info { | |||
647 | /* the internal state of this controller instance */ | 640 | /* the internal state of this controller instance */ |
648 | int op_state; | 641 | int op_state; |
649 | /* work struct for this instance */ | 642 | /* work struct for this instance */ |
650 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) | ||
651 | struct delayed_work work; | 643 | struct delayed_work work; |
652 | #else | ||
653 | struct work_struct work; | ||
654 | #endif | ||
655 | 644 | ||
656 | /* pointer to edac polling checking routine: | 645 | /* pointer to edac polling checking routine: |
657 | * If NOT NULL: points to polling check routine | 646 | * If NOT NULL: points to polling check routine |
diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c index 4ce978b72d34..26807af2c5e7 100644 --- a/drivers/edac/edac_device.c +++ b/drivers/edac/edac_device.c | |||
@@ -332,17 +332,10 @@ EXPORT_SYMBOL(edac_device_find); | |||
332 | * edac_device_workq_function | 332 | * edac_device_workq_function |
333 | * performs the operation scheduled by a workq request | 333 | * performs the operation scheduled by a workq request |
334 | */ | 334 | */ |
335 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) | ||
336 | static void edac_device_workq_function(struct work_struct *work_req) | 335 | static void edac_device_workq_function(struct work_struct *work_req) |
337 | { | 336 | { |
338 | struct delayed_work *d_work = (struct delayed_work *)work_req; | 337 | struct delayed_work *d_work = (struct delayed_work *)work_req; |
339 | struct edac_device_ctl_info *edac_dev = to_edac_device_ctl_work(d_work); | 338 | struct edac_device_ctl_info *edac_dev = to_edac_device_ctl_work(d_work); |
340 | #else | ||
341 | static void edac_device_workq_function(void *ptr) | ||
342 | { | ||
343 | struct edac_device_ctl_info *edac_dev = | ||
344 | (struct edac_device_ctl_info *)ptr; | ||
345 | #endif | ||
346 | 339 | ||
347 | //debugf0("%s() here and running\n", __func__); | 340 | //debugf0("%s() here and running\n", __func__); |
348 | lock_device_list(); | 341 | lock_device_list(); |
@@ -372,11 +365,7 @@ void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev, | |||
372 | edac_dev->poll_msec = msec; | 365 | edac_dev->poll_msec = msec; |
373 | edac_calc_delay(edac_dev); /* Calc delay jiffies */ | 366 | edac_calc_delay(edac_dev); /* Calc delay jiffies */ |
374 | 367 | ||
375 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) | ||
376 | INIT_DELAYED_WORK(&edac_dev->work, edac_device_workq_function); | 368 | INIT_DELAYED_WORK(&edac_dev->work, edac_device_workq_function); |
377 | #else | ||
378 | INIT_WORK(&edac_dev->work, edac_device_workq_function, edac_dev); | ||
379 | #endif | ||
380 | queue_delayed_work(edac_workqueue, &edac_dev->work, edac_dev->delay); | 369 | queue_delayed_work(edac_workqueue, &edac_dev->work, edac_dev->delay); |
381 | } | 370 | } |
382 | 371 | ||
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 835319126bb6..ce12d9b5ab18 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c | |||
@@ -235,16 +235,10 @@ static int edac_mc_assert_error_check_and_clear(void) | |||
235 | * edac_mc_workq_function | 235 | * edac_mc_workq_function |
236 | * performs the operation scheduled by a workq request | 236 | * performs the operation scheduled by a workq request |
237 | */ | 237 | */ |
238 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) | ||
239 | static void edac_mc_workq_function(struct work_struct *work_req) | 238 | static void edac_mc_workq_function(struct work_struct *work_req) |
240 | { | 239 | { |
241 | struct delayed_work *d_work = (struct delayed_work *)work_req; | 240 | struct delayed_work *d_work = (struct delayed_work *)work_req; |
242 | struct mem_ctl_info *mci = to_edac_mem_ctl_work(d_work); | 241 | struct mem_ctl_info *mci = to_edac_mem_ctl_work(d_work); |
243 | #else | ||
244 | static void edac_mc_workq_function(void *ptr) | ||
245 | { | ||
246 | struct mem_ctl_info *mci = (struct mem_ctl_info *)ptr; | ||
247 | #endif | ||
248 | 242 | ||
249 | mutex_lock(&mem_ctls_mutex); | 243 | mutex_lock(&mem_ctls_mutex); |
250 | 244 | ||
@@ -274,11 +268,7 @@ void edac_mc_workq_setup(struct mem_ctl_info *mci, unsigned msec) | |||
274 | { | 268 | { |
275 | debugf0("%s()\n", __func__); | 269 | debugf0("%s()\n", __func__); |
276 | 270 | ||
277 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) | ||
278 | INIT_DELAYED_WORK(&mci->work, edac_mc_workq_function); | 271 | INIT_DELAYED_WORK(&mci->work, edac_mc_workq_function); |
279 | #else | ||
280 | INIT_WORK(&mci->work, edac_mc_workq_function, mci); | ||
281 | #endif | ||
282 | queue_delayed_work(edac_workqueue, &mci->work, msecs_to_jiffies(msec)); | 272 | queue_delayed_work(edac_workqueue, &mci->work, msecs_to_jiffies(msec)); |
283 | } | 273 | } |
284 | 274 | ||
diff --git a/drivers/edac/edac_pci.c b/drivers/edac/edac_pci.c index abefd96680d7..ac16b434a3c5 100644 --- a/drivers/edac/edac_pci.c +++ b/drivers/edac/edac_pci.c | |||
@@ -214,16 +214,10 @@ EXPORT_SYMBOL_GPL(edac_pci_find); | |||
214 | * edac_pci_workq_function() | 214 | * edac_pci_workq_function() |
215 | * performs the operation scheduled by a workq request | 215 | * performs the operation scheduled by a workq request |
216 | */ | 216 | */ |
217 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) | ||
218 | static void edac_pci_workq_function(struct work_struct *work_req) | 217 | static void edac_pci_workq_function(struct work_struct *work_req) |
219 | { | 218 | { |
220 | struct delayed_work *d_work = (struct delayed_work *)work_req; | 219 | struct delayed_work *d_work = (struct delayed_work *)work_req; |
221 | struct edac_pci_ctl_info *pci = to_edac_pci_ctl_work(d_work); | 220 | struct edac_pci_ctl_info *pci = to_edac_pci_ctl_work(d_work); |
222 | #else | ||
223 | static void edac_pci_workq_function(void *ptr) | ||
224 | { | ||
225 | struct edac_pci_ctl_info *pci = ptr; | ||
226 | #endif | ||
227 | 221 | ||
228 | edac_lock_pci_list(); | 222 | edac_lock_pci_list(); |
229 | 223 | ||
@@ -248,11 +242,7 @@ static void edac_pci_workq_setup(struct edac_pci_ctl_info *pci, | |||
248 | { | 242 | { |
249 | debugf0("%s()\n", __func__); | 243 | debugf0("%s()\n", __func__); |
250 | 244 | ||
251 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)) | ||
252 | INIT_DELAYED_WORK(&pci->work, edac_pci_workq_function); | 245 | INIT_DELAYED_WORK(&pci->work, edac_pci_workq_function); |
253 | #else | ||
254 | INIT_WORK(&pci->work, edac_pci_workq_function, pci); | ||
255 | #endif | ||
256 | queue_delayed_work(edac_workqueue, &pci->work, | 246 | queue_delayed_work(edac_workqueue, &pci->work, |
257 | msecs_to_jiffies(edac_pci_get_poll_msec())); | 247 | msecs_to_jiffies(edac_pci_get_poll_msec())); |
258 | } | 248 | } |