Skip to content

Commit 4baee93

Browse files
superna9999davem330
authored andcommitted
net: dsa: remove DSA link polling
Since no more DSA driver uses the polling callback, and since the phylib handles the link detection, remove the link polling work and timer code. Signed-off-by: Neil Armstrong <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ad9360b commit 4baee93

File tree

2 files changed

+0
-55
lines changed

2 files changed

+0
-55
lines changed

include/net/dsa.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,6 @@ struct dsa_switch_tree {
116116
s8 cpu_switch;
117117
s8 cpu_port;
118118

119-
/*
120-
* Link state polling.
121-
*/
122-
int link_poll_needed;
123-
struct work_struct link_poll_work;
124-
struct timer_list link_poll_timer;
125-
126119
/*
127120
* Data for the individual switch chips.
128121
*/
@@ -231,11 +224,6 @@ struct dsa_switch_driver {
231224
int (*phy_write)(struct dsa_switch *ds, int port,
232225
int regnum, u16 val);
233226

234-
/*
235-
* Link state polling and IRQ handling.
236-
*/
237-
void (*poll_link)(struct dsa_switch *ds);
238-
239227
/*
240228
* Link state adjustment (called from libphy)
241229
*/

net/dsa/dsa.c

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -508,33 +508,6 @@ static int dsa_switch_resume(struct dsa_switch *ds)
508508
}
509509
#endif
510510

511-
512-
/* link polling *************************************************************/
513-
static void dsa_link_poll_work(struct work_struct *ugly)
514-
{
515-
struct dsa_switch_tree *dst;
516-
int i;
517-
518-
dst = container_of(ugly, struct dsa_switch_tree, link_poll_work);
519-
520-
for (i = 0; i < dst->pd->nr_chips; i++) {
521-
struct dsa_switch *ds = dst->ds[i];
522-
523-
if (ds != NULL && ds->drv->poll_link != NULL)
524-
ds->drv->poll_link(ds);
525-
}
526-
527-
mod_timer(&dst->link_poll_timer, round_jiffies(jiffies + HZ));
528-
}
529-
530-
static void dsa_link_poll_timer(unsigned long _dst)
531-
{
532-
struct dsa_switch_tree *dst = (void *)_dst;
533-
534-
schedule_work(&dst->link_poll_work);
535-
}
536-
537-
538511
/* platform driver init and cleanup *****************************************/
539512
static int dev_is_class(struct device *dev, void *class)
540513
{
@@ -877,8 +850,6 @@ static int dsa_setup_dst(struct dsa_switch_tree *dst, struct net_device *dev,
877850
}
878851

879852
dst->ds[i] = ds;
880-
if (ds->drv->poll_link != NULL)
881-
dst->link_poll_needed = 1;
882853

883854
++configured;
884855
}
@@ -897,15 +868,6 @@ static int dsa_setup_dst(struct dsa_switch_tree *dst, struct net_device *dev,
897868
wmb();
898869
dev->dsa_ptr = (void *)dst;
899870

900-
if (dst->link_poll_needed) {
901-
INIT_WORK(&dst->link_poll_work, dsa_link_poll_work);
902-
init_timer(&dst->link_poll_timer);
903-
dst->link_poll_timer.data = (unsigned long)dst;
904-
dst->link_poll_timer.function = dsa_link_poll_timer;
905-
dst->link_poll_timer.expires = round_jiffies(jiffies + HZ);
906-
add_timer(&dst->link_poll_timer);
907-
}
908-
909871
return 0;
910872
}
911873

@@ -972,11 +934,6 @@ static void dsa_remove_dst(struct dsa_switch_tree *dst)
972934
{
973935
int i;
974936

975-
if (dst->link_poll_needed)
976-
del_timer_sync(&dst->link_poll_timer);
977-
978-
flush_work(&dst->link_poll_work);
979-
980937
for (i = 0; i < dst->pd->nr_chips; i++) {
981938
struct dsa_switch *ds = dst->ds[i];
982939

0 commit comments

Comments
 (0)