edac: use to_delayed_work()

The edac-core driver includes code which assumes that the work_struct
which is included in every delayed_work is the first member of that
structure. This is currently the case but might change in the future, so
use to_delayed_work() instead, which doesn't make such an assumption.

linux-2.6.30-rc1 has the to_delayed_work() function that will allow this
patch to work

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Doug Thompson <dougthompson@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Jean Delvare and committed by Linus Torvalds fbeb4384 e6da46b2

+3 -3
+1 -1
drivers/edac/edac_device.c
··· 389 389 */ 390 390 static void edac_device_workq_function(struct work_struct *work_req) 391 391 { 392 - struct delayed_work *d_work = (struct delayed_work *)work_req; 392 + struct delayed_work *d_work = to_delayed_work(work_req); 393 393 struct edac_device_ctl_info *edac_dev = to_edac_device_ctl_work(d_work); 394 394 395 395 mutex_lock(&device_ctls_mutex);
+1 -1
drivers/edac/edac_mc.c
··· 260 260 */ 261 261 static void edac_mc_workq_function(struct work_struct *work_req) 262 262 { 263 - struct delayed_work *d_work = (struct delayed_work *)work_req; 263 + struct delayed_work *d_work = to_delayed_work(work_req); 264 264 struct mem_ctl_info *mci = to_edac_mem_ctl_work(d_work); 265 265 266 266 mutex_lock(&mem_ctls_mutex);
+1 -1
drivers/edac/edac_pci.c
··· 233 233 */ 234 234 static void edac_pci_workq_function(struct work_struct *work_req) 235 235 { 236 - struct delayed_work *d_work = (struct delayed_work *)work_req; 236 + struct delayed_work *d_work = to_delayed_work(work_req); 237 237 struct edac_pci_ctl_info *pci = to_edac_pci_ctl_work(d_work); 238 238 int msec; 239 239 unsigned long delay;