Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kirill Smelkov
linux
Commits
e5b4956d
Commit
e5b4956d
authored
21 years ago
by
Stephen Hemminger
Browse files
Options
Download
Email Patches
Plain Diff
[NET]: Mark dev_alloc as deprecated.
parent
52752ef9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
include/linux/netdevice.h
include/linux/netdevice.h
+5
-1
net/core/dev.c
net/core/dev.c
+4
-3
No files found.
include/linux/netdevice.h
View file @
e5b4956d
...
...
@@ -511,7 +511,11 @@ extern struct net_device *__dev_get_by_flags(unsigned short flags,
unsigned
short
mask
);
extern
struct
net_device
*
dev_get_by_name
(
const
char
*
name
);
extern
struct
net_device
*
__dev_get_by_name
(
const
char
*
name
);
extern
struct
net_device
*
dev_alloc
(
const
char
*
name
,
int
*
err
);
extern
struct
net_device
*
__dev_alloc
(
const
char
*
name
,
int
*
err
);
static
inline
__deprecated
struct
net_device
*
dev_alloc
(
const
char
*
name
,
int
*
err
)
{
return
__dev_alloc
(
name
,
err
);
}
extern
int
dev_alloc_name
(
struct
net_device
*
dev
,
const
char
*
name
);
extern
int
dev_open
(
struct
net_device
*
dev
);
extern
int
dev_close
(
struct
net_device
*
dev
);
...
...
This diff is collapsed.
Click to expand it.
net/core/dev.c
View file @
e5b4956d
...
...
@@ -646,11 +646,12 @@ int dev_alloc_name(struct net_device *dev, const char *name)
* failed. The cause of an error is returned as a negative errno code
* in the variable @err points to.
*
* The caller must hold the @dev_base or RTNL locks when doing this in
* This call is deprecated in favor of alloc_netdev because
* the caller must hold the @dev_base or RTNL locks when doing this in
* order to avoid duplicate name allocations.
*/
struct
net_device
*
dev_alloc
(
const
char
*
name
,
int
*
err
)
struct
net_device
*
__
dev_alloc
(
const
char
*
name
,
int
*
err
)
{
struct
net_device
*
dev
=
kmalloc
(
sizeof
(
*
dev
),
GFP_KERNEL
);
...
...
@@ -2997,7 +2998,7 @@ EXPORT_SYMBOL(__dev_remove_pack);
EXPORT_SYMBOL
(
__skb_linearize
);
EXPORT_SYMBOL
(
call_netdevice_notifiers
);
EXPORT_SYMBOL
(
dev_add_pack
);
EXPORT_SYMBOL
(
dev_alloc
);
EXPORT_SYMBOL
(
__
dev_alloc
);
EXPORT_SYMBOL
(
dev_alloc_name
);
EXPORT_SYMBOL
(
dev_close
);
EXPORT_SYMBOL
(
dev_get_by_flags
);
...
...
This diff is collapsed.
Click to expand it.
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