X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fs390%2Fchar%2Ftape_34xx.c;h=e765875e8db2eb4fb4ae3c0a4b6a03d8215bcaa4;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=d4f2da7380784850d354515a29434b16fe457b86;hpb=43bc926fffd92024b46cafaf7350d669ba9ca884;p=linux-2.6.git diff --git a/drivers/s390/char/tape_34xx.c b/drivers/s390/char/tape_34xx.c index d4f2da738..e765875e8 100644 --- a/drivers/s390/char/tape_34xx.c +++ b/drivers/s390/char/tape_34xx.c @@ -8,7 +8,6 @@ * Martin Schwidefsky */ -#include #include #include #include @@ -96,6 +95,12 @@ tape_34xx_medium_sense(struct tape_device *device) return rc; } +struct tape_34xx_work { + struct tape_device *device; + enum tape_op op; + struct work_struct work; +}; + /* * These functions are currently used only to schedule a medium_sense for * later execution. This is because we get an interrupt whenever a medium @@ -104,13 +109,10 @@ tape_34xx_medium_sense(struct tape_device *device) * interrupt handler. */ static void -tape_34xx_work_handler(void *data) +tape_34xx_work_handler(struct work_struct *work) { - struct { - struct tape_device *device; - enum tape_op op; - struct work_struct work; - } *p = data; + struct tape_34xx_work *p = + container_of(work, struct tape_34xx_work, work); switch(p->op) { case TO_MSEN: @@ -127,17 +129,13 @@ tape_34xx_work_handler(void *data) static int tape_34xx_schedule_work(struct tape_device *device, enum tape_op op) { - struct { - struct tape_device *device; - enum tape_op op; - struct work_struct work; - } *p; + struct tape_34xx_work *p; if ((p = kmalloc(sizeof(*p), GFP_ATOMIC)) == NULL) return -ENOMEM; memset(p, 0, sizeof(*p)); - INIT_WORK(&p->work, tape_34xx_work_handler, p); + INIT_WORK(&p->work, tape_34xx_work_handler); p->device = tape_get_device_reference(device); p->op = op; @@ -1310,9 +1308,9 @@ static struct tape_discipline tape_discipline_34xx = { }; static struct ccw_device_id tape_34xx_ids[] = { - { CCW_DEVICE_DEVTYPE(0x3480, 0, 0x3480, 0), driver_info: tape_3480}, - { CCW_DEVICE_DEVTYPE(0x3490, 0, 0x3490, 0), driver_info: tape_3490}, - { /* end of list */ } + { CCW_DEVICE_DEVTYPE(0x3480, 0, 0x3480, 0), .driver_info = tape_3480}, + { CCW_DEVICE_DEVTYPE(0x3490, 0, 0x3490, 0), .driver_info = tape_3490}, + { /* end of list */ }, }; static int