Skip to content

Commit 0391334

Browse files
committed
xtensa: iss/network: drop 'devices' list
There are two per-device lists in the ISS network driver: command line parameters list and iss_net_private object list. The latter is only used for duplicate checking in the function iss_net_setup where the former should have been used. Drop iss_net_private object list and associated code and use command line parameters list in the iss_net_setup instead. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
1 parent 3234649 commit 0391334

1 file changed

Lines changed: 3 additions & 18 deletions

File tree

arch/xtensa/platforms/iss/network.c

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@
3737
#define ETH_HEADER_OTHER 14
3838
#define ISS_NET_TIMER_VALUE (HZ / 10)
3939

40-
41-
static DEFINE_SPINLOCK(devices_lock);
42-
static LIST_HEAD(devices);
43-
4440
/* ------------------------------------------------------------------------- */
4541

4642
/* We currently only support the TUNTAP transport protocol. */
@@ -70,8 +66,6 @@ struct iss_net_ops {
7066
/* This structure contains out private information for the driver. */
7167

7268
struct iss_net_private {
73-
struct list_head device_list;
74-
7569
spinlock_t lock;
7670
struct net_device *dev;
7771
struct platform_device pdev;
@@ -488,7 +482,6 @@ static int iss_net_configure(int index, char *init)
488482

489483
lp = netdev_priv(dev);
490484
*lp = (struct iss_net_private) {
491-
.device_list = LIST_HEAD_INIT(lp->device_list),
492485
.dev = dev,
493486
.index = index,
494487
};
@@ -521,10 +514,6 @@ static int iss_net_configure(int index, char *init)
521514
driver_registered = 1;
522515
}
523516

524-
spin_lock(&devices_lock);
525-
list_add(&lp->device_list, &devices);
526-
spin_unlock(&devices_lock);
527-
528517
lp->pdev.id = index;
529518
lp->pdev.name = DRIVER_NAME;
530519
platform_device_register(&lp->pdev);
@@ -574,7 +563,7 @@ struct iss_net_init {
574563

575564
static int __init iss_net_setup(char *str)
576565
{
577-
struct iss_net_private *device = NULL;
566+
struct iss_net_init *device = NULL;
578567
struct iss_net_init *new;
579568
struct list_head *ele;
580569
char *end;
@@ -595,16 +584,12 @@ static int __init iss_net_setup(char *str)
595584
}
596585
str = end;
597586

598-
spin_lock(&devices_lock);
599-
600-
list_for_each(ele, &devices) {
601-
device = list_entry(ele, struct iss_net_private, device_list);
587+
list_for_each(ele, &eth_cmd_line) {
588+
device = list_entry(ele, struct iss_net_init, list);
602589
if (device->index == n)
603590
break;
604591
}
605592

606-
spin_unlock(&devices_lock);
607-
608593
if (device && device->index == n) {
609594
pr_err("Device %u already configured\n", n);
610595
return 1;

0 commit comments

Comments
 (0)