Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
70f7aa08
Commit
70f7aa08
authored
May 13, 2004
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
USB: remove magic number field from usb_serial_port as it's pretty useless.
parent
5e738ff1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
9 deletions
+1
-9
drivers/usb/serial/usb-serial.c
drivers/usb/serial/usb-serial.c
+0
-1
drivers/usb/serial/usb-serial.h
drivers/usb/serial/usb-serial.h
+1
-8
No files found.
drivers/usb/serial/usb-serial.c
View file @
70f7aa08
...
@@ -1117,7 +1117,6 @@ int usb_serial_probe(struct usb_interface *interface,
...
@@ -1117,7 +1117,6 @@ int usb_serial_probe(struct usb_interface *interface,
memset
(
port
,
0x00
,
sizeof
(
struct
usb_serial_port
));
memset
(
port
,
0x00
,
sizeof
(
struct
usb_serial_port
));
port
->
number
=
i
+
serial
->
minor
;
port
->
number
=
i
+
serial
->
minor
;
port
->
serial
=
serial
;
port
->
serial
=
serial
;
port
->
magic
=
USB_SERIAL_PORT_MAGIC
;
INIT_WORK
(
&
port
->
work
,
usb_serial_port_softint
,
port
);
INIT_WORK
(
&
port
->
work
,
usb_serial_port_softint
,
port
);
serial
->
port
[
i
]
=
port
;
serial
->
port
[
i
]
=
port
;
}
}
...
...
drivers/usb/serial/usb-serial.h
View file @
70f7aa08
...
@@ -63,14 +63,12 @@
...
@@ -63,14 +63,12 @@
#define MAX_NUM_PORTS 8
/* The maximum number of ports one device can grab at once */
#define MAX_NUM_PORTS 8
/* The maximum number of ports one device can grab at once */
#define USB_SERIAL_MAGIC 0x6702
/* magic number for usb_serial struct */
#define USB_SERIAL_MAGIC 0x6702
/* magic number for usb_serial struct */
#define USB_SERIAL_PORT_MAGIC 0x7301
/* magic number for usb_serial_port struct */
/* parity check flag */
/* parity check flag */
#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
#define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
/**
/**
* usb_serial_port: structure for the specific ports of a device.
* usb_serial_port: structure for the specific ports of a device.
* @magic: magic number for internal validity of this pointer.
* @serial: pointer back to the struct usb_serial owner of this port.
* @serial: pointer back to the struct usb_serial owner of this port.
* @tty: pointer to the corresponding tty for this port.
* @tty: pointer to the corresponding tty for this port.
* @number: the number of the port (the minor number).
* @number: the number of the port (the minor number).
...
@@ -95,8 +93,7 @@
...
@@ -95,8 +93,7 @@
* ports of a device.
* ports of a device.
*/
*/
struct
usb_serial_port
{
struct
usb_serial_port
{
int
magic
;
struct
usb_serial
*
serial
;
struct
usb_serial
*
serial
;
struct
tty_struct
*
tty
;
struct
tty_struct
*
tty
;
unsigned
char
number
;
unsigned
char
number
;
...
@@ -327,10 +324,6 @@ static inline int port_paranoia_check (struct usb_serial_port *port, const char
...
@@ -327,10 +324,6 @@ static inline int port_paranoia_check (struct usb_serial_port *port, const char
dbg
(
"%s - port == NULL"
,
function
);
dbg
(
"%s - port == NULL"
,
function
);
return
-
1
;
return
-
1
;
}
}
if
(
port
->
magic
!=
USB_SERIAL_PORT_MAGIC
)
{
dbg
(
"%s - bad magic number for port"
,
function
);
return
-
1
;
}
if
(
!
port
->
serial
)
{
if
(
!
port
->
serial
)
{
dbg
(
"%s - port->serial == NULL"
,
function
);
dbg
(
"%s - port->serial == NULL"
,
function
);
return
-
1
;
return
-
1
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment