Skip to content

Commit

Permalink
[S390] cio: move cdev pointer to io_subchannel_private
Browse files Browse the repository at this point in the history
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 <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Sebastian Ott authored and Martin Schwidefsky committed Mar 15, 2011
1 parent c513d07 commit 97eb6bf
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions drivers/s390/cio/io_sch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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

Expand Down

0 comments on commit 97eb6bf

Please sign in to comment.