Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 16 Jun 2009 19:57:37 +0000 (12:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 16 Jun 2009 19:57:37 +0000 (12:57 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (64 commits)
  debugfs: use specified mode to possibly mark files read/write only
  debugfs: Fix terminology inconsistency of dir name to mount debugfs filesystem.
  xen: remove driver_data direct access of struct device from more drivers
  usb: gadget: at91_udc: remove driver_data direct access of struct device
  uml: remove driver_data direct access of struct device
  block/ps3: remove driver_data direct access of struct device
  s390: remove driver_data direct access of struct device
  parport: remove driver_data direct access of struct device
  parisc: remove driver_data direct access of struct device
  of_serial: remove driver_data direct access of struct device
  mips: remove driver_data direct access of struct device
  ipmi: remove driver_data direct access of struct device
  infiniband: ehca: remove driver_data direct access of struct device
  ibmvscsi: gadget: at91_udc: remove driver_data direct access of struct device
  hvcs: remove driver_data direct access of struct device
  xen block: remove driver_data direct access of struct device
  thermal: remove driver_data direct access of struct device
  scsi: remove driver_data direct access of struct device
  pcmcia: remove driver_data direct access of struct device
  PCIE: remove driver_data direct access of struct device
  ...

Manually fix up trivial conflicts due to different direct driver_data
direct access fixups in drivers/block/{ps3disk.c,ps3vram.c}

1  2 
drivers/s390/char/con3215.c
drivers/s390/char/raw3270.c
drivers/s390/char/tape_34xx.c
drivers/s390/char/tape_3590.c
drivers/s390/char/tape_core.c
drivers/s390/char/vmlogrdr.c
drivers/s390/char/vmur.c
drivers/s390/net/claw.c
drivers/s390/net/lcs.c
drivers/s390/net/netiucv.c
include/linux/kernel.h

index b79f31add39cdcc6307a295d7bad69b9b493ddc5,c639361d808590698510375d07b3f157ba8823f5..04dc734805c61418353e2b68802a6621121c3317
@@@ -1,12 -1,14 +1,12 @@@
  /*
 - *  drivers/s390/char/con3215.c
 - *    3215 line mode terminal driver.
 + * 3215 line mode terminal driver.
   *
 - *  S390 version
 - *    Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
 - *    Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
 + * Copyright IBM Corp. 1999, 2009
 + * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
   *
 - *  Updated:
 - *   Aug-2000: Added tab support
 - *           Dan Morrison, IBM Corporation (dmorriso@cse.buffalo.edu)
 + * Updated:
 + *  Aug-2000: Added tab support
 + *          Dan Morrison, IBM Corporation <dmorriso@cse.buffalo.edu>
   */
  
  #include <linux/module.h>
@@@ -54,7 -56,6 +54,7 @@@
  #define RAW3215_CLOSING           32        /* set while in close process */
  #define RAW3215_TIMER_RUNS  64              /* set if the output delay timer is on */
  #define RAW3215_FLUSHING    128             /* set to flush buffer (no delay) */
 +#define RAW3215_FROZEN            256       /* set if 3215 is frozen for suspend */
  
  #define TAB_STOP_SIZE     8         /* tab stop size */
  
@@@ -110,8 -111,8 +110,8 @@@ static struct tty_driver *tty3215_drive
  /*
   * Get a request structure from the free list
   */
 -static inline struct raw3215_req *
 -raw3215_alloc_req(void) {
 +static inline struct raw3215_req *raw3215_alloc_req(void)
 +{
        struct raw3215_req *req;
        unsigned long flags;
  
  /*
   * Put a request structure back to the free list
   */
 -static inline void
 -raw3215_free_req(struct raw3215_req *req) {
 +static inline void raw3215_free_req(struct raw3215_req *req)
 +{
        unsigned long flags;
  
        if (req->type == RAW3215_FREE)
   * because a 3215 terminal won't accept a new read before the old one is
   * completed.
   */
 -static void
 -raw3215_mk_read_req(struct raw3215_info *raw)
 +static void raw3215_mk_read_req(struct raw3215_info *raw)
  {
        struct raw3215_req *req;
        struct ccw1 *ccw;
   * buffer to the 3215 device. If a queued write exists it is replaced by
   * the new, probably lengthened request.
   */
 -static void
 -raw3215_mk_write_req(struct raw3215_info *raw)
 +static void raw3215_mk_write_req(struct raw3215_info *raw)
  {
        struct raw3215_req *req;
        struct ccw1 *ccw;
  /*
   * Start a read or a write request
   */
 -static void
 -raw3215_start_io(struct raw3215_info *raw)
 +static void raw3215_start_io(struct raw3215_info *raw)
  {
        struct raw3215_req *req;
        int res;
  /*
   * Function to start a delayed output after RAW3215_TIMEOUT seconds
   */
 -static void
 -raw3215_timeout(unsigned long __data)
 +static void raw3215_timeout(unsigned long __data)
  {
        struct raw3215_info *raw = (struct raw3215_info *) __data;
        unsigned long flags;
        if (raw->flags & RAW3215_TIMER_RUNS) {
                del_timer(&raw->timer);
                raw->flags &= ~RAW3215_TIMER_RUNS;
 -              raw3215_mk_write_req(raw);
 -              raw3215_start_io(raw);
 +              if (!(raw->flags & RAW3215_FROZEN)) {
 +                      raw3215_mk_write_req(raw);
 +                      raw3215_start_io(raw);
 +              }
        }
        spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags);
  }
   * amount of data is bigger than RAW3215_MIN_WRITE. If a write is not
   * done immediately a timer is started with a delay of RAW3215_TIMEOUT.
   */
 -static inline void
 -raw3215_try_io(struct raw3215_info *raw)
 +static inline void raw3215_try_io(struct raw3215_info *raw)
  {
 -      if (!(raw->flags & RAW3215_ACTIVE))
 +      if (!(raw->flags & RAW3215_ACTIVE) || (raw->flags & RAW3215_FROZEN))
                return;
        if (raw->queued_read != NULL)
                raw3215_start_io(raw);
@@@ -355,8 -359,8 +355,8 @@@ static void raw3215_next_io(struct raw3
  /*
   * Interrupt routine, called from common io layer
   */
 -static void
 -raw3215_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb)
 +static void raw3215_irq(struct ccw_device *cdev, unsigned long intparm,
 +                      struct irb *irb)
  {
        struct raw3215_info *raw;
        struct raw3215_req *req;
        int cstat, dstat;
        int count;
  
-       raw = cdev->dev.driver_data;
+       raw = dev_get_drvdata(&cdev->dev);
        req = (struct raw3215_req *) intparm;
        cstat = irb->scsw.cmd.cstat;
        dstat = irb->scsw.cmd.dstat;
        return;
  }
  
 +/*
 + * Drop the oldest line from the output buffer.
 + */
 +static void raw3215_drop_line(struct raw3215_info *raw)
 +{
 +      int ix;
 +      char ch;
 +
 +      BUG_ON(raw->written != 0);
 +      ix = (raw->head - raw->count) & (RAW3215_BUFFER_SIZE - 1);
 +      while (raw->count > 0) {
 +              ch = raw->buffer[ix];
 +              ix = (ix + 1) & (RAW3215_BUFFER_SIZE - 1);
 +              raw->count--;
 +              if (ch == 0x15)
 +                      break;
 +      }
 +      raw->head = ix;
 +}
 +
  /*
   * Wait until length bytes are available int the output buffer.
   * Has to be called with the s390irq lock held. Can be called
   * disabled.
   */
 -static void
 -raw3215_make_room(struct raw3215_info *raw, unsigned int length)
 +static void raw3215_make_room(struct raw3215_info *raw, unsigned int length)
  {
        while (RAW3215_BUFFER_SIZE - raw->count < length) {
 +              /* While console is frozen for suspend we have no other
 +               * choice but to drop message from the buffer to make
 +               * room for even more messages. */
 +              if (raw->flags & RAW3215_FROZEN) {
 +                      raw3215_drop_line(raw);
 +                      continue;
 +              }
                /* there might be a request pending */
                raw->flags |= RAW3215_FLUSHING;
                raw3215_mk_write_req(raw);
  /*
   * String write routine for 3215 devices
   */
 -static void
 -raw3215_write(struct raw3215_info *raw, const char *str, unsigned int length)
 +static void raw3215_write(struct raw3215_info *raw, const char *str,
 +                        unsigned int length)
  {
        unsigned long flags;
        int c, count;
  /*
   * Put character routine for 3215 devices
   */
 -static void
 -raw3215_putchar(struct raw3215_info *raw, unsigned char ch)
 +static void raw3215_putchar(struct raw3215_info *raw, unsigned char ch)
  {
        unsigned long flags;
        unsigned int length, i;
   * Flush routine, it simply sets the flush flag and tries to start
   * pending IO.
   */
 -static void
 -raw3215_flush_buffer(struct raw3215_info *raw)
 +static void raw3215_flush_buffer(struct raw3215_info *raw)
  {
        unsigned long flags;
  
  /*
   * Fire up a 3215 device.
   */
 -static int
 -raw3215_startup(struct raw3215_info *raw)
 +static int raw3215_startup(struct raw3215_info *raw)
  {
        unsigned long flags;
  
  /*
   * Shutdown a 3215 device.
   */
 -static void
 -raw3215_shutdown(struct raw3215_info *raw)
 +static void raw3215_shutdown(struct raw3215_info *raw)
  {
        DECLARE_WAITQUEUE(wait, current);
        unsigned long flags;
        spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags);
  }
  
 -static int
 -raw3215_probe (struct ccw_device *cdev)
 +static int raw3215_probe (struct ccw_device *cdev)
  {
        struct raw3215_info *raw;
        int line;
  
        /* Console is special. */
-       if (raw3215[0] && (cdev->dev.driver_data == raw3215[0]))
+       if (raw3215[0] && (raw3215[0] == dev_get_drvdata(&cdev->dev)))
                return 0;
        raw = kmalloc(sizeof(struct raw3215_info) +
                      RAW3215_INBUF_SIZE, GFP_KERNEL|GFP_DMA);
        }
        init_waitqueue_head(&raw->empty_wait);
  
-       cdev->dev.driver_data = raw;
+       dev_set_drvdata(&cdev->dev, raw);
        cdev->handler = raw3215_irq;
  
        return 0;
  }
  
 -static void
 -raw3215_remove (struct ccw_device *cdev)
 +static void raw3215_remove (struct ccw_device *cdev)
  {
        struct raw3215_info *raw;
  
        ccw_device_set_offline(cdev);
-       raw = cdev->dev.driver_data;
+       raw = dev_get_drvdata(&cdev->dev);
        if (raw) {
-               cdev->dev.driver_data = NULL;
+               dev_set_drvdata(&cdev->dev, NULL);
                kfree(raw->buffer);
                kfree(raw);
        }
  }
  
 -static int
 -raw3215_set_online (struct ccw_device *cdev)
 +static int raw3215_set_online (struct ccw_device *cdev)
  {
        struct raw3215_info *raw;
  
-       raw = cdev->dev.driver_data;
+       raw = dev_get_drvdata(&cdev->dev);
        if (!raw)
                return -ENODEV;
  
        return raw3215_startup(raw);
  }
  
 -static int
 -raw3215_set_offline (struct ccw_device *cdev)
 +static int raw3215_set_offline (struct ccw_device *cdev)
  {
        struct raw3215_info *raw;
  
-       raw = cdev->dev.driver_data;
+       raw = dev_get_drvdata(&cdev->dev);
        if (!raw)
                return -ENODEV;
  
        return 0;
  }
  
 +static int raw3215_pm_stop(struct ccw_device *cdev)
 +{
 +      struct raw3215_info *raw;
 +      unsigned long flags;
 +
 +      /* Empty the output buffer, then prevent new I/O. */
 +      raw = cdev->dev.driver_data;
 +      spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags);
 +      raw3215_make_room(raw, RAW3215_BUFFER_SIZE);
 +      raw->flags |= RAW3215_FROZEN;
 +      spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags);
 +      return 0;
 +}
 +
 +static int raw3215_pm_start(struct ccw_device *cdev)
 +{
 +      struct raw3215_info *raw;
 +      unsigned long flags;
 +
 +      /* Allow I/O again and flush output buffer. */
 +      raw = cdev->dev.driver_data;
 +      spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags);
 +      raw->flags &= ~RAW3215_FROZEN;
 +      raw->flags |= RAW3215_FLUSHING;
 +      raw3215_try_io(raw);
 +      raw->flags &= ~RAW3215_FLUSHING;
 +      spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags);
 +      return 0;
 +}
 +
  static struct ccw_device_id raw3215_id[] = {
        { CCW_DEVICE(0x3215, 0) },
        { /* end of list */ },
@@@ -772,17 -728,14 +772,17 @@@ static struct ccw_driver raw3215_ccw_dr
        .remove         = &raw3215_remove,
        .set_online     = &raw3215_set_online,
        .set_offline    = &raw3215_set_offline,
 +      .freeze         = &raw3215_pm_stop,
 +      .thaw           = &raw3215_pm_start,
 +      .restore        = &raw3215_pm_start,
  };
  
  #ifdef CONFIG_TN3215_CONSOLE
  /*
   * Write a string to the 3215 console
   */
 -static void
 -con3215_write(struct console *co, const char *str, unsigned int count)
 +static void con3215_write(struct console *co, const char *str,
 +                        unsigned int count)
  {
        struct raw3215_info *raw;
        int i;
@@@ -815,17 -768,13 +815,17 @@@ static struct tty_driver *con3215_devic
   * panic() calls con3215_flush through a panic_notifier
   * before the system enters a disabled, endless loop.
   */
 -static void
 -con3215_flush(void)
 +static void con3215_flush(void)
  {
        struct raw3215_info *raw;
        unsigned long flags;
  
        raw = raw3215[0];  /* console 3215 is the first one */
 +      if (raw->flags & RAW3215_FROZEN)
 +              /* The console is still frozen for suspend. */
 +              if (ccw_device_force_console())
 +                      /* Forcing didn't work, no panic message .. */
 +                      return;
        spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags);
        raw3215_make_room(raw, RAW3215_BUFFER_SIZE);
        spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags);
@@@ -862,7 -811,8 +862,7 @@@ static struct console con3215 = 
   * 3215 console initialization code called from console_init().
   * NOTE: This is called before kmalloc is available.
   */
 -static int __init
 -con3215_init(void)
 +static int __init con3215_init(void)
  {
        struct ccw_device *cdev;
        struct raw3215_info *raw;
        raw->buffer = (char *) alloc_bootmem_low(RAW3215_BUFFER_SIZE);
        raw->inbuf = (char *) alloc_bootmem_low(RAW3215_INBUF_SIZE);
        raw->cdev = cdev;
-       cdev->dev.driver_data = raw;
+       dev_set_drvdata(&cdev->dev, raw);
        cdev->handler = raw3215_irq;
  
        raw->flags |= RAW3215_FIXED;
@@@ -925,7 -875,8 +925,7 @@@ console_initcall(con3215_init)
   *
   * This routine is called whenever a 3215 tty is opened.
   */
 -static int
 -tty3215_open(struct tty_struct *tty, struct file * filp)
 +static int tty3215_open(struct tty_struct *tty, struct file * filp)
  {
        struct raw3215_info *raw;
        int retval, line;
   * This routine is called when the 3215 tty is closed. We wait
   * for the remaining request to be completed. Then we clean up.
   */
 -static void
 -tty3215_close(struct tty_struct *tty, struct file * filp)
 +static void tty3215_close(struct tty_struct *tty, struct file * filp)
  {
        struct raw3215_info *raw;
  
  /*
   * Returns the amount of free space in the output buffer.
   */
 -static int
 -tty3215_write_room(struct tty_struct *tty)
 +static int tty3215_write_room(struct tty_struct *tty)
  {
        struct raw3215_info *raw;
  
  /*
   * String write routine for 3215 ttys
   */
 -static int
 -tty3215_write(struct tty_struct * tty,
 -            const unsigned char *buf, int count)
 +static int tty3215_write(struct tty_struct * tty,
 +                       const unsigned char *buf, int count)
  {
        struct raw3215_info *raw;
  
  /*
   * Put character routine for 3215 ttys
   */
 -static int
 -tty3215_put_char(struct tty_struct *tty, unsigned char ch)
 +static int tty3215_put_char(struct tty_struct *tty, unsigned char ch)
  {
        struct raw3215_info *raw;
  
        return 1;
  }
  
 -static void
 -tty3215_flush_chars(struct tty_struct *tty)
 +static void tty3215_flush_chars(struct tty_struct *tty)
  {
  }
  
  /*
   * Returns the number of characters in the output buffer
   */
 -static int
 -tty3215_chars_in_buffer(struct tty_struct *tty)
 +static int tty3215_chars_in_buffer(struct tty_struct *tty)
  {
        struct raw3215_info *raw;
  
        return raw->count;
  }
  
 -static void
 -tty3215_flush_buffer(struct tty_struct *tty)
 +static void tty3215_flush_buffer(struct tty_struct *tty)
  {
        struct raw3215_info *raw;
  
  /*
   * Currently we don't have any io controls for 3215 ttys
   */
 -static int
 -tty3215_ioctl(struct tty_struct *tty, struct file * file,
 -            unsigned int cmd, unsigned long arg)
 +static int tty3215_ioctl(struct tty_struct *tty, struct file * file,
 +                       unsigned int cmd, unsigned long arg)
  {
        if (tty->flags & (1 << TTY_IO_ERROR))
                return -EIO;
  /*
   * Disable reading from a 3215 tty
   */
 -static void
 -tty3215_throttle(struct tty_struct * tty)
 +static void tty3215_throttle(struct tty_struct * tty)
  {
        struct raw3215_info *raw;
  
  /*
   * Enable reading from a 3215 tty
   */
 -static void
 -tty3215_unthrottle(struct tty_struct * tty)
 +static void tty3215_unthrottle(struct tty_struct * tty)
  {
        struct raw3215_info *raw;
        unsigned long flags;
  /*
   * Disable writing to a 3215 tty
   */
 -static void
 -tty3215_stop(struct tty_struct *tty)
 +static void tty3215_stop(struct tty_struct *tty)
  {
        struct raw3215_info *raw;
  
  /*
   * Enable writing to a 3215 tty
   */
 -static void
 -tty3215_start(struct tty_struct *tty)
 +static void tty3215_start(struct tty_struct *tty)
  {
        struct raw3215_info *raw;
        unsigned long flags;
@@@ -1133,7 -1096,8 +1133,7 @@@ static const struct tty_operations tty3
   * 3215 tty registration code called from tty_init().
   * Most kernel services (incl. kmalloc) are available at this poimt.
   */
 -static int __init
 -tty3215_init(void)
 +static int __init tty3215_init(void)
  {
        struct tty_driver *driver;
        int ret;
        return 0;
  }
  
 -static void __exit
 -tty3215_exit(void)
 +static void __exit tty3215_exit(void)
  {
        tty_unregister_driver(tty3215_driver);
        put_tty_driver(tty3215_driver);
index 81c151b5f0ac5b9543a55f2df00aae844a3684f6,1ab69df2684c5b7e7a1f60478528e65937109bd7..acab7b2dfe8ab2a23174487dda6658a1c7d2ac5d
@@@ -1,10 -1,11 +1,10 @@@
  /*
 - *  drivers/s390/char/raw3270.c
 - *    IBM/3270 Driver - core functions.
 + * IBM/3270 Driver - core functions.
   *
 - *  Author(s):
 - *    Original 3270 Code for 2.4 written by Richard Hitt (UTS Global)
 - *    Rewritten for 2.5 by Martin Schwidefsky <schwidefsky@de.ibm.com>
 - *    -- Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
 + * Author(s):
 + *   Original 3270 Code for 2.4 written by Richard Hitt (UTS Global)
 + *   Rewritten for 2.5 by Martin Schwidefsky <schwidefsky@de.ibm.com>
 + *     Copyright IBM Corp. 2003, 2009
   */
  
  #include <linux/bootmem.h>
@@@ -60,7 -61,6 +60,7 @@@ struct raw3270 
  #define RAW3270_FLAGS_ATTN    2       /* Device sent an ATTN interrupt */
  #define RAW3270_FLAGS_READY   4       /* Device is useable by views */
  #define RAW3270_FLAGS_CONSOLE 8       /* Device is the console. */
 +#define RAW3270_FLAGS_FROZEN  16      /* set if 3270 is frozen for suspend */
  
  /* Semaphore to protect global data of raw3270 (devices, views, etc). */
  static DEFINE_MUTEX(raw3270_mutex);
@@@ -306,8 -306,7 +306,8 @@@ raw3270_start(struct raw3270_view *view
  
        spin_lock_irqsave(get_ccwdev_lock(view->dev->cdev), flags);
        rp = view->dev;
 -      if (!rp || rp->view != view)
 +      if (!rp || rp->view != view ||
 +          test_bit(RAW3270_FLAGS_FROZEN, &rp->flags))
                rc = -EACCES;
        else if (!test_bit(RAW3270_FLAGS_READY, &rp->flags))
                rc = -ENODEV;
@@@ -324,8 -323,7 +324,8 @@@ raw3270_start_locked(struct raw3270_vie
        int rc;
  
        rp = view->dev;
 -      if (!rp || rp->view != view)
 +      if (!rp || rp->view != view ||
 +          test_bit(RAW3270_FLAGS_FROZEN, &rp->flags))
                rc = -EACCES;
        else if (!test_bit(RAW3270_FLAGS_READY, &rp->flags))
                rc = -ENODEV;
@@@ -357,7 -355,7 +357,7 @@@ raw3270_irq (struct ccw_device *cdev, u
        struct raw3270_request *rq;
        int rc;
  
-       rp = (struct raw3270 *) cdev->dev.driver_data;
+       rp = dev_get_drvdata(&cdev->dev);
        if (!rp)
                return;
        rq = (struct raw3270_request *) intparm;
@@@ -766,8 -764,7 +766,8 @@@ raw3270_reset(struct raw3270_view *view
        int rc;
  
        rp = view->dev;
 -      if (!rp || rp->view != view)
 +      if (!rp || rp->view != view ||
 +          test_bit(RAW3270_FLAGS_FROZEN, &rp->flags))
                rc = -EACCES;
        else if (!test_bit(RAW3270_FLAGS_READY, &rp->flags))
                rc = -ENODEV;
@@@ -831,7 -828,7 +831,7 @@@ raw3270_setup_device(struct ccw_device 
        if (rp->minor == -1)
                return -EUSERS;
        rp->cdev = cdev;
-       cdev->dev.driver_data = rp;
+       dev_set_drvdata(&cdev->dev, rp);
        cdev->handler = raw3270_irq;
        return 0;
  }
@@@ -925,8 -922,6 +925,8 @@@ raw3270_activate_view(struct raw3270_vi
                rc = 0;
        else if (!test_bit(RAW3270_FLAGS_READY, &rp->flags))
                rc = -ENODEV;
 +      else if (test_bit(RAW3270_FLAGS_FROZEN, &rp->flags))
 +              rc = -EACCES;
        else {
                oldview = NULL;
                if (rp->view) {
@@@ -974,8 -969,7 +974,8 @@@ raw3270_deactivate_view(struct raw3270_
                list_del_init(&view->list);
                list_add_tail(&view->list, &rp->view_list);
                /* Try to activate another view. */
 -              if (test_bit(RAW3270_FLAGS_READY, &rp->flags)) {
 +              if (test_bit(RAW3270_FLAGS_READY, &rp->flags) &&
 +                  !test_bit(RAW3270_FLAGS_FROZEN, &rp->flags)) {
                        list_for_each_entry(view, &rp->view_list, list) {
                                rp->view = view;
                                if (view->fn->activate(view) == 0)
@@@ -1074,8 -1068,7 +1074,8 @@@ raw3270_del_view(struct raw3270_view *v
                rp->view = NULL;
        }
        list_del_init(&view->list);
 -      if (!rp->view && test_bit(RAW3270_FLAGS_READY, &rp->flags)) {
 +      if (!rp->view && test_bit(RAW3270_FLAGS_READY, &rp->flags) &&
 +          !test_bit(RAW3270_FLAGS_FROZEN, &rp->flags)) {
                /* Try to activate another view. */
                list_for_each_entry(nv, &rp->view_list, list) {
                        if (nv->fn->activate(nv) == 0) {
@@@ -1112,7 -1105,7 +1112,7 @@@ raw3270_delete_device(struct raw3270 *r
        /* Disconnect from ccw_device. */
        cdev = rp->cdev;
        rp->cdev = NULL;
-       cdev->dev.driver_data = NULL;
+       dev_set_drvdata(&cdev->dev, NULL);
        cdev->handler = NULL;
  
        /* Put ccw_device structure. */
@@@ -1136,7 -1129,7 +1136,7 @@@ static ssize_
  raw3270_model_show(struct device *dev, struct device_attribute *attr, char *buf)
  {
        return snprintf(buf, PAGE_SIZE, "%i\n",
-                       ((struct raw3270 *) dev->driver_data)->model);
+                       ((struct raw3270 *) dev_get_drvdata(dev))->model);
  }
  static DEVICE_ATTR(model, 0444, raw3270_model_show, NULL);
  
@@@ -1144,7 -1137,7 +1144,7 @@@ static ssize_
  raw3270_rows_show(struct device *dev, struct device_attribute *attr, char *buf)
  {
        return snprintf(buf, PAGE_SIZE, "%i\n",
-                       ((struct raw3270 *) dev->driver_data)->rows);
+                       ((struct raw3270 *) dev_get_drvdata(dev))->rows);
  }
  static DEVICE_ATTR(rows, 0444, raw3270_rows_show, NULL);
  
@@@ -1152,7 -1145,7 +1152,7 @@@ static ssize_
  raw3270_columns_show(struct device *dev, struct device_attribute *attr, char *buf)
  {
        return snprintf(buf, PAGE_SIZE, "%i\n",
-                       ((struct raw3270 *) dev->driver_data)->cols);
+                       ((struct raw3270 *) dev_get_drvdata(dev))->cols);
  }
  static DEVICE_ATTR(columns, 0444, raw3270_columns_show, NULL);
  
@@@ -1289,7 -1282,7 +1289,7 @@@ raw3270_remove (struct ccw_device *cdev
        struct raw3270_view *v;
        struct raw3270_notifier *np;
  
-       rp = cdev->dev.driver_data;
+       rp = dev_get_drvdata(&cdev->dev);
        /*
         * _remove is the opposite of _probe; it's probe that
         * should set up rp.  raw3270_remove gets entered for
@@@ -1337,65 -1330,13 +1337,65 @@@ raw3270_set_offline (struct ccw_device 
  {
        struct raw3270 *rp;
  
-       rp = cdev->dev.driver_data;
+       rp = dev_get_drvdata(&cdev->dev);
        if (test_bit(RAW3270_FLAGS_CONSOLE, &rp->flags))
                return -EBUSY;
        raw3270_remove(cdev);
        return 0;
  }
  
 +static int raw3270_pm_stop(struct ccw_device *cdev)
 +{
 +      struct raw3270 *rp;
 +      struct raw3270_view *view;
 +      unsigned long flags;
 +
 +      rp = cdev->dev.driver_data;
 +      if (!rp)
 +              return 0;
 +      spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
 +      if (rp->view)
 +              rp->view->fn->deactivate(rp->view);
 +      if (!test_bit(RAW3270_FLAGS_CONSOLE, &rp->flags)) {
 +              /*
 +               * Release tty and fullscreen for all non-console
 +               * devices.
 +               */
 +              list_for_each_entry(view, &rp->view_list, list) {
 +                      if (view->fn->release)
 +                              view->fn->release(view);
 +              }
 +      }
 +      set_bit(RAW3270_FLAGS_FROZEN, &rp->flags);
 +      spin_unlock_irqrestore(get_ccwdev_lock(rp->cdev), flags);
 +      return 0;
 +}
 +
 +static int raw3270_pm_start(struct ccw_device *cdev)
 +{
 +      struct raw3270 *rp;
 +      unsigned long flags;
 +
 +      rp = cdev->dev.driver_data;
 +      if (!rp)
 +              return 0;
 +      spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
 +      clear_bit(RAW3270_FLAGS_FROZEN, &rp->flags);
 +      if (rp->view)
 +              rp->view->fn->activate(rp->view);
 +      spin_unlock_irqrestore(get_ccwdev_lock(rp->cdev), flags);
 +      return 0;
 +}
 +
 +void raw3270_pm_unfreeze(struct raw3270_view *view)
 +{
 +      struct raw3270 *rp;
 +
 +      rp = view->dev;
 +      if (rp && test_bit(RAW3270_FLAGS_FROZEN, &rp->flags))
 +              ccw_device_force_console();
 +}
 +
  static struct ccw_device_id raw3270_id[] = {
        { CCW_DEVICE(0x3270, 0) },
        { CCW_DEVICE(0x3271, 0) },
@@@ -1419,9 -1360,6 +1419,9 @@@ static struct ccw_driver raw3270_ccw_dr
        .remove         = &raw3270_remove,
        .set_online     = &raw3270_set_online,
        .set_offline    = &raw3270_set_offline,
 +      .freeze         = &raw3270_pm_stop,
 +      .thaw           = &raw3270_pm_start,
 +      .restore        = &raw3270_pm_start,
  };
  
  static int
index 144d2a5e1a92f78ce91791d2f3fa8a161ce281e8,997ed58075890b6c69e622e2313dc3e3afe1328e..5a519fac37b7187505499ff33e95103da31a9e9a
@@@ -2,7 -2,7 +2,7 @@@
   *  drivers/s390/char/tape_34xx.c
   *    tape device discipline for 3480/3490 tapes.
   *
 - *    Copyright (C) IBM Corp. 2001,2006
 + *    Copyright IBM Corp. 2001, 2009
   *    Author(s): Carsten Otte <cotte@de.ibm.com>
   *             Tuan Ngo-Anh <ngoanh@de.ibm.com>
   *             Martin Schwidefsky <schwidefsky@de.ibm.com>
@@@ -1289,7 -1289,7 +1289,7 @@@ static in
  tape_34xx_online(struct ccw_device *cdev)
  {
        return tape_generic_online(
-               cdev->dev.driver_data,
+               dev_get_drvdata(&cdev->dev),
                &tape_discipline_34xx
        );
  }
@@@ -1302,7 -1302,6 +1302,7 @@@ static struct ccw_driver tape_34xx_driv
        .remove = tape_generic_remove,
        .set_online = tape_34xx_online,
        .set_offline = tape_generic_offline,
 +      .freeze = tape_generic_pm_suspend,
  };
  
  static int
index 23e6598bc4b5f01bd0137e1e50aecd37d9f2e784,5de27c9e4af10b6810a8094f16c68354fc6af50b..418f72dd39b4d4836457edd8e87a9b6b25808566
@@@ -2,7 -2,7 +2,7 @@@
   *  drivers/s390/char/tape_3590.c
   *    tape device discipline for 3590 tapes.
   *
 - *    Copyright IBM Corp. 2001,2006
 + *    Copyright IBM Corp. 2001, 2009
   *    Author(s): Stefan Bader <shbader@de.ibm.com>
   *             Michael Holzheu <holzheu@de.ibm.com>
   *             Martin Schwidefsky <schwidefsky@de.ibm.com>
@@@ -1703,7 -1703,7 +1703,7 @@@ static struct ccw_device_id tape_3590_i
  static int
  tape_3590_online(struct ccw_device *cdev)
  {
-       return tape_generic_online(cdev->dev.driver_data,
+       return tape_generic_online(dev_get_drvdata(&cdev->dev),
                                   &tape_discipline_3590);
  }
  
@@@ -1715,7 -1715,6 +1715,7 @@@ static struct ccw_driver tape_3590_driv
        .remove = tape_generic_remove,
        .set_offline = tape_generic_offline,
        .set_online = tape_3590_online,
 +      .freeze = tape_generic_pm_suspend,
  };
  
  /*
index 3ebaa8eb5c862a284aa740d2de7df361b27f39d0,dfeb0d445fd75590fa987e06c8c2aa0b3349459c..595aa04cfd019699e09cd03b99e9774c7f99a100
@@@ -3,7 -3,7 +3,7 @@@
   *    basic function of the tape device driver
   *
   *  S390 and zSeries version
 - *    Copyright IBM Corp. 2001,2006
 + *    Copyright IBM Corp. 2001, 2009
   *    Author(s): Carsten Otte <cotte@de.ibm.com>
   *             Michael Holzheu <holzheu@de.ibm.com>
   *             Tuan Ngo-Anh <ngoanh@de.ibm.com>
@@@ -92,7 -92,7 +92,7 @@@ tape_medium_state_show(struct device *d
  {
        struct tape_device *tdev;
  
-       tdev = (struct tape_device *) dev->driver_data;
+       tdev = dev_get_drvdata(dev);
        return scnprintf(buf, PAGE_SIZE, "%i\n", tdev->medium_state);
  }
  
@@@ -104,7 -104,7 +104,7 @@@ tape_first_minor_show(struct device *de
  {
        struct tape_device *tdev;
  
-       tdev = (struct tape_device *) dev->driver_data;
+       tdev = dev_get_drvdata(dev);
        return scnprintf(buf, PAGE_SIZE, "%i\n", tdev->first_minor);
  }
  
@@@ -116,7 -116,7 +116,7 @@@ tape_state_show(struct device *dev, str
  {
        struct tape_device *tdev;
  
-       tdev = (struct tape_device *) dev->driver_data;
+       tdev = dev_get_drvdata(dev);
        return scnprintf(buf, PAGE_SIZE, "%s\n", (tdev->first_minor < 0) ?
                "OFFLINE" : tape_state_verbose[tdev->tape_state]);
  }
@@@ -130,7 -130,7 +130,7 @@@ tape_operation_show(struct device *dev
        struct tape_device *tdev;
        ssize_t rc;
  
-       tdev = (struct tape_device *) dev->driver_data;
+       tdev = dev_get_drvdata(dev);
        if (tdev->first_minor < 0)
                return scnprintf(buf, PAGE_SIZE, "N/A\n");
  
@@@ -156,7 -156,7 +156,7 @@@ tape_blocksize_show(struct device *dev
  {
        struct tape_device *tdev;
  
-       tdev = (struct tape_device *) dev->driver_data;
+       tdev = dev_get_drvdata(dev);
  
        return scnprintf(buf, PAGE_SIZE, "%i\n", tdev->char_data.block_size);
  }
@@@ -379,55 -379,6 +379,55 @@@ tape_cleanup_device(struct tape_device 
        tape_med_state_set(device, MS_UNKNOWN);
  }
  
 +/*
 + * Suspend device.
 + *
 + * Called by the common I/O layer if the drive should be suspended on user
 + * request. We refuse to suspend if the device is loaded or in use for the
 + * following reason:
 + * While the Linux guest is suspended, it might be logged off which causes
 + * devices to be detached. Tape devices are automatically rewound and unloaded
 + * during DETACH processing (unless the tape device was attached with the
 + * NOASSIGN or MULTIUSER option). After rewind/unload, there is no way to
 + * resume the original state of the tape device, since we would need to
 + * manually re-load the cartridge which was active at suspend time.
 + */
 +int tape_generic_pm_suspend(struct ccw_device *cdev)
 +{
 +      struct tape_device *device;
 +
 +      device = cdev->dev.driver_data;
 +      if (!device) {
 +              return -ENODEV;
 +      }
 +
 +      DBF_LH(3, "(%08x): tape_generic_pm_suspend(%p)\n",
 +              device->cdev_id, device);
 +
 +      if (device->medium_state != MS_UNLOADED) {
 +              pr_err("A cartridge is loaded in tape device %s, "
 +                     "refusing to suspend\n", dev_name(&cdev->dev));
 +              return -EBUSY;
 +      }
 +
 +      spin_lock_irq(get_ccwdev_lock(device->cdev));
 +      switch (device->tape_state) {
 +              case TS_INIT:
 +              case TS_NOT_OPER:
 +              case TS_UNUSED:
 +                      spin_unlock_irq(get_ccwdev_lock(device->cdev));
 +                      break;
 +              default:
 +                      pr_err("Tape device %s is busy, refusing to "
 +                             "suspend\n", dev_name(&cdev->dev));
 +                      spin_unlock_irq(get_ccwdev_lock(device->cdev));
 +                      return -EBUSY;
 +      }
 +
 +      DBF_LH(3, "(%08x): Drive suspended.\n", device->cdev_id);
 +      return 0;
 +}
 +
  /*
   * Set device offline.
   *
@@@ -440,7 -391,7 +440,7 @@@ tape_generic_offline(struct ccw_device 
  {
        struct tape_device *device;
  
-       device = cdev->dev.driver_data;
+       device = dev_get_drvdata(&cdev->dev);
        if (!device) {
                return -ENODEV;
        }
@@@ -583,7 -534,7 +583,7 @@@ tape_generic_probe(struct ccw_device *c
                tape_put_device(device);
                return ret;
        }
-       cdev->dev.driver_data = device;
+       dev_set_drvdata(&cdev->dev, device);
        cdev->handler = __tape_do_irq;
        device->cdev = cdev;
        ccw_device_get_id(cdev, &dev_id);
@@@ -622,7 -573,7 +622,7 @@@ tape_generic_remove(struct ccw_device *
  {
        struct tape_device *    device;
  
-       device = cdev->dev.driver_data;
+       device = dev_get_drvdata(&cdev->dev);
        if (!device) {
                return;
        }
                        tape_cleanup_device(device);
        }
  
-       if (cdev->dev.driver_data != NULL) {
+       if (!dev_get_drvdata(&cdev->dev)) {
                sysfs_remove_group(&cdev->dev.kobj, &tape_attr_group);
-               cdev->dev.driver_data = tape_put_device(cdev->dev.driver_data);
+               dev_set_drvdata(&cdev->dev, tape_put_device(dev_get_drvdata(&cdev->dev)));
        }
  }
  
@@@ -1060,7 -1011,7 +1060,7 @@@ __tape_do_irq (struct ccw_device *cdev
        struct tape_request *request;
        int rc;
  
-       device = (struct tape_device *) cdev->dev.driver_data;
+       device = dev_get_drvdata(&cdev->dev);
        if (device == NULL) {
                return;
        }
@@@ -1322,7 -1273,6 +1322,7 @@@ EXPORT_SYMBOL(tape_generic_remove)
  EXPORT_SYMBOL(tape_generic_probe);
  EXPORT_SYMBOL(tape_generic_online);
  EXPORT_SYMBOL(tape_generic_offline);
 +EXPORT_SYMBOL(tape_generic_pm_suspend);
  EXPORT_SYMBOL(tape_put_device);
  EXPORT_SYMBOL(tape_get_device_reference);
  EXPORT_SYMBOL(tape_state_verbose);
index e925808c2149c9d45c9b2e64ede5de5b79798e4c,ee1b418b0d8a016654cf0077b79ed13427ae73f4..411cfa3c77196261c126b79356563505b8bb901e
@@@ -3,7 -3,7 +3,7 @@@
   *    character device driver for reading z/VM system service records
   *
   *
 - *    Copyright 2004 IBM Corporation
 + *    Copyright IBM Corp. 2004, 2009
   *    character device driver for reading z/VM system service records,
   *    Version 1.0
   *    Author(s): Xenia Tkatschow <xenia@us.ibm.com>
@@@ -504,7 -504,7 +504,7 @@@ static ssize_t vmlogrdr_autopurge_store
                                        struct device_attribute *attr,
                                        const char * buf, size_t count)
  {
-       struct vmlogrdr_priv_t *priv = dev->driver_data;
+       struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev);
        ssize_t ret = count;
  
        switch (buf[0]) {
@@@ -525,7 -525,7 +525,7 @@@ static ssize_t vmlogrdr_autopurge_show(
                                       struct device_attribute *attr,
                                       char *buf)
  {
-       struct vmlogrdr_priv_t *priv = dev->driver_data;
+       struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev);
        return sprintf(buf, "%u\n", priv->autopurge);
  }
  
@@@ -541,7 -541,7 +541,7 @@@ static ssize_t vmlogrdr_purge_store(str
  
        char cp_command[80];
        char cp_response[80];
-       struct vmlogrdr_priv_t *priv = dev->driver_data;
+       struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev);
  
        if (buf[0] != '1')
                return -EINVAL;
@@@ -578,7 -578,7 +578,7 @@@ static ssize_t vmlogrdr_autorecording_s
                                            struct device_attribute *attr,
                                            const char *buf, size_t count)
  {
-       struct vmlogrdr_priv_t *priv = dev->driver_data;
+       struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev);
        ssize_t ret = count;
  
        switch (buf[0]) {
@@@ -599,7 -599,7 +599,7 @@@ static ssize_t vmlogrdr_autorecording_s
                                           struct device_attribute *attr,
                                           char *buf)
  {
-       struct vmlogrdr_priv_t *priv = dev->driver_data;
+       struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev);
        return sprintf(buf, "%u\n", priv->autorecording);
  }
  
@@@ -612,7 -612,7 +612,7 @@@ static ssize_t vmlogrdr_recording_store
                                        struct device_attribute *attr,
                                        const char * buf, size_t count)
  {
-       struct vmlogrdr_priv_t *priv = dev->driver_data;
+       struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev);
        ssize_t ret;
  
        switch (buf[0]) {
@@@ -660,29 -660,6 +660,29 @@@ static struct attribute *vmlogrdr_attrs
        NULL,
  };
  
 +static int vmlogrdr_pm_prepare(struct device *dev)
 +{
 +      int rc;
 +      struct vmlogrdr_priv_t *priv = dev->driver_data;
 +
 +      rc = 0;
 +      if (priv) {
 +              spin_lock_bh(&priv->priv_lock);
 +              if (priv->dev_in_use)
 +                      rc = -EBUSY;
 +              spin_unlock_bh(&priv->priv_lock);
 +      }
 +      if (rc)
 +              pr_err("vmlogrdr: device %s is busy. Refuse to suspend.\n",
 +                     dev_name(dev));
 +      return rc;
 +}
 +
 +
 +static struct dev_pm_ops vmlogrdr_pm_ops = {
 +      .prepare = vmlogrdr_pm_prepare,
 +};
 +
  static struct attribute_group vmlogrdr_attr_group = {
        .attrs = vmlogrdr_attrs,
  };
@@@ -691,7 -668,6 +691,7 @@@ static struct class *vmlogrdr_class
  static struct device_driver vmlogrdr_driver = {
        .name = "vmlogrdr",
        .bus  = &iucv_bus,
 +      .pm = &vmlogrdr_pm_ops,
  };
  
  
@@@ -753,7 -729,6 +753,7 @@@ static int vmlogrdr_register_device(str
                dev->bus = &iucv_bus;
                dev->parent = iucv_root;
                dev->driver = &vmlogrdr_driver;
 +              dev->driver_data = priv;
                /*
                 * The release function could be called after the
                 * module has been unloaded. It's _only_ task is to
diff --combined drivers/s390/char/vmur.c
index 92458219a9e9a893592242df1c73e2a314131220,6492b2015dd46fcfac2a49ee78ffcbe0d7d7102b..7d9e67cb64714494043bf62449632a27780fa0be
@@@ -2,7 -2,7 +2,7 @@@
   * Linux driver for System z and s390 unit record devices
   * (z/VM virtual punch, reader, printer)
   *
 - * Copyright IBM Corp. 2001, 2007
 + * Copyright IBM Corp. 2001, 2009
   * Authors: Malcolm Beattie <beattiem@uk.ibm.com>
   *        Michael Holzheu <holzheu@de.ibm.com>
   *        Frank Munzert <munzert@de.ibm.com>
@@@ -60,7 -60,6 +60,7 @@@ static int ur_probe(struct ccw_device *
  static void ur_remove(struct ccw_device *cdev);
  static int ur_set_online(struct ccw_device *cdev);
  static int ur_set_offline(struct ccw_device *cdev);
 +static int ur_pm_suspend(struct ccw_device *cdev);
  
  static struct ccw_driver ur_driver = {
        .name           = "vmur",
@@@ -70,7 -69,6 +70,7 @@@
        .remove         = ur_remove,
        .set_online     = ur_set_online,
        .set_offline    = ur_set_offline,
 +      .freeze         = ur_pm_suspend,
  };
  
  static DEFINE_MUTEX(vmur_mutex);
   *
   * Each ur device (urd) contains a reference to its corresponding ccw device
   * (cdev) using the urd->cdev pointer. Each ccw device has a reference to the
-  * ur device using the cdev->dev.driver_data pointer.
+  * ur device using dev_get_drvdata(&cdev->dev) pointer.
   *
   * urd references:
   * - ur_probe gets a urd reference, ur_remove drops the reference
-  *   (cdev->dev.driver_data)
+  *   dev_get_drvdata(&cdev->dev)
   * - ur_open gets a urd reference, ur_relase drops the reference
   *   (urf->urd)
   *
@@@ -92,7 -90,7 +92,7 @@@
   * - urdev_alloc get a cdev reference (urd->cdev)
   * - urdev_free drops the cdev reference (urd->cdev)
   *
-  * Setting and clearing of cdev->dev.driver_data is protected by the ccwdev lock
+  * Setting and clearing of dev_get_drvdata(&cdev->dev) is protected by the ccwdev lock
   */
  static struct urdev *urdev_alloc(struct ccw_device *cdev)
  {
@@@ -131,7 -129,7 +131,7 @@@ static struct urdev *urdev_get_from_cde
        unsigned long flags;
  
        spin_lock_irqsave(get_ccwdev_lock(cdev), flags);
-       urd = cdev->dev.driver_data;
+       urd = dev_get_drvdata(&cdev->dev);
        if (urd)
                urdev_get(urd);
        spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags);
@@@ -159,28 -157,6 +159,28 @@@ static void urdev_put(struct urdev *urd
                urdev_free(urd);
  }
  
 +/*
 + * State and contents of ur devices can be changed by class D users issuing
 + * CP commands such as PURGE or TRANSFER, while the Linux guest is suspended.
 + * Also the Linux guest might be logged off, which causes all active spool
 + * files to be closed.
 + * So we cannot guarantee that spool files are still the same when the Linux
 + * guest is resumed. In order to avoid unpredictable results at resume time
 + * we simply refuse to suspend if a ur device node is open.
 + */
 +static int ur_pm_suspend(struct ccw_device *cdev)
 +{
 +      struct urdev *urd = cdev->dev.driver_data;
 +
 +      TRACE("ur_pm_suspend: cdev=%p\n", cdev);
 +      if (urd->open_flag) {
 +              pr_err("Unit record device %s is busy, %s refusing to "
 +                     "suspend.\n", dev_name(&cdev->dev), ur_banner);
 +              return -EBUSY;
 +      }
 +      return 0;
 +}
 +
  /*
   * Low-level functions to do I/O to a ur device.
   *     alloc_chan_prog
@@@ -310,7 -286,7 +310,7 @@@ static void ur_int_handler(struct ccw_d
                TRACE("ur_int_handler: unsolicited interrupt\n");
                return;
        }
-       urd = cdev->dev.driver_data;
+       urd = dev_get_drvdata(&cdev->dev);
        BUG_ON(!urd);
        /* On special conditions irb is an error pointer */
        if (IS_ERR(irb))
@@@ -856,7 -832,7 +856,7 @@@ static int ur_probe(struct ccw_device *
                goto fail_remove_attr;
        }
        spin_lock_irq(get_ccwdev_lock(cdev));
-       cdev->dev.driver_data = urd;
+       dev_set_drvdata(&cdev->dev, urd);
        spin_unlock_irq(get_ccwdev_lock(cdev));
  
        mutex_unlock(&vmur_mutex);
@@@ -996,8 -972,8 +996,8 @@@ static void ur_remove(struct ccw_devic
        ur_remove_attributes(&cdev->dev);
  
        spin_lock_irqsave(get_ccwdev_lock(cdev), flags);
-       urdev_put(cdev->dev.driver_data);
-       cdev->dev.driver_data = NULL;
+       urdev_put(dev_get_drvdata(&cdev->dev));
+       dev_set_drvdata(&cdev->dev, NULL);
        spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags);
  
        mutex_unlock(&vmur_mutex);
diff --combined drivers/s390/net/claw.c
index d40f7a934f94e217d9fc1db1a099a4953e0ad6fa,1b34233cf6d522a8481b63061a8795e6a1bfa1d4..f370f8d460a721674f5537d79c8e528d23bb4b5e
@@@ -3,12 -3,12 +3,12 @@@
   *    ESCON CLAW network driver
   *
   *  Linux for zSeries version
 - *    Copyright (C) 2002,2005 IBM Corporation
 + *    Copyright IBM Corp. 2002, 2009
   *  Author(s) Original code written by:
 - *              Kazuo Iimura (iimura@jp.ibm.com)
 + *            Kazuo Iimura <iimura@jp.ibm.com>
   *          Rewritten by
 - *              Andy Richter (richtera@us.ibm.com)
 - *              Marc Price (mwprice@us.ibm.com)
 + *            Andy Richter <richtera@us.ibm.com>
 + *            Marc Price <mwprice@us.ibm.com>
   *
   *    sysfs parms:
   *   group x.x.rrrr,x.x.wwww
@@@ -253,11 -253,6 +253,11 @@@ static void claw_free_wrt_buf(struct ne
  /* Functions for unpack reads   */
  static void unpack_read(struct net_device *dev);
  
 +static int claw_pm_prepare(struct ccwgroup_device *gdev)
 +{
 +      return -EPERM;
 +}
 +
  /* ccwgroup table  */
  
  static struct ccwgroup_driver claw_group_driver = {
          .remove      = claw_remove_device,
          .set_online  = claw_new_device,
          .set_offline = claw_shutdown_device,
 +      .prepare     = claw_pm_prepare,
  };
  
  /*
@@@ -290,7 -284,7 +290,7 @@@ claw_probe(struct ccwgroup_device *cgde
        if (!get_device(&cgdev->dev))
                return -ENODEV;
        privptr = kzalloc(sizeof(struct claw_privbk), GFP_KERNEL);
-       cgdev->dev.driver_data = privptr;
+       dev_set_drvdata(&cgdev->dev, privptr);
        if (privptr == NULL) {
                probe_error(cgdev);
                put_device(&cgdev->dev);
@@@ -597,14 -591,14 +597,14 @@@ claw_irq_handler(struct ccw_device *cde
  
        CLAW_DBF_TEXT(4, trace, "clawirq");
          /* Bypass all 'unsolicited interrupts' */
-       if (!cdev->dev.driver_data) {
+       privptr = dev_get_drvdata(&cdev->dev);
+       if (!privptr) {
                dev_warn(&cdev->dev, "An uninitialized CLAW device received an"
                        " IRQ, c-%02x d-%02x\n",
                        irb->scsw.cmd.cstat, irb->scsw.cmd.dstat);
                CLAW_DBF_TEXT(2, trace, "badirq");
                  return;
          }
-       privptr = (struct claw_privbk *)cdev->dev.driver_data;
  
        /* Try to extract channel from driver data. */
        if (privptr->channel[READ].cdev == cdev)
@@@ -1986,9 -1980,9 +1986,9 @@@ probe_error( struct ccwgroup_device *cg
        struct claw_privbk *privptr;
  
        CLAW_DBF_TEXT(4, trace, "proberr");
-       privptr = (struct claw_privbk *) cgdev->dev.driver_data;
+       privptr = dev_get_drvdata(&cgdev->dev);
        if (privptr != NULL) {
-               cgdev->dev.driver_data = NULL;
+               dev_set_drvdata(&cgdev->dev, NULL);
                kfree(privptr->p_env);
                kfree(privptr->p_mtc_envelope);
                kfree(privptr);
@@@ -2917,9 -2911,9 +2917,9 @@@ claw_new_device(struct ccwgroup_device 
        dev_info(&cgdev->dev, "add for %s\n",
                 dev_name(&cgdev->cdev[READ]->dev));
        CLAW_DBF_TEXT(2, setup, "new_dev");
-       privptr = cgdev->dev.driver_data;
-       cgdev->cdev[READ]->dev.driver_data = privptr;
-       cgdev->cdev[WRITE]->dev.driver_data = privptr;
+       privptr = dev_get_drvdata(&cgdev->dev);
+       dev_set_drvdata(&cgdev->cdev[READ]->dev, privptr);
+       dev_set_drvdata(&cgdev->cdev[WRITE]->dev, privptr);
        if (!privptr)
                return -ENODEV;
        p_env = privptr->p_env;
                goto out;
        }
        dev->ml_priv = privptr;
-       cgdev->dev.driver_data = privptr;
-         cgdev->cdev[READ]->dev.driver_data = privptr;
-         cgdev->cdev[WRITE]->dev.driver_data = privptr;
+       dev_set_drvdata(&cgdev->dev, privptr);
+       dev_set_drvdata(&cgdev->cdev[READ]->dev, privptr);
+       dev_set_drvdata(&cgdev->cdev[WRITE]->dev, privptr);
        /* sysfs magic */
          SET_NETDEV_DEV(dev, &cgdev->dev);
        if (register_netdev(dev) != 0) {
@@@ -3024,7 -3018,7 +3024,7 @@@ claw_shutdown_device(struct ccwgroup_de
        int     ret;
  
        CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev));
-       priv = cgdev->dev.driver_data;
+       priv = dev_get_drvdata(&cgdev->dev);
        if (!priv)
                return -ENODEV;
        ndev = priv->channel[READ].ndev;
@@@ -3054,7 -3048,7 +3054,7 @@@ claw_remove_device(struct ccwgroup_devi
  
        BUG_ON(!cgdev);
        CLAW_DBF_TEXT_(2, setup, "%s", dev_name(&cgdev->dev));
-       priv = cgdev->dev.driver_data;
+       priv = dev_get_drvdata(&cgdev->dev);
        BUG_ON(!priv);
        dev_info(&cgdev->dev, " will be removed.\n");
        if (cgdev->state == CCWGROUP_ONLINE)
        kfree(priv->channel[1].irb);
        priv->channel[1].irb=NULL;
        kfree(priv);
-       cgdev->dev.driver_data=NULL;
-       cgdev->cdev[READ]->dev.driver_data = NULL;
-       cgdev->cdev[WRITE]->dev.driver_data = NULL;
+       dev_set_drvdata(&cgdev->dev, NULL);
+       dev_set_drvdata(&cgdev->cdev[READ]->dev, NULL);
+       dev_set_drvdata(&cgdev->cdev[WRITE]->dev, NULL);
        put_device(&cgdev->dev);
  
        return;
@@@ -3087,7 -3081,7 +3087,7 @@@ claw_hname_show(struct device *dev, str
        struct claw_privbk *priv;
        struct claw_env *  p_env;
  
-       priv = dev->driver_data;
+       priv = dev_get_drvdata(dev);
        if (!priv)
                return -ENODEV;
        p_env = priv->p_env;
@@@ -3101,7 -3095,7 +3101,7 @@@ claw_hname_write(struct device *dev, st
        struct claw_privbk *priv;
        struct claw_env *  p_env;
  
-       priv = dev->driver_data;
+       priv = dev_get_drvdata(dev);
        if (!priv)
                return -ENODEV;
        p_env = priv->p_env;
@@@ -3125,7 -3119,7 +3125,7 @@@ claw_adname_show(struct device *dev, st
        struct claw_privbk *priv;
        struct claw_env *  p_env;
  
-       priv = dev->driver_data;
+       priv = dev_get_drvdata(dev);
        if (!priv)
                return -ENODEV;
        p_env = priv->p_env;
@@@ -3139,7 -3133,7 +3139,7 @@@ claw_adname_write(struct device *dev, s
        struct claw_privbk *priv;
        struct claw_env *  p_env;
  
-       priv = dev->driver_data;
+       priv = dev_get_drvdata(dev);
        if (!priv)
                return -ENODEV;
        p_env = priv->p_env;
@@@ -3163,7 -3157,7 +3163,7 @@@ claw_apname_show(struct device *dev, st
        struct claw_privbk *priv;
        struct claw_env *  p_env;
  
-       priv = dev->driver_data;
+       priv = dev_get_drvdata(dev);
        if (!priv)
                return -ENODEV;
        p_env = priv->p_env;
@@@ -3178,7 -3172,7 +3178,7 @@@ claw_apname_write(struct device *dev, s
        struct claw_privbk *priv;
        struct claw_env *  p_env;
  
-       priv = dev->driver_data;
+       priv = dev_get_drvdata(dev);
        if (!priv)
                return -ENODEV;
        p_env = priv->p_env;
@@@ -3212,7 -3206,7 +3212,7 @@@ claw_wbuff_show(struct device *dev, str
        struct claw_privbk *priv;
        struct claw_env * p_env;
  
-       priv = dev->driver_data;
+       priv = dev_get_drvdata(dev);
        if (!priv)
                return -ENODEV;
        p_env = priv->p_env;
@@@ -3227,7 -3221,7 +3227,7 @@@ claw_wbuff_write(struct device *dev, st
        struct claw_env *  p_env;
        int nnn,max;
  
-       priv = dev->driver_data;
+       priv = dev_get_drvdata(dev);
        if (!priv)
                return -ENODEV;
        p_env = priv->p_env;
@@@ -3254,7 -3248,7 +3254,7 @@@ claw_rbuff_show(struct device *dev, str
        struct claw_privbk *priv;
        struct claw_env *  p_env;
  
-       priv = dev->driver_data;
+       priv = dev_get_drvdata(dev);
        if (!priv)
                return -ENODEV;
        p_env = priv->p_env;
@@@ -3269,7 -3263,7 +3269,7 @@@ claw_rbuff_write(struct device *dev, st
        struct claw_env *p_env;
        int nnn,max;
  
-       priv = dev->driver_data;
+       priv = dev_get_drvdata(dev);
        if (!priv)
                return -ENODEV;
        p_env = priv->p_env;
diff --combined drivers/s390/net/lcs.c
index 07a25c3f94b69e1164250bb1de9736fe41c80f69,ba6d45d29ad4cdcda18d7053b819d36db365fde7..8c675905448b74c33983c7e5038e4b8688a15ce0
@@@ -1,12 -1,15 +1,12 @@@
  /*
 - *  linux/drivers/s390/net/lcs.c
 - *
   *  Linux for S/390 Lan Channel Station Network Driver
   *
 - *  Copyright (C)  1999-2001 IBM Deutschland Entwicklung GmbH,
 - *                         IBM Corporation
 - *    Author(s): Original Code written by
 - *                      DJ Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
 - *             Rewritten by
 - *                      Frank Pavlic (fpavlic@de.ibm.com) and
 - *                      Martin Schwidefsky <schwidefsky@de.ibm.com>
 + *  Copyright IBM Corp. 1999, 2009
 + *  Author(s): Original Code written by
 + *                    DJ Barrow <djbarrow@de.ibm.com,barrow_dj@yahoo.com>
 + *           Rewritten by
 + *                    Frank Pavlic <fpavlic@de.ibm.com> and
 + *                    Martin Schwidefsky <schwidefsky@de.ibm.com>
   *
   * This program is free software; you can redistribute it and/or modify
   * it under the terms of the GNU General Public License as published by
@@@ -1936,7 -1939,7 +1936,7 @@@ lcs_portno_show (struct device *dev, st
  {
          struct lcs_card *card;
  
-       card = (struct lcs_card *)dev->driver_data;
+       card = dev_get_drvdata(dev);
  
          if (!card)
                  return 0;
@@@ -1953,7 -1956,7 +1953,7 @@@ lcs_portno_store (struct device *dev, s
          struct lcs_card *card;
          int value;
  
-       card = (struct lcs_card *)dev->driver_data;
+       card = dev_get_drvdata(dev);
  
          if (!card)
                  return 0;
@@@ -1987,7 -1990,7 +1987,7 @@@ lcs_timeout_show(struct device *dev, st
  {
        struct lcs_card *card;
  
-       card = (struct lcs_card *)dev->driver_data;
+       card = dev_get_drvdata(dev);
  
        return card ? sprintf(buf, "%u\n", card->lancmd_timeout) : 0;
  }
@@@ -1998,7 -2001,7 +1998,7 @@@ lcs_timeout_store (struct device *dev, 
          struct lcs_card *card;
          int value;
  
-       card = (struct lcs_card *)dev->driver_data;
+       card = dev_get_drvdata(dev);
  
          if (!card)
                  return 0;
@@@ -2017,7 -2020,7 +2017,7 @@@ static ssize_
  lcs_dev_recover_store(struct device *dev, struct device_attribute *attr,
                      const char *buf, size_t count)
  {
-       struct lcs_card *card = dev->driver_data;
+       struct lcs_card *card = dev_get_drvdata(dev);
        char *tmp;
        int i;
  
@@@ -2070,7 -2073,7 +2070,7 @@@ lcs_probe_device(struct ccwgroup_devic
                put_device(&ccwgdev->dev);
                return ret;
          }
-       ccwgdev->dev.driver_data = card;
+       dev_set_drvdata(&ccwgdev->dev, card);
        ccwgdev->cdev[0]->handler = lcs_irq;
        ccwgdev->cdev[1]->handler = lcs_irq;
        card->gdev = ccwgdev;
@@@ -2087,7 -2090,7 +2087,7 @@@ lcs_register_netdev(struct ccwgroup_dev
        struct lcs_card *card;
  
        LCS_DBF_TEXT(2, setup, "regnetdv");
-       card = (struct lcs_card *)ccwgdev->dev.driver_data;
+       card = dev_get_drvdata(&ccwgdev->dev);
        if (card->dev->reg_state != NETREG_UNINITIALIZED)
                return 0;
        SET_NETDEV_DEV(card->dev, &ccwgdev->dev);
@@@ -2120,7 -2123,7 +2120,7 @@@ lcs_new_device(struct ccwgroup_device *
        enum lcs_dev_states recover_state;
        int rc;
  
-       card = (struct lcs_card *)ccwgdev->dev.driver_data;
+       card = dev_get_drvdata(&ccwgdev->dev);
        if (!card)
                return -ENODEV;
  
@@@ -2226,7 -2229,7 +2226,7 @@@ __lcs_shutdown_device(struct ccwgroup_d
        int ret;
  
        LCS_DBF_TEXT(3, setup, "shtdndev");
-       card = (struct lcs_card *)ccwgdev->dev.driver_data;
+       card = dev_get_drvdata(&ccwgdev->dev);
        if (!card)
                return -ENODEV;
        if (recovery_mode == 0) {
@@@ -2293,7 -2296,7 +2293,7 @@@ lcs_remove_device(struct ccwgroup_devic
  {
        struct lcs_card *card;
  
-       card = (struct lcs_card *)ccwgdev->dev.driver_data;
+       card = dev_get_drvdata(&ccwgdev->dev);
        if (!card)
                return;
  
        put_device(&ccwgdev->dev);
  }
  
 +static int lcs_pm_suspend(struct lcs_card *card)
 +{
 +      if (card->dev)
 +              netif_device_detach(card->dev);
 +      lcs_set_allowed_threads(card, 0);
 +      lcs_wait_for_threads(card, 0xffffffff);
 +      if (card->state != DEV_STATE_DOWN)
 +              __lcs_shutdown_device(card->gdev, 1);
 +      return 0;
 +}
 +
 +static int lcs_pm_resume(struct lcs_card *card)
 +{
 +      int rc = 0;
 +
 +      if (card->state == DEV_STATE_RECOVER)
 +              rc = lcs_new_device(card->gdev);
 +      if (card->dev)
 +              netif_device_attach(card->dev);
 +      if (rc) {
 +              dev_warn(&card->gdev->dev, "The lcs device driver "
 +                      "failed to recover the device\n");
 +      }
 +      return rc;
 +}
 +
 +static int lcs_prepare(struct ccwgroup_device *gdev)
 +{
 +      return 0;
 +}
 +
 +static void lcs_complete(struct ccwgroup_device *gdev)
 +{
 +      return;
 +}
 +
 +static int lcs_freeze(struct ccwgroup_device *gdev)
 +{
 +      struct lcs_card *card = dev_get_drvdata(&gdev->dev);
 +      return lcs_pm_suspend(card);
 +}
 +
 +static int lcs_thaw(struct ccwgroup_device *gdev)
 +{
 +      struct lcs_card *card = dev_get_drvdata(&gdev->dev);
 +      return lcs_pm_resume(card);
 +}
 +
 +static int lcs_restore(struct ccwgroup_device *gdev)
 +{
 +      struct lcs_card *card = dev_get_drvdata(&gdev->dev);
 +      return lcs_pm_resume(card);
 +}
 +
  /**
   * LCS ccwgroup driver registration
   */
@@@ -2376,11 -2325,6 +2376,11 @@@ static struct ccwgroup_driver lcs_group
        .remove      = lcs_remove_device,
        .set_online  = lcs_new_device,
        .set_offline = lcs_shutdown_device,
 +      .prepare     = lcs_prepare,
 +      .complete    = lcs_complete,
 +      .freeze      = lcs_freeze,
 +      .thaw        = lcs_thaw,
 +      .restore     = lcs_restore,
  };
  
  /**
index fdb02d043d3ed844d8462977888d044797a21086,d52a99f9b70220bef1c1369d6f13acfd4963a14c..52574ce797b24f92e91edf49c20174d08fca28ed
@@@ -1,15 -1,11 +1,15 @@@
  /*
   * IUCV network driver
   *
 - * Copyright 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation
 - * Author(s): Fritz Elfert (elfert@de.ibm.com, felfert@millenux.com)
 + * Copyright IBM Corp. 2001, 2009
   *
 - * Sysfs integration and all bugs therein by Cornelia Huck
 - * (cornelia.huck@de.ibm.com)
 + * Author(s):
 + *    Original netiucv driver:
 + *            Fritz Elfert (elfert@de.ibm.com, felfert@millenux.com)
 + *    Sysfs integration and all bugs therein:
 + *            Cornelia Huck (cornelia.huck@de.ibm.com)
 + *    PM functions:
 + *            Ursula Braun (ursula.braun@de.ibm.com)
   *
   * Documentation used:
   *  the source of the original IUCV driver by:
@@@ -153,27 -149,10 +153,27 @@@ PRINT_##importance(header "%02x %02x %0
  
  #define PRINTK_HEADER " iucv: "       /* for debugging */
  
 +/* dummy device to make sure netiucv_pm functions are called */
 +static struct device *netiucv_dev;
 +
 +static int netiucv_pm_prepare(struct device *);
 +static void netiucv_pm_complete(struct device *);
 +static int netiucv_pm_freeze(struct device *);
 +static int netiucv_pm_restore_thaw(struct device *);
 +
 +static struct dev_pm_ops netiucv_pm_ops = {
 +      .prepare = netiucv_pm_prepare,
 +      .complete = netiucv_pm_complete,
 +      .freeze = netiucv_pm_freeze,
 +      .thaw = netiucv_pm_restore_thaw,
 +      .restore = netiucv_pm_restore_thaw,
 +};
 +
  static struct device_driver netiucv_driver = {
        .owner = THIS_MODULE,
        .name = "netiucv",
        .bus  = &iucv_bus,
 +      .pm = &netiucv_pm_ops,
  };
  
  static int netiucv_callback_connreq(struct iucv_path *,
@@@ -254,7 -233,6 +254,7 @@@ struct netiucv_priv 
        fsm_instance            *fsm;
          struct iucv_connection  *conn;
        struct device           *dev;
 +      int                      pm_state;
  };
  
  /**
@@@ -1287,72 -1265,6 +1287,72 @@@ static int netiucv_close(struct net_dev
        return 0;
  }
  
 +static int netiucv_pm_prepare(struct device *dev)
 +{
 +      IUCV_DBF_TEXT(trace, 3, __func__);
 +      return 0;
 +}
 +
 +static void netiucv_pm_complete(struct device *dev)
 +{
 +      IUCV_DBF_TEXT(trace, 3, __func__);
 +      return;
 +}
 +
 +/**
 + * netiucv_pm_freeze() - Freeze PM callback
 + * @dev:      netiucv device
 + *
 + * close open netiucv interfaces
 + */
 +static int netiucv_pm_freeze(struct device *dev)
 +{
 +      struct netiucv_priv *priv = dev->driver_data;
 +      struct net_device *ndev = NULL;
 +      int rc = 0;
 +
 +      IUCV_DBF_TEXT(trace, 3, __func__);
 +      if (priv && priv->conn)
 +              ndev = priv->conn->netdev;
 +      if (!ndev)
 +              goto out;
 +      netif_device_detach(ndev);
 +      priv->pm_state = fsm_getstate(priv->fsm);
 +      rc = netiucv_close(ndev);
 +out:
 +      return rc;
 +}
 +
 +/**
 + * netiucv_pm_restore_thaw() - Thaw and restore PM callback
 + * @dev:      netiucv device
 + *
 + * re-open netiucv interfaces closed during freeze
 + */
 +static int netiucv_pm_restore_thaw(struct device *dev)
 +{
 +      struct netiucv_priv *priv = dev->driver_data;
 +      struct net_device *ndev = NULL;
 +      int rc = 0;
 +
 +      IUCV_DBF_TEXT(trace, 3, __func__);
 +      if (priv && priv->conn)
 +              ndev = priv->conn->netdev;
 +      if (!ndev)
 +              goto out;
 +      switch (priv->pm_state) {
 +      case DEV_STATE_RUNNING:
 +      case DEV_STATE_STARTWAIT:
 +              rc = netiucv_open(ndev);
 +              break;
 +      default:
 +              break;
 +      }
 +      netif_device_attach(ndev);
 +out:
 +      return rc;
 +}
 +
  /**
   * Start transmission of a packet.
   * Called from generic network device layer.
@@@ -1452,7 -1364,7 +1452,7 @@@ static int netiucv_change_mtu(struct ne
  static ssize_t user_show(struct device *dev, struct device_attribute *attr,
                         char *buf)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
  
        IUCV_DBF_TEXT(trace, 5, __func__);
        return sprintf(buf, "%s\n", netiucv_printname(priv->conn->userid));
  static ssize_t user_write(struct device *dev, struct device_attribute *attr,
                          const char *buf, size_t count)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
        struct net_device *ndev = priv->conn->netdev;
        char    *p;
        char    *tmp;
@@@ -1518,7 -1430,8 +1518,8 @@@ static DEVICE_ATTR(user, 0644, user_sho
  
  static ssize_t buffer_show (struct device *dev, struct device_attribute *attr,
                            char *buf)
- {     struct netiucv_priv *priv = dev->driver_data;
+ {
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
  
        IUCV_DBF_TEXT(trace, 5, __func__);
        return sprintf(buf, "%d\n", priv->conn->max_buffsize);
  static ssize_t buffer_write (struct device *dev, struct device_attribute *attr,
                             const char *buf, size_t count)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
        struct net_device *ndev = priv->conn->netdev;
        char         *e;
        int          bs1;
@@@ -1575,7 -1488,7 +1576,7 @@@ static DEVICE_ATTR(buffer, 0644, buffer
  static ssize_t dev_fsm_show (struct device *dev, struct device_attribute *attr,
                             char *buf)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
  
        IUCV_DBF_TEXT(trace, 5, __func__);
        return sprintf(buf, "%s\n", fsm_getstate_str(priv->fsm));
@@@ -1586,7 -1499,7 +1587,7 @@@ static DEVICE_ATTR(device_fsm_state, 04
  static ssize_t conn_fsm_show (struct device *dev,
                              struct device_attribute *attr, char *buf)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
  
        IUCV_DBF_TEXT(trace, 5, __func__);
        return sprintf(buf, "%s\n", fsm_getstate_str(priv->conn->fsm));
@@@ -1597,7 -1510,7 +1598,7 @@@ static DEVICE_ATTR(connection_fsm_state
  static ssize_t maxmulti_show (struct device *dev,
                              struct device_attribute *attr, char *buf)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
  
        IUCV_DBF_TEXT(trace, 5, __func__);
        return sprintf(buf, "%ld\n", priv->conn->prof.maxmulti);
@@@ -1607,7 -1520,7 +1608,7 @@@ static ssize_t maxmulti_write (struct d
                               struct device_attribute *attr,
                               const char *buf, size_t count)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
  
        IUCV_DBF_TEXT(trace, 4, __func__);
        priv->conn->prof.maxmulti = 0;
@@@ -1619,7 -1532,7 +1620,7 @@@ static DEVICE_ATTR(max_tx_buffer_used, 
  static ssize_t maxcq_show (struct device *dev, struct device_attribute *attr,
                           char *buf)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
  
        IUCV_DBF_TEXT(trace, 5, __func__);
        return sprintf(buf, "%ld\n", priv->conn->prof.maxcqueue);
  static ssize_t maxcq_write (struct device *dev, struct device_attribute *attr,
                            const char *buf, size_t count)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
  
        IUCV_DBF_TEXT(trace, 4, __func__);
        priv->conn->prof.maxcqueue = 0;
@@@ -1640,7 -1553,7 +1641,7 @@@ static DEVICE_ATTR(max_chained_skbs, 06
  static ssize_t sdoio_show (struct device *dev, struct device_attribute *attr,
                           char *buf)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
  
        IUCV_DBF_TEXT(trace, 5, __func__);
        return sprintf(buf, "%ld\n", priv->conn->prof.doios_single);
  static ssize_t sdoio_write (struct device *dev, struct device_attribute *attr,
                            const char *buf, size_t count)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
  
        IUCV_DBF_TEXT(trace, 4, __func__);
        priv->conn->prof.doios_single = 0;
@@@ -1661,7 -1574,7 +1662,7 @@@ static DEVICE_ATTR(tx_single_write_ops
  static ssize_t mdoio_show (struct device *dev, struct device_attribute *attr,
                           char *buf)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
  
        IUCV_DBF_TEXT(trace, 5, __func__);
        return sprintf(buf, "%ld\n", priv->conn->prof.doios_multi);
  static ssize_t mdoio_write (struct device *dev, struct device_attribute *attr,
                            const char *buf, size_t count)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
  
        IUCV_DBF_TEXT(trace, 5, __func__);
        priv->conn->prof.doios_multi = 0;
@@@ -1682,7 -1595,7 +1683,7 @@@ static DEVICE_ATTR(tx_multi_write_ops, 
  static ssize_t txlen_show (struct device *dev, struct device_attribute *attr,
                           char *buf)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
  
        IUCV_DBF_TEXT(trace, 5, __func__);
        return sprintf(buf, "%ld\n", priv->conn->prof.txlen);
  static ssize_t txlen_write (struct device *dev, struct device_attribute *attr,
                            const char *buf, size_t count)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
  
        IUCV_DBF_TEXT(trace, 4, __func__);
        priv->conn->prof.txlen = 0;
@@@ -1703,7 -1616,7 +1704,7 @@@ static DEVICE_ATTR(netto_bytes, 0644, t
  static ssize_t txtime_show (struct device *dev, struct device_attribute *attr,
                            char *buf)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
  
        IUCV_DBF_TEXT(trace, 5, __func__);
        return sprintf(buf, "%ld\n", priv->conn->prof.tx_time);
  static ssize_t txtime_write (struct device *dev, struct device_attribute *attr,
                             const char *buf, size_t count)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
  
        IUCV_DBF_TEXT(trace, 4, __func__);
        priv->conn->prof.tx_time = 0;
@@@ -1724,7 -1637,7 +1725,7 @@@ static DEVICE_ATTR(max_tx_io_time, 0644
  static ssize_t txpend_show (struct device *dev, struct device_attribute *attr,
                            char *buf)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
  
        IUCV_DBF_TEXT(trace, 5, __func__);
        return sprintf(buf, "%ld\n", priv->conn->prof.tx_pending);
  static ssize_t txpend_write (struct device *dev, struct device_attribute *attr,
                             const char *buf, size_t count)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
  
        IUCV_DBF_TEXT(trace, 4, __func__);
        priv->conn->prof.tx_pending = 0;
@@@ -1745,7 -1658,7 +1746,7 @@@ static DEVICE_ATTR(tx_pending, 0644, tx
  static ssize_t txmpnd_show (struct device *dev, struct device_attribute *attr,
                            char *buf)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
  
        IUCV_DBF_TEXT(trace, 5, __func__);
        return sprintf(buf, "%ld\n", priv->conn->prof.tx_max_pending);
  static ssize_t txmpnd_write (struct device *dev, struct device_attribute *attr,
                             const char *buf, size_t count)
  {
-       struct netiucv_priv *priv = dev->driver_data;
+       struct netiucv_priv *priv = dev_get_drvdata(dev);
  
        IUCV_DBF_TEXT(trace, 4, __func__);
        priv->conn->prof.tx_max_pending = 0;
@@@ -1819,6 -1732,7 +1820,6 @@@ static int netiucv_register_device(stru
        struct device *dev = kzalloc(sizeof(struct device), GFP_KERNEL);
        int ret;
  
 -
        IUCV_DBF_TEXT(trace, 3, __func__);
  
        if (dev) {
        if (ret)
                goto out_unreg;
        priv->dev = dev;
-       dev->driver_data = priv;
+       dev_set_drvdata(dev, priv);
        return 0;
  
  out_unreg:
@@@ -2187,7 -2101,6 +2188,7 @@@ static void __exit netiucv_exit(void
                netiucv_unregister_device(dev);
        }
  
 +      device_unregister(netiucv_dev);
        driver_unregister(&netiucv_driver);
        iucv_unregister(&netiucv_handler, 1);
        iucv_unregister_dbf_views();
@@@ -2213,25 -2126,10 +2214,25 @@@ static int __init netiucv_init(void
                IUCV_DBF_TEXT_(setup, 2, "ret %d from driver_register\n", rc);
                goto out_iucv;
        }
 -
 +      /* establish dummy device */
 +      netiucv_dev = kzalloc(sizeof(struct device), GFP_KERNEL);
 +      if (!netiucv_dev) {
 +              rc = -ENOMEM;
 +              goto out_driver;
 +      }
 +      dev_set_name(netiucv_dev, "netiucv");
 +      netiucv_dev->bus = &iucv_bus;
 +      netiucv_dev->parent = iucv_root;
 +      netiucv_dev->release = (void (*)(struct device *))kfree;
 +      netiucv_dev->driver = &netiucv_driver;
 +      rc = device_register(netiucv_dev);
 +      if (rc)
 +              goto out_driver;
        netiucv_banner();
        return rc;
  
 +out_driver:
 +      driver_unregister(&netiucv_driver);
  out_iucv:
        iucv_unregister(&netiucv_handler, 1);
  out_dbf:
diff --combined include/linux/kernel.h
index 1b2e1747df1a02f8cc4ef308fc8a90c2aeb00a83,99b7aada28da30f75a30cbced603063db26017a5..c5a71c38a95f5521b17aef7ca178e43e2ca11b0e
@@@ -97,14 -97,12 +97,14 @@@ extern const char linux_proc_banner[]
  #define       KERN_INFO       "<6>"   /* informational                        */
  #define       KERN_DEBUG      "<7>"   /* debug-level messages                 */
  
 +/* Use the default kernel loglevel */
 +#define KERN_DEFAULT  "<d>"
  /*
   * Annotation for a "continued" line of log printout (only done after a
   * line that had no enclosing \n). Only to be used by core/arch code
   * during early bootup (a continued line is not SMP-safe otherwise).
   */
 -#define       KERN_CONT       ""
 +#define       KERN_CONT       "<c>"
  
  extern int console_printk[];
  
@@@ -408,7 -406,7 +408,7 @@@ static inline char *pack_hex_byte(char 
   *
   * Use tracing_on/tracing_off when you want to quickly turn on or off
   * tracing. It simply enables or disables the recording of the trace events.
-  * This also corresponds to the user space debugfs/tracing/tracing_on
+  * This also corresponds to the user space /sys/kernel/debug/tracing/tracing_on
   * file, which gives a means for the kernel and userspace to interact.
   * Place a tracing_off() in the kernel where you want tracing to end.
   * From user space, examine the trace, and then echo 1 > tracing_on