mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-21 17:09:44 +07:00
f11afb6124
The goal is to stop setting and using tty->driver_data in devpts code. It should be used solely by the driver's code, pty in this case. Now driver_data are managed only in the pty driver. devpts_pty_new is switched to accept what we used to dig out of tty_struct, i.e. device node number and index. This also removes a note about driver_data being set outside of the driver. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
50 lines
1.4 KiB
C
50 lines
1.4 KiB
C
/* -*- linux-c -*- --------------------------------------------------------- *
|
|
*
|
|
* linux/include/linux/devpts_fs.h
|
|
*
|
|
* Copyright 1998-2004 H. Peter Anvin -- All Rights Reserved
|
|
*
|
|
* This file is part of the Linux kernel and is made available under
|
|
* the terms of the GNU General Public License, version 2, or at your
|
|
* option, any later version, incorporated herein by reference.
|
|
*
|
|
* ------------------------------------------------------------------------- */
|
|
|
|
#ifndef _LINUX_DEVPTS_FS_H
|
|
#define _LINUX_DEVPTS_FS_H
|
|
|
|
#include <linux/errno.h>
|
|
|
|
#ifdef CONFIG_UNIX98_PTYS
|
|
|
|
int devpts_new_index(struct inode *ptmx_inode);
|
|
void devpts_kill_index(struct inode *ptmx_inode, int idx);
|
|
/* mknod in devpts */
|
|
struct inode *devpts_pty_new(struct inode *ptmx_inode, dev_t device, int index,
|
|
void *priv);
|
|
/* get private structure */
|
|
void *devpts_get_priv(struct inode *pts_inode);
|
|
/* unlink */
|
|
void devpts_pty_kill(struct inode *inode);
|
|
|
|
#else
|
|
|
|
/* Dummy stubs in the no-pty case */
|
|
static inline int devpts_new_index(struct inode *ptmx_inode) { return -EINVAL; }
|
|
static inline void devpts_kill_index(struct inode *ptmx_inode, int idx) { }
|
|
static inline struct inode *devpts_pty_new(struct inode *ptmx_inode,
|
|
dev_t device, int index, void *priv)
|
|
{
|
|
return ERR_PTR(-EINVAL);
|
|
}
|
|
static inline void *devpts_get_priv(struct inode *pts_inode)
|
|
{
|
|
return NULL;
|
|
}
|
|
static inline void devpts_pty_kill(struct inode *inode) { }
|
|
|
|
#endif
|
|
|
|
|
|
#endif /* _LINUX_DEVPTS_FS_H */
|