summaryrefslogtreecommitdiffstats
path: root/drivers/s390/crypto
diff options
context:
space:
mode:
authorJulian Wiedmann <jwi@linux.ibm.com>2021-05-14 10:31:07 +0200
committerVasily Gorbik <gor@linux.ibm.com>2021-06-07 17:07:00 +0200
commit31aae32ca1258aa68b3feb2d7d00c1e252b857a1 (patch)
tree127c71f7fe13bd25d32d4dca54bba29a8dad9547 /drivers/s390/crypto
parent0677519ab94d2cf03c13e6e8cd6450d84bb09320 (diff)
downloadlinux-31aae32ca1258aa68b3feb2d7d00c1e252b857a1.tar.bz2
s390/vfio-ap: clean up vfio_ap_drv's definition
Define & initialize the driver struct in one go, so that everything is in one place. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Reviewed-by: Halil Pasic <pasic@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'drivers/s390/crypto')
-rw-r--r--drivers/s390/crypto/vfio_ap_drv.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/s390/crypto/vfio_ap_drv.c b/drivers/s390/crypto/vfio_ap_drv.c
index 7dc72cb718b0..4d2556bc7fe5 100644
--- a/drivers/s390/crypto/vfio_ap_drv.c
+++ b/drivers/s390/crypto/vfio_ap_drv.c
@@ -22,8 +22,6 @@ MODULE_AUTHOR("IBM Corporation");
MODULE_DESCRIPTION("VFIO AP device driver, Copyright IBM Corp. 2018");
MODULE_LICENSE("GPL v2");
-static struct ap_driver vfio_ap_drv;
-
struct ap_matrix_dev *matrix_dev;
/* Only type 10 adapters (CEX4 and later) are supported
@@ -80,6 +78,12 @@ static void vfio_ap_queue_dev_remove(struct ap_device *apdev)
mutex_unlock(&matrix_dev->lock);
}
+static struct ap_driver vfio_ap_drv = {
+ .probe = vfio_ap_queue_dev_probe,
+ .remove = vfio_ap_queue_dev_remove,
+ .ids = ap_queue_ids,
+};
+
static void vfio_ap_matrix_dev_release(struct device *dev)
{
struct ap_matrix_dev *matrix_dev = dev_get_drvdata(dev);
@@ -181,11 +185,6 @@ static int __init vfio_ap_init(void)
if (ret)
return ret;
- memset(&vfio_ap_drv, 0, sizeof(vfio_ap_drv));
- vfio_ap_drv.probe = vfio_ap_queue_dev_probe;
- vfio_ap_drv.remove = vfio_ap_queue_dev_remove;
- vfio_ap_drv.ids = ap_queue_ids;
-
ret = ap_driver_register(&vfio_ap_drv, THIS_MODULE, VFIO_AP_DRV_NAME);
if (ret) {
vfio_ap_matrix_dev_destroy();