Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp107133lqh; Mon, 6 May 2024 12:48:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVpH3pQWMWIWpbHcF6folfz8tV+2j2/ywcFrecpdTceS72vncbYKfXe+CpmyT9Zpgwid3HKHOOBrpous7660/EVT2+JrjthAKd+hp6D5g== X-Google-Smtp-Source: AGHT+IE8U+AJaLSIJ4VET4Bhp9LjxJYhiOT1kfWuyveKOTDtp7LG8yCI8DEShCvF1M8VMkbnDf4F X-Received: by 2002:a05:6870:d214:b0:23d:4207:235f with SMTP id g20-20020a056870d21400b0023d4207235fmr12484786oac.52.1715024886398; Mon, 06 May 2024 12:48:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715024886; cv=pass; d=google.com; s=arc-20160816; b=VX5iq0tAmcpWr49yuezmkr7CKVsQSflWdRAdp2ZH/iZeXWpcsCpJcSq8l3S+xrS6Sr cs26JvGinjd78D1LQdN8rKl19MFqEAsB0Uo12YMg8mVzYPncvyj95sGA+2GDmCfY/5B0 /SkwVANT8RvKlUTZzL0hUkhgjxM6FeoPEd/KyhIgNliY1Tt44hxvJuDFH/0d8VNZWmb8 +LLsgFOwU8QG1i/yvVZQvcTHarHcCvAZFfq+snt/Z0+oCAfdaDSJ2a3j6sBW3U4QSuAr QOUXOuGDBqIuqz+opJACcbqB+mBKraqIYOdXqDFNmtbk+ylnVxT55PPO6+wRMkKPseZe zMLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=2PvoPCDO8nol9n2uO9aGwkRni06cXrRjL/lIHpG13do=; fh=+ublBM+9GGWYoKbssKiMLEYTC/PmLwBCGlvV+Nagl9Q=; b=sePwRxWIZT6mJR0oemuE0qV5kuu43yV8K9uYAvlWEjxA83tASOBRZTs+HfG2V7fkTr HB2HyVb5YzV6KVbgJmtjHg3zKoMgegptid46Ta2+VWoey9eci89Y2x6tOLce0mR6oWc+ W5qbwZcRWLOCwcUPOAGzGXRgfyEBZFbsM0GMsNQMoxrCmMAmXnIKu0yoArnqA1puvxTu cg3xscpM84uh0tNLIHvT93GI3Tz6p5dR7iuqnt1w23E8jtduq+MBBZAJR8NNxjE8YRKo D62Jgm9WX11lxB1VwhuOcxJuSTOMLVffSbobhT27M/MfQtV/4qS6uPMYPQcXPoU+3T8+ EKIw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Gr5qyrjU; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-170370-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170370-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id a73-20020a63904c000000b00624eaab2520si3602370pge.687.2024.05.06.12.48.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 12:48:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170370-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Gr5qyrjU; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-170370-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170370-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id F23E62811E2 for ; Mon, 6 May 2024 19:48:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1CBCA15E5D3; Mon, 6 May 2024 19:45:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="Gr5qyrjU" Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33E8C15B12B; Mon, 6 May 2024 19:45:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715024713; cv=none; b=PvN4Kl/vMvH29mFAnxV6MLxRhyC9SjyU6Q9EhwsJ8WwDlWToiauHuF3YidBkYx8yms/YEZkLtDoCw/YuCu3Y4mbKlrXS+xaYw4o7lKZAqI115tp9inwQVEtdiVtxbihVboxXacy+MTl76VyIE/bJotdXpos2fly8c30+83r26xs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715024713; c=relaxed/simple; bh=hobxgUa9md8vhEMYysjs2d0rh4MHe2RJutk0e+kK8io=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hk5J72qlch2xAisFDDQ23DyBGaJIYmnfQ0tYbhaWCRRdFZ/zGyLbDK9m5DyGr+ZjzJ314LbIIWSOb0WjTjwp3pgbGiCcyyqaVi5Xxi2AoiKYhZMS81B1jgdyKvaZxdL40BGSSP32G5jcsGYL0UW+RasWuzHutGduzKDrA+pk2Lc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=Gr5qyrjU; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 446JbPe2030879; Mon, 6 May 2024 19:45:03 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=2PvoPCDO8nol9n2uO9aGwkRni06cXrRjL/lIHpG13do=; b=Gr5qyrjUrZju2ZUW3sEd4M/ZjZ/EBeVpqTwoEUOgynbIHjGckZtr+TuZwMxe3oeqV4Cj LL2jNYyHjFR55MHZ8FvwfcTiORsdMITGVQYrwNe++/lUyxn3i96y+AUtdB1pEfWrB9uj xEdLyR9Nl2ageRbHJ8f/WCRo87S2ox/nOsiySLn7SLvSrkPPLryB0rQkQvGnqOwtWzKl kOq1kEFYPZ2/gK8uU2e/WfJbbys+M4bZ1AhDYj6WEAcNbjOThICkK2t5K4Z2WgVqXFK+ bEZQmGRpbmw7SP6sPZC4CyfHvIEmuSb+BKwkD7IV7MwktQNgoXWOc6cjrNNlBmHPL7UZ yQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3xy5h5g0jv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 May 2024 19:45:03 +0000 Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 446Jj2CI011624; Mon, 6 May 2024 19:45:02 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3xy5h5g0jr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 May 2024 19:45:02 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 446I8lp0030881; Mon, 6 May 2024 19:45:01 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3xwybtt4mt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 May 2024 19:45:01 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 446JiuMH44630448 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 May 2024 19:44:58 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2BCAB20063; Mon, 6 May 2024 19:44:56 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id ECBE820065; Mon, 6 May 2024 19:44:55 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 6 May 2024 19:44:55 +0000 (GMT) From: Heiko Carstens To: Nathan Chancellor , Arnd Bergmann , Thomas Huth , Alexandra Winter , Thorsten Winkler , Andrew Morton , Jiri Slaby , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Vasily Gorbik , Alexander Gordeev , netdev@vger.kernel.org, llvm@lists.linux.dev, patches@lists.linux.dev, Sven Schnelle , Christian Borntraeger Subject: [PATCH 5/6] tty: hvc-iucv: Make use of iucv_alloc_device() Date: Mon, 6 May 2024 21:44:53 +0200 Message-Id: <20240506194454.1160315-6-hca@linux.ibm.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240506194454.1160315-1-hca@linux.ibm.com> References: <20240506194454.1160315-1-hca@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: fhGfvkRjpd2GrMBCIBWnVL5W7MqX9c8H X-Proofpoint-ORIG-GUID: GmAuUpDS5E85UqLlW5dJPlfD_P6SJ_aC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-06_14,2024-05-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxlogscore=999 priorityscore=1501 bulkscore=0 spamscore=0 adultscore=0 phishscore=0 suspectscore=0 malwarescore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2404010000 definitions=main-2405060142 Make use of iucv_alloc_device() to get rid of quite some code. Signed-off-by: Heiko Carstens --- 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