From patchwork Wed Feb 1 19:57:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian King X-Patchwork-Id: 649601 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EC3BC636D7 for ; Wed, 1 Feb 2023 19:58:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232147AbjBAT6L (ORCPT ); Wed, 1 Feb 2023 14:58:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232161AbjBAT6I (ORCPT ); Wed, 1 Feb 2023 14:58:08 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECF04BB8D for ; Wed, 1 Feb 2023 11:58:01 -0800 (PST) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 311JQ7ri007833; Wed, 1 Feb 2023 19:57:57 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=2xwKp84M79wmucUQK2UjfTEtoLiOx5WCvSxnoWSN6LM=; b=IIhOTyYdtWGO1xpYDAlsWDi/TEcsbwkCbviGIPPkQtiGrz5ibeX9P1BEbdtW6C46Lhha CN9Dwgd7WbcCBnpJmi0s3p0/PrR37/rA0jv96AlT2TANS6nbLDEaeidFS4pEs6zbgxom YwIGoQ2stgik4tpOyUJogtO8L95GyKkVfy7IuiyWAk4/N7pbPw7+BQGsiRItFUuZRF9k FQmRtZG+VSxBhciRukwfFrscmCTPaPFy4J6sgKL3YixjwqXHNhKdZexsku4Qv1A5jt1G QZSs48Z54jyBS+RP5+YfEzwdDsfure5SGv8EhhJpIDDpj/fevC14URIHFvOpDWRM1ofd lg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3nfx7tgpgd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Feb 2023 19:57:57 +0000 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 311JtglL006572; Wed, 1 Feb 2023 19:57:57 GMT Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3nfx7tgpg6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Feb 2023 19:57:57 +0000 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 311IlA1p006449; Wed, 1 Feb 2023 19:57:56 GMT Received: from smtprelay04.wdc07v.mail.ibm.com ([9.208.129.114]) by ppma01dal.us.ibm.com (PPS) with ESMTPS id 3ncvtmna1y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Feb 2023 19:57:56 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay04.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 311JvsK821627436 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 1 Feb 2023 19:57:54 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 881F658057; Wed, 1 Feb 2023 19:57:54 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0A3A158058; Wed, 1 Feb 2023 19:57:54 +0000 (GMT) Received: from li-6bf4d4cc-31f5-11b2-a85c-838e9310af65.ibm.com.com (unknown [9.211.132.88]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 1 Feb 2023 19:57:53 +0000 (GMT) From: Brian King To: gregkh@linuxfoundation.org Cc: linuxppc-dev@lists.ozlabs.org, brking@pobox.com, mmc@linux.vnet.ibm.com, linux-serial@vger.kernel.org, Brian King Subject: [PATCH 2/6] hvcs: Remove sysfs file prior to vio unregister Date: Wed, 1 Feb 2023 13:57:39 -0600 Message-Id: <20230201195743.303163-3-brking@linux.vnet.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230201195743.303163-1-brking@linux.vnet.ibm.com> References: <20230201195743.303163-1-brking@linux.vnet.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: dNNU49SsiWquxJ8rv9K1Ik9QTN6OvYiB X-Proofpoint-ORIG-GUID: QktLyNIGDxT7QblnIurXriRfLJkSxlU6 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-01_04,2023-01-31_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 bulkscore=0 mlxscore=0 clxscore=1015 phishscore=0 malwarescore=0 priorityscore=1501 adultscore=0 spamscore=0 lowpriorityscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302010166 Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org This moves the removal of the rescan sysfs attribute to occur before the call to unregister the vio to ensure the removal does not fail due to the vio driver already being freed. Signed-off-by: Brian King --- drivers/tty/hvc/hvcs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c index faf5ccfc561e..9131dcb2e8d8 100644 --- a/drivers/tty/hvc/hvcs.c +++ b/drivers/tty/hvc/hvcs.c @@ -1519,6 +1519,8 @@ static int __init hvcs_module_init(void) static void __exit hvcs_module_exit(void) { + driver_remove_file(&hvcs_vio_driver.driver, &driver_attr_rescan); + /* * This driver receives hvcs_remove callbacks for each device upon * module removal. @@ -1538,8 +1540,6 @@ static void __exit hvcs_module_exit(void) hvcs_pi_buff = NULL; spin_unlock(&hvcs_pi_lock); - driver_remove_file(&hvcs_vio_driver.driver, &driver_attr_rescan); - tty_unregister_driver(hvcs_tty_driver); hvcs_free_index_list();