mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-05 12:52:37 +01:00
netdev: Drop redundant netdev_get_device checks
As a consequence of the previous commit, netdev watches are always called when the device object is valid. As a result, we can drop the netdev_get_device calls and checks from individual AP/AdHoc/Station/WSC netdev watches
This commit is contained in:
parent
916bde3a02
commit
7eb59602df
@ -540,11 +540,6 @@ static void adhoc_remove_interface(struct netdev *netdev)
|
|||||||
static void adhoc_netdev_watch(struct netdev *netdev,
|
static void adhoc_netdev_watch(struct netdev *netdev,
|
||||||
enum netdev_watch_event event, void *userdata)
|
enum netdev_watch_event event, void *userdata)
|
||||||
{
|
{
|
||||||
struct device *device = netdev_get_device(netdev);
|
|
||||||
|
|
||||||
if (!device)
|
|
||||||
return;
|
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case NETDEV_WATCH_EVENT_UP:
|
case NETDEV_WATCH_EVENT_UP:
|
||||||
case NETDEV_WATCH_EVENT_NEW:
|
case NETDEV_WATCH_EVENT_NEW:
|
||||||
|
5
src/ap.c
5
src/ap.c
@ -1452,11 +1452,6 @@ static void ap_remove_interface(struct netdev *netdev)
|
|||||||
static void ap_netdev_watch(struct netdev *netdev,
|
static void ap_netdev_watch(struct netdev *netdev,
|
||||||
enum netdev_watch_event event, void *userdata)
|
enum netdev_watch_event event, void *userdata)
|
||||||
{
|
{
|
||||||
struct device *device = netdev_get_device(netdev);
|
|
||||||
|
|
||||||
if (!device)
|
|
||||||
return;
|
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case NETDEV_WATCH_EVENT_UP:
|
case NETDEV_WATCH_EVENT_UP:
|
||||||
case NETDEV_WATCH_EVENT_NEW:
|
case NETDEV_WATCH_EVENT_NEW:
|
||||||
|
@ -2322,11 +2322,6 @@ static void station_destroy_interface(void *user_data)
|
|||||||
static void station_netdev_watch(struct netdev *netdev,
|
static void station_netdev_watch(struct netdev *netdev,
|
||||||
enum netdev_watch_event event, void *userdata)
|
enum netdev_watch_event event, void *userdata)
|
||||||
{
|
{
|
||||||
struct device *device = netdev_get_device(netdev);
|
|
||||||
|
|
||||||
if (!device)
|
|
||||||
return;
|
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case NETDEV_WATCH_EVENT_UP:
|
case NETDEV_WATCH_EVENT_UP:
|
||||||
case NETDEV_WATCH_EVENT_NEW:
|
case NETDEV_WATCH_EVENT_NEW:
|
||||||
|
@ -1080,11 +1080,6 @@ static void wsc_remove_interface(struct netdev *netdev)
|
|||||||
static void wsc_netdev_watch(struct netdev *netdev,
|
static void wsc_netdev_watch(struct netdev *netdev,
|
||||||
enum netdev_watch_event event, void *userdata)
|
enum netdev_watch_event event, void *userdata)
|
||||||
{
|
{
|
||||||
struct device *device = netdev_get_device(netdev);
|
|
||||||
|
|
||||||
if (!device)
|
|
||||||
return;
|
|
||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
case NETDEV_WATCH_EVENT_UP:
|
case NETDEV_WATCH_EVENT_UP:
|
||||||
case NETDEV_WATCH_EVENT_NEW:
|
case NETDEV_WATCH_EVENT_NEW:
|
||||||
|
Loading…
Reference in New Issue
Block a user