/* Called when a device is downed. Just throw away any routes via it.  */
static void atrtr_device_down(struct net_device *dev)
/* Called when a device is downed. Just throw away any routes via it.  */
static void atrtr_device_down(struct net_device *dev)
{
	struct atalk_route **r = &atalk_routes;
	struct atalk_route *tmp;
	write_lock_bh(&atalk_routes_lock);
	while ((tmp = *r) != NULL) {
		if (tmp->dev == dev) {
			*r = tmp->next;
			dev_put(dev);
			kfree(tmp);
		} else
			r = &tmp->next;
	}
	write_unlock_bh(&atalk_routes_lock);
	if (atrtr_default.dev == dev)
		atrtr_set_default(NULL);
}