Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp939768pxb; Wed, 3 Mar 2021 21:51:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJyrln7a3G0f8WWpsovrsoZtbLrwOZtHRvX7vyL+XzLISGPW+eiQfpIWhKQxeh6bI7Gm+V8u X-Received: by 2002:a05:6402:5250:: with SMTP id t16mr2564517edd.302.1614837070527; Wed, 03 Mar 2021 21:51:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614837070; cv=none; d=google.com; s=arc-20160816; b=LcgOZkL2tdCIKTypkaD6leO7GYw42lmWI3V5dEYoc3ICcUFKJRo4qB2F/JKeNuv29m AgzW7WuTvMOJFSkm9ognvfR5D0qOZhtGRJcDrjHExDXEeslDD4MSGNycnDgt3x/T2BDg 6rGU2dKUaeqHmX4XdREZ4TQYrgHQ8ALppFdMv1beadmEsgYn+FlsCObyGihrQTsfRFQF f/TNFpQnZbI9Cnx16eO46tqkFmtOMu8IIxHeB8hT3i0x3euPLxOtbhBaQWTZFp+MpwKN wJqhNep7VgvUhQRoEyWS15Ijz/QSUiUvJHl63rzLXWh2gVPdsnszqUsfzZxj/lBCp+EE EdzA== 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=34AYS/dpkJBrt+i+LrfRK5lWEperImceVY61tg24tIY=; b=krvHqkXs7bxWV4IB3SWIx83UXCDaXxIjTOkTtUrcHACF6ZZmcx42mxwviXRuNdGqVb MNNJ22Yp7wYa77QFazJDnH3Z48Oa4jj5+RoVJRAmQnwcSb+ctfu93giN+O5SwcJ1/Izr SnRmIwLCaZzKGkOuitQPPTHZ1RB7vy0yTmyaofpDEDOfG2f+Oro6UHHAxJMobgxg6MHO 6b6fnYf2EG0uB5wT8fzAwVZTwlyQ4XaE9tv9BLe/qhWd06MgY9kVPlSsqC3wfrr3fZCP 27uw0tgysMGXDbqbBITqp9/jyyRST+KPJ4rbFIfEj6uzt05AxMBOnwiEX3xsITVIuOIm yyWg== 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 e10si14153161ejk.173.2021.03.03.21.50.48; Wed, 03 Mar 2021 21:51:10 -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 S1349355AbhCBHP2 (ORCPT + 99 others); Tue, 2 Mar 2021 02:15:28 -0500 Received: from mx2.suse.de ([195.135.220.15]:39636 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1835866AbhCBGX7 (ORCPT ); Tue, 2 Mar 2021 01:23:59 -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 D963FAFD7; Tue, 2 Mar 2021 06:22:17 +0000 (UTC) From: Jiri Slaby To: gregkh@linuxfoundation.org Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Jiri Slaby , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org Subject: [PATCH 14/44] net: caif: inline register_ldisc Date: Tue, 2 Mar 2021 07:21:44 +0100 Message-Id: <20210302062214.29627-14-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 register_ldisc only calls tty_register_ldisc. Inline register_ldisc into the only caller of register_ldisc, i.e. caif_ser_init. Now, caif_ser_init is symmetric to caif_ser_exit in this regard. Signed-off-by: Jiri Slaby Cc: "David S. Miller" Cc: Jakub Kicinski Cc: netdev@vger.kernel.org --- drivers/net/caif/caif_serial.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c index 675c374b32ee..da6fffb4d5a8 100644 --- a/drivers/net/caif/caif_serial.c +++ b/drivers/net/caif/caif_serial.c @@ -389,18 +389,6 @@ static struct tty_ldisc_ops caif_ldisc = { .write_wakeup = ldisc_tx_wakeup }; -static int register_ldisc(void) -{ - int result; - - result = tty_register_ldisc(N_CAIF, &caif_ldisc); - if (result < 0) { - pr_err("cannot register CAIF ldisc=%d err=%d\n", N_CAIF, - result); - return result; - } - return result; -} static const struct net_device_ops netdev_ops = { .ndo_open = caif_net_open, .ndo_stop = caif_net_close, @@ -443,7 +431,10 @@ static int __init caif_ser_init(void) { int ret; - ret = register_ldisc(); + ret = tty_register_ldisc(N_CAIF, &caif_ldisc); + if (ret < 0) + pr_err("cannot register CAIF ldisc=%d err=%d\n", N_CAIF, ret); + debugfsdir = debugfs_create_dir("caif_serial", NULL); return ret; } -- 2.30.1