Commit 4f0076f7 authored by Martin Schwidefsky's avatar Martin Schwidefsky

[S390] driver_data access

Replace the remaining direct accesses to the driver_data pointer
with calls to the dev_get_drvdata() and dev_set_drvdata() functions.
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 4a9c7525
...@@ -732,7 +732,7 @@ static int raw3215_pm_stop(struct ccw_device *cdev) ...@@ -732,7 +732,7 @@ static int raw3215_pm_stop(struct ccw_device *cdev)
unsigned long flags; unsigned long flags;
/* Empty the output buffer, then prevent new I/O. */ /* Empty the output buffer, then prevent new I/O. */
raw = cdev->dev.driver_data; raw = dev_get_drvdata(&cdev->dev);
spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags); spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags);
raw3215_make_room(raw, RAW3215_BUFFER_SIZE); raw3215_make_room(raw, RAW3215_BUFFER_SIZE);
raw->flags |= RAW3215_FROZEN; raw->flags |= RAW3215_FROZEN;
...@@ -746,7 +746,7 @@ static int raw3215_pm_start(struct ccw_device *cdev) ...@@ -746,7 +746,7 @@ static int raw3215_pm_start(struct ccw_device *cdev)
unsigned long flags; unsigned long flags;
/* Allow I/O again and flush output buffer. */ /* Allow I/O again and flush output buffer. */
raw = cdev->dev.driver_data; raw = dev_get_drvdata(&cdev->dev);
spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags); spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags);
raw->flags &= ~RAW3215_FROZEN; raw->flags &= ~RAW3215_FROZEN;
raw->flags |= RAW3215_FLUSHING; raw->flags |= RAW3215_FLUSHING;
......
...@@ -320,7 +320,7 @@ static int mon_open(struct inode *inode, struct file *filp) ...@@ -320,7 +320,7 @@ static int mon_open(struct inode *inode, struct file *filp)
goto out_path; goto out_path;
} }
filp->private_data = monpriv; filp->private_data = monpriv;
monreader_device->driver_data = monpriv; dev_set_drvdata(&monreader_device, monpriv);
unlock_kernel(); unlock_kernel();
return nonseekable_open(inode, filp); return nonseekable_open(inode, filp);
...@@ -463,7 +463,7 @@ static struct miscdevice mon_dev = { ...@@ -463,7 +463,7 @@ static struct miscdevice mon_dev = {
*****************************************************************************/ *****************************************************************************/
static int monreader_freeze(struct device *dev) static int monreader_freeze(struct device *dev)
{ {
struct mon_private *monpriv = dev->driver_data; struct mon_private *monpriv = dev_get_drvdata(&dev);
int rc; int rc;
if (!monpriv) if (!monpriv)
...@@ -487,7 +487,7 @@ static int monreader_freeze(struct device *dev) ...@@ -487,7 +487,7 @@ static int monreader_freeze(struct device *dev)
static int monreader_thaw(struct device *dev) static int monreader_thaw(struct device *dev)
{ {
struct mon_private *monpriv = dev->driver_data; struct mon_private *monpriv = dev_get_drvdata(dev);
int rc; int rc;
if (!monpriv) if (!monpriv)
......
...@@ -1322,7 +1322,7 @@ static int raw3270_pm_stop(struct ccw_device *cdev) ...@@ -1322,7 +1322,7 @@ static int raw3270_pm_stop(struct ccw_device *cdev)
struct raw3270_view *view; struct raw3270_view *view;
unsigned long flags; unsigned long flags;
rp = cdev->dev.driver_data; rp = dev_get_drvdata(&cdev->dev);
if (!rp) if (!rp)
return 0; return 0;
spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags); spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
...@@ -1348,7 +1348,7 @@ static int raw3270_pm_start(struct ccw_device *cdev) ...@@ -1348,7 +1348,7 @@ static int raw3270_pm_start(struct ccw_device *cdev)
struct raw3270 *rp; struct raw3270 *rp;
unsigned long flags; unsigned long flags;
rp = cdev->dev.driver_data; rp = dev_get_drvdata(&cdev->dev);
if (!rp) if (!rp)
return 0; return 0;
spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags); spin_lock_irqsave(get_ccwdev_lock(rp->cdev), flags);
......
...@@ -396,7 +396,7 @@ int tape_generic_pm_suspend(struct ccw_device *cdev) ...@@ -396,7 +396,7 @@ int tape_generic_pm_suspend(struct ccw_device *cdev)
{ {
struct tape_device *device; struct tape_device *device;
device = cdev->dev.driver_data; device = dev_get_drvdata(&cdev->dev);
if (!device) { if (!device) {
return -ENODEV; return -ENODEV;
} }
......
...@@ -663,7 +663,7 @@ static struct attribute *vmlogrdr_attrs[] = { ...@@ -663,7 +663,7 @@ static struct attribute *vmlogrdr_attrs[] = {
static int vmlogrdr_pm_prepare(struct device *dev) static int vmlogrdr_pm_prepare(struct device *dev)
{ {
int rc; int rc;
struct vmlogrdr_priv_t *priv = dev->driver_data; struct vmlogrdr_priv_t *priv = dev_get_drvdata(dev);
rc = 0; rc = 0;
if (priv) { if (priv) {
...@@ -753,7 +753,7 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv) ...@@ -753,7 +753,7 @@ static int vmlogrdr_register_device(struct vmlogrdr_priv_t *priv)
dev->bus = &iucv_bus; dev->bus = &iucv_bus;
dev->parent = iucv_root; dev->parent = iucv_root;
dev->driver = &vmlogrdr_driver; dev->driver = &vmlogrdr_driver;
dev->driver_data = priv; dev_set_drvdata(dev, priv);
/* /*
* The release function could be called after the * The release function could be called after the
* module has been unloaded. It's _only_ task is to * module has been unloaded. It's _only_ task is to
......
...@@ -170,7 +170,7 @@ static void urdev_put(struct urdev *urd) ...@@ -170,7 +170,7 @@ static void urdev_put(struct urdev *urd)
*/ */
static int ur_pm_suspend(struct ccw_device *cdev) static int ur_pm_suspend(struct ccw_device *cdev)
{ {
struct urdev *urd = cdev->dev.driver_data; struct urdev *urd = dev_get_drvdata(&cdev->dev);
TRACE("ur_pm_suspend: cdev=%p\n", cdev); TRACE("ur_pm_suspend: cdev=%p\n", cdev);
if (urd->open_flag) { if (urd->open_flag) {
......
...@@ -1307,7 +1307,7 @@ static void netiucv_pm_complete(struct device *dev) ...@@ -1307,7 +1307,7 @@ static void netiucv_pm_complete(struct device *dev)
*/ */
static int netiucv_pm_freeze(struct device *dev) static int netiucv_pm_freeze(struct device *dev)
{ {
struct netiucv_priv *priv = dev->driver_data; struct netiucv_priv *priv = dev_get_drvdata(dev);
struct net_device *ndev = NULL; struct net_device *ndev = NULL;
int rc = 0; int rc = 0;
...@@ -1331,7 +1331,7 @@ static int netiucv_pm_freeze(struct device *dev) ...@@ -1331,7 +1331,7 @@ static int netiucv_pm_freeze(struct device *dev)
*/ */
static int netiucv_pm_restore_thaw(struct device *dev) static int netiucv_pm_restore_thaw(struct device *dev)
{ {
struct netiucv_priv *priv = dev->driver_data; struct netiucv_priv *priv = dev_get_drvdata(dev);
struct net_device *ndev = NULL; struct net_device *ndev = NULL;
int rc = 0; int rc = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment