From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34AD5C433B4 for ; Fri, 9 Apr 2021 07:35:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 03CC261107 for ; Fri, 9 Apr 2021 07:35:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231566AbhDIHgD (ORCPT ); Fri, 9 Apr 2021 03:36:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:58606 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229621AbhDIHgC (ORCPT ); Fri, 9 Apr 2021 03:36:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 71F2F61168; Fri, 9 Apr 2021 07:35:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617953749; bh=tUUyn5yye+9bPZTq8k5gPuCkJ7JDJSHxire3zJvNpSY=; h=From:To:Cc:Subject:Date:From; b=bJl/WbbGGP9ZGR4vUnZ19dw7oiC5g1gzuuWBboLh+bUf0pnB+GERUZ0HFNMZflQuJ AX9DTQ99/3B34PgAo/njIks+IllMiSiTeCd/XVd3tzPypoS5kI8u1Do1dQQ9VwuXXi 88JooGk2iJ6CXcR8E6bogFudNA57goNMdKXii99WcUdy4qVmFrQYLY4JTBaI1sCDzM /P5BSZ+pciujcpajL5uydMD2z0SROSc3qHxEzvIunTkCbwjWXjjDxCSTSdkOysKE1a eZXv1iZDs6gTTCwQciF6mUlFQURNbUWA0QYQQamlq9khHg2IZxMetwMduRfNnLOWxK ttv+tV9R3sqXw== Received: from johan by xi.lan with local (Exim 4.93.0.4) (envelope-from ) id 1lUlgA-0001ns-2S; Fri, 09 Apr 2021 09:35:46 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Jiri Slaby , Tetsuo Handa , linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH] tty: clarify that not all ttys have a class device Date: Fri, 9 Apr 2021 09:35:12 +0200 Message-Id: <20210409073512.6876-1-johan@kernel.org> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 30004ac9c090 ("tty: add tty_struct->dev pointer to corresponding device instance") added a struct device pointer field to struct tty_struct which was populated with the corresponding tty class device during initialisation. Unfortunately, not all ttys have a class device (e.g. pseudoterminals and serdev) in which case the device pointer will be set to NULL, something which have bit driver authors over the years. In retrospect perhaps this field should never have been added, but let's at least document the current behaviour. Signed-off-by: Johan Hovold --- include/linux/tty.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/tty.h b/include/linux/tty.h index 95fc2f100f12..178d8a3b18f2 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -284,7 +284,7 @@ struct tty_operations; struct tty_struct { int magic; struct kref kref; - struct device *dev; + struct device *dev; /* class device or NULL (e.g. ptys, serdev) */ struct tty_driver *driver; const struct tty_operations *ops; int index; -- 2.26.3