From 97eb6bfcb942a59f5c8d273523d68c6a0f57a6f2 Mon Sep 17 00:00:00 2001 From: Sebastian Ott Date: Tue, 15 Mar 2011 17:08:26 +0100 Subject: [S390] cio: move cdev pointer to io_subchannel_private Move the subchannels ccw device pointer from drv_data to the private data for I/O subchannels, since it is not the only drv_data for I/O subchannels. The next step will be to make io_subchannel_private the new drv_data for I/O subchannels. Signed-off-by: Sebastian Ott Signed-off-by: Martin Schwidefsky --- drivers/s390/cio/io_sch.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'drivers/s390/cio') diff --git a/drivers/s390/cio/io_sch.h b/drivers/s390/cio/io_sch.h index 8271a1f9860c..23f50ba50392 100644 --- a/drivers/s390/cio/io_sch.h +++ b/drivers/s390/cio/io_sch.h @@ -10,6 +10,7 @@ struct io_subchannel_private { union orb orb; /* operation request block */ struct ccw1 sense_ccw; /* static ccw for sense command */ + struct ccw_device *cdev;/* pointer to the child ccw device */ struct { unsigned int suspend:1; /* allow suspend */ unsigned int prefetch:1;/* deny prefetch */ @@ -18,8 +19,20 @@ struct io_subchannel_private { } __aligned(8); #define to_io_private(n) ((struct io_subchannel_private *)n->private) -#define sch_get_cdev(n) (dev_get_drvdata(&n->dev)) -#define sch_set_cdev(n, c) (dev_set_drvdata(&n->dev, c)) + +static inline struct ccw_device *sch_get_cdev(struct subchannel *sch) +{ + struct io_subchannel_private *priv = to_io_private(sch); + return priv ? priv->cdev : NULL; +} + +static inline void sch_set_cdev(struct subchannel *sch, + struct ccw_device *cdev) +{ + struct io_subchannel_private *priv = to_io_private(sch); + if (priv) + priv->cdev = cdev; +} #define MAX_CIWS 8 -- cgit v1.2.3