summaryrefslogtreecommitdiffstats
path: root/drivers/s390/net
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--drivers/s390/net/ctcm_main.c2
-rw-r--r--drivers/s390/net/ism_drv.c2
-rw-r--r--drivers/s390/net/netiucv.c20
-rw-r--r--drivers/s390/net/smsgiucv_app.c21
4 files changed, 11 insertions, 34 deletions
diff --git a/drivers/s390/net/ctcm_main.c b/drivers/s390/net/ctcm_main.c
index 878fe3ce53..b93c2eb459 100644
--- a/drivers/s390/net/ctcm_main.c
+++ b/drivers/s390/net/ctcm_main.c
@@ -996,7 +996,7 @@ static int ctcm_change_mtu(struct net_device *dev, int new_mtu)
return -EINVAL;
dev->hard_header_len = LL_HEADER_LENGTH + 2;
}
- dev->mtu = new_mtu;
+ WRITE_ONCE(dev->mtu, new_mtu);
return 0;
}
diff --git a/drivers/s390/net/ism_drv.c b/drivers/s390/net/ism_drv.c
index 43778b088f..e36e3ea165 100644
--- a/drivers/s390/net/ism_drv.c
+++ b/drivers/s390/net/ism_drv.c
@@ -745,7 +745,7 @@ static int smcd_query_rgid(struct smcd_dev *smcd, struct smcd_gid *rgid,
}
static int smcd_register_dmb(struct smcd_dev *smcd, struct smcd_dmb *dmb,
- struct ism_client *client)
+ void *client)
{
return ism_register_dmb(smcd->priv, (struct ism_dmb *)dmb, client);
}
diff --git a/drivers/s390/net/netiucv.c b/drivers/s390/net/netiucv.c
index 8852b03f94..039e18d46f 100644
--- a/drivers/s390/net/netiucv.c
+++ b/drivers/s390/net/netiucv.c
@@ -1696,26 +1696,14 @@ static const struct attribute_group *netiucv_attr_groups[] = {
static int netiucv_register_device(struct net_device *ndev)
{
struct netiucv_priv *priv = netdev_priv(ndev);
- struct device *dev = kzalloc(sizeof(struct device), GFP_KERNEL);
+ struct device *dev;
int ret;
IUCV_DBF_TEXT(trace, 3, __func__);
- if (dev) {
- dev_set_name(dev, "net%s", ndev->name);
- dev->bus = &iucv_bus;
- dev->parent = iucv_root;
- dev->groups = netiucv_attr_groups;
- /*
- * The release function could be called after the
- * module has been unloaded. It's _only_ task is to
- * free the struct. Therefore, we specify kfree()
- * directly here. (Probably a little bit obfuscating
- * but legitime ...).
- */
- dev->release = (void (*)(struct device *))kfree;
- dev->driver = &netiucv_driver;
- } else
+ dev = iucv_alloc_device(netiucv_attr_groups, &netiucv_driver, NULL,
+ "net%s", ndev->name);
+ if (!dev)
return -ENOMEM;
ret = device_register(dev);
diff --git a/drivers/s390/net/smsgiucv_app.c b/drivers/s390/net/smsgiucv_app.c
index 0a263999f7..cc44cbb002 100644
--- a/drivers/s390/net/smsgiucv_app.c
+++ b/drivers/s390/net/smsgiucv_app.c
@@ -156,25 +156,14 @@ static int __init smsgiucv_app_init(void)
if (!MACHINE_IS_VM)
return -ENODEV;
- smsg_app_dev = kzalloc(sizeof(*smsg_app_dev), GFP_KERNEL);
- if (!smsg_app_dev)
- return -ENOMEM;
-
smsgiucv_drv = driver_find(SMSGIUCV_DRV_NAME, &iucv_bus);
- if (!smsgiucv_drv) {
- kfree(smsg_app_dev);
+ if (!smsgiucv_drv)
return -ENODEV;
- }
- rc = dev_set_name(smsg_app_dev, KMSG_COMPONENT);
- if (rc) {
- kfree(smsg_app_dev);
- goto fail;
- }
- smsg_app_dev->bus = &iucv_bus;
- smsg_app_dev->parent = iucv_root;
- smsg_app_dev->release = (void (*)(struct device *)) kfree;
- smsg_app_dev->driver = smsgiucv_drv;
+ smsg_app_dev = iucv_alloc_device(NULL, smsgiucv_drv, NULL, KMSG_COMPONENT);
+ if (!smsg_app_dev)
+ return -ENOMEM;
+
rc = device_register(smsg_app_dev);
if (rc) {
put_device(smsg_app_dev);