[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240506194454.1160315-6-hca@linux.ibm.com>
Date: Mon, 6 May 2024 21:44:53 +0200
From: Heiko Carstens <hca@...ux.ibm.com>
To: Nathan Chancellor <nathan@...nel.org>, Arnd Bergmann <arnd@...db.de>,
Thomas Huth <thuth@...hat.com>,
Alexandra Winter <wintera@...ux.ibm.com>,
Thorsten Winkler <twinkler@...ux.ibm.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, linux-s390@...r.kernel.org,
Vasily Gorbik <gor@...ux.ibm.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>, netdev@...r.kernel.org,
llvm@...ts.linux.dev, patches@...ts.linux.dev,
Sven Schnelle <svens@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>
Subject: [PATCH 5/6] tty: hvc-iucv: Make use of iucv_alloc_device()
Make use of iucv_alloc_device() to get rid of quite some code.
Signed-off-by: Heiko Carstens <hca@...ux.ibm.com>
---
drivers/tty/hvc/hvc_iucv.c | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/drivers/tty/hvc/hvc_iucv.c b/drivers/tty/hvc/hvc_iucv.c
index b1149bc62ca1..ed4bf40278a7 100644
--- a/drivers/tty/hvc/hvc_iucv.c
+++ b/drivers/tty/hvc/hvc_iucv.c
@@ -1035,11 +1035,6 @@ static const struct attribute_group *hvc_iucv_dev_attr_groups[] = {
NULL,
};
-static void hvc_iucv_free(struct device *data)
-{
- kfree(data);
-}
-
/**
* hvc_iucv_alloc() - Allocates a new struct hvc_iucv_private instance
* @id: hvc_iucv_table index
@@ -1090,18 +1085,12 @@ static int __init hvc_iucv_alloc(int id, unsigned int is_console)
memcpy(priv->srv_name, name, 8);
ASCEBC(priv->srv_name, 8);
- /* create and setup device */
- priv->dev = kzalloc(sizeof(*priv->dev), GFP_KERNEL);
+ priv->dev = iucv_alloc_device(hvc_iucv_dev_attr_groups, NULL,
+ priv, "hvc_iucv%d", id);
if (!priv->dev) {
rc = -ENOMEM;
goto out_error_dev;
}
- dev_set_name(priv->dev, "hvc_iucv%d", id);
- dev_set_drvdata(priv->dev, priv);
- priv->dev->bus = &iucv_bus;
- priv->dev->parent = iucv_root;
- priv->dev->groups = hvc_iucv_dev_attr_groups;
- priv->dev->release = hvc_iucv_free;
rc = device_register(priv->dev);
if (rc) {
put_device(priv->dev);
--
2.40.1
Powered by blists - more mailing lists