[PATCH v2 4/7] vfio/ccw: move private to mdev lifecycle
Eric Farman
farman at linux.ibm.com
Fri Nov 4 12:27:58 UTC 2022
On Thu, 2022-11-03 at 19:22 -0400, Matthew Rosato wrote:
> On 11/2/22 11:01 AM, Eric Farman wrote:
> > Now that the mdev parent data is split out into its own struct,
> > it is safe to move the remaining private data to follow the
> > mdev probe/remove lifecycle. The mdev parent data will remain
> > where it is, and follow the subchannel and the css driver
> > interfaces.
> >
> > Signed-off-by: Eric Farman <farman at linux.ibm.com>
> > ---
> > drivers/s390/cio/vfio_ccw_drv.c | 15 +--------------
> > drivers/s390/cio/vfio_ccw_ops.c | 26 +++++++++++++------------
> > -
> > drivers/s390/cio/vfio_ccw_private.h | 2 ++
> > 3 files changed, 16 insertions(+), 27 deletions(-)
> >
>
> ...
>
> > diff --git a/drivers/s390/cio/vfio_ccw_ops.c
> > b/drivers/s390/cio/vfio_ccw_ops.c
> > index eb0b8cc210bb..e45d4acb109b 100644
> > --- a/drivers/s390/cio/vfio_ccw_ops.c
> > +++ b/drivers/s390/cio/vfio_ccw_ops.c
> > @@ -100,15 +100,20 @@ static int vfio_ccw_mdev_probe(struct
> > mdev_device *mdev)
> > {
> > struct subchannel *sch = to_subchannel(mdev->dev.parent);
> > struct vfio_ccw_parent *parent = dev_get_drvdata(&sch-
> > >dev);
> > - struct vfio_ccw_private *private = dev_get_drvdata(&parent-
> > >dev);
> > + struct vfio_ccw_private *private;
> > int ret;
> >
> > - if (private->state == VFIO_CCW_STATE_NOT_OPER)
> > - return -ENODEV;
> > + private = kzalloc(sizeof(*private), GFP_KERNEL);
> > + if (!private)
> > + return -ENOMEM;
>
> Ha, looks like you time traveled and took my advice :)
Ha, I forgot I did this in the future. :)
>
> In fact it looks like some of my other comments from patch 1 get
> cleaned up here too -- but would still be good to make those changes
> in patch 1 for completeness/bisect.
Agreed, I'll pull those down to patch 1; thanks.
>
> Reviewed-by: Matthew Rosato <mjrosato at linux.ibm.com>
>
More information about the dri-devel
mailing list