Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp940913pxb; Wed, 3 Mar 2021 21:54:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJxFxJS0/Z5X1fGWcqCX+oOfZgOltWOpRiaoAP8i6MjGnI4aJJ79GDrOYD4v4b2J/dcwZ3zu X-Received: by 2002:a05:6402:17e3:: with SMTP id t3mr2527701edy.317.1614837240274; Wed, 03 Mar 2021 21:54:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614837240; cv=none; d=google.com; s=arc-20160816; b=VlWG/DtGSZq0rFvjbmWTH+npeEylNa7K5BS0qlb2YL8c6fu3oijdKjAinCwa10Amfl 9kwKfh0QKqFJ05Txop+Ol2B/1Zd5cAuNMVdsPIMRngAv/Z4UccMOJajlG2OHXuGdX6KA RZqxJoO8+rgiAEMv291/1WBKBpZeSH14J8qosvR1EXbeOQvae2KKeJmNFGKeCW3DUwvF O8y9zh8/hrq0086yg7eV2I+ffQBTzFqGMX9fo6kKvrxw/sUxoOWmUNy4NAZEqAyXthM8 /BeQM9CpTx64twXMSESPIrJIpBr592Z80lTtamepmt9MS1C6mANLZMSi7XAHWZJfDfPN oogw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=MeyKHlsTcXGrKwltbGy7YC3Wsxgt8jdgId0eXfbwp64=; b=xbn0M9eupJwZ/6SFWQy8M1nl6QYPTecPxjMAOmfhaWq1VUjvUnJF+LSQNOfxC5DgGM AjxIWrPgtZNMk6EC7FYCk2DK/ikFsooIws2NPSByC0+xFCgQC/Q4aHDDOvkVlIb7XF4v tq25/Oo0C2h8dhcx65yerpO40woilpCadG8rVsnd4gtSqGkTNbJ/BrHFOEjmv3Q03dcG AD3CjzPQ/bJeE8Lme3DMGlYhlfygE+gA7MbWBlTVhbXCiQukezFZdLoP/4DuNb3Xra1J txj7A0zi0JSquIl3Oa93nDAmSvwQC8R/21OXl9704t1WxawrIpWSQ0pJcij9W8TvWp3F uNeg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z22si15531849edx.180.2021.03.03.21.53.38; Wed, 03 Mar 2021 21:54:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1381372AbhCBHR5 (ORCPT + 99 others); Tue, 2 Mar 2021 02:17:57 -0500 Received: from mx2.suse.de ([195.135.220.15]:39930 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1835897AbhCBGZB (ORCPT ); Tue, 2 Mar 2021 01:25:01 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 9F106B03A; Tue, 2 Mar 2021 06:22:21 +0000 (UTC) From: Jiri Slaby To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Slaby Subject: [PATCH 35/44] tty: let tty_unregister_driver return void Date: Tue, 2 Mar 2021 07:22:05 +0100 Message-Id: <20210302062214.29627-35-jslaby@suse.cz> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210302062214.29627-1-jslaby@suse.cz> References: <20210302062214.29627-1-jslaby@suse.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that noone checks the return value, switch the return type of tty_unregister_driver to void. We can do that as we always return zero. Generally, drivers are not allowed to call tty_unregister_driver while there are open devices. Signed-off-by: Jiri Slaby --- drivers/tty/tty_io.c | 9 +-------- include/linux/tty.h | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 74733ec8f565..c8cbf08b6dcf 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c @@ -3525,21 +3525,14 @@ EXPORT_SYMBOL(tty_register_driver); /* * Called by a tty driver to unregister itself. */ -int tty_unregister_driver(struct tty_driver *driver) +void tty_unregister_driver(struct tty_driver *driver) { -#if 0 - /* FIXME */ - if (driver->refcount) - return -EBUSY; -#endif unregister_chrdev_region(MKDEV(driver->major, driver->minor_start), driver->num); mutex_lock(&tty_mutex); list_del(&driver->tty_drivers); mutex_unlock(&tty_mutex); - return 0; } - EXPORT_SYMBOL(tty_unregister_driver); dev_t tty_devnum(struct tty_struct *tty) diff --git a/include/linux/tty.h b/include/linux/tty.h index 95fc2f100f12..51f56e5ec955 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -482,7 +482,7 @@ extern void stop_tty(struct tty_struct *tty); extern void __start_tty(struct tty_struct *tty); extern void start_tty(struct tty_struct *tty); extern int tty_register_driver(struct tty_driver *driver); -extern int tty_unregister_driver(struct tty_driver *driver); +extern void tty_unregister_driver(struct tty_driver *driver); extern struct device *tty_register_device(struct tty_driver *driver, unsigned index, struct device *dev); extern struct device *tty_register_device_attr(struct tty_driver *driver, -- 2.30.1