diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-02-26 07:22:13 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-02-26 07:22:13 -0500 |
commit | 4434e5156409eb3ec98f5ad7f0a0c07ebafe970d (patch) | |
tree | c7f148cdae7a6cf4013253c6c2dbd1c49e837e32 /drivers/net/smsc9420.c | |
parent | 2b8f836fb196acede88b6cc772e9057e0a9c0223 (diff) | |
parent | 694593e3374a67d95ece6a275a1f181644c2c4d8 (diff) |
Merge branches 'sched/cleanups', 'sched/urgent' and 'linus' into sched/core
Diffstat (limited to 'drivers/net/smsc9420.c')
-rw-r--r-- | drivers/net/smsc9420.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/smsc9420.c b/drivers/net/smsc9420.c index a1e4b3895b33..4e15ae068b3f 100644 --- a/drivers/net/smsc9420.c +++ b/drivers/net/smsc9420.c | |||
@@ -341,7 +341,7 @@ static int smsc9420_eeprom_send_cmd(struct smsc9420_pdata *pd, u32 op) | |||
341 | do { | 341 | do { |
342 | msleep(1); | 342 | msleep(1); |
343 | e2cmd = smsc9420_reg_read(pd, E2P_CMD); | 343 | e2cmd = smsc9420_reg_read(pd, E2P_CMD); |
344 | } while ((e2cmd & E2P_CMD_EPC_BUSY_) && (timeout--)); | 344 | } while ((e2cmd & E2P_CMD_EPC_BUSY_) && (--timeout)); |
345 | 345 | ||
346 | if (!timeout) { | 346 | if (!timeout) { |
347 | smsc_info(HW, "TIMED OUT"); | 347 | smsc_info(HW, "TIMED OUT"); |
@@ -413,6 +413,7 @@ static int smsc9420_ethtool_get_eeprom(struct net_device *dev, | |||
413 | } | 413 | } |
414 | 414 | ||
415 | memcpy(data, &eeprom_data[eeprom->offset], len); | 415 | memcpy(data, &eeprom_data[eeprom->offset], len); |
416 | eeprom->magic = SMSC9420_EEPROM_MAGIC; | ||
416 | eeprom->len = len; | 417 | eeprom->len = len; |
417 | return 0; | 418 | return 0; |
418 | } | 419 | } |
@@ -423,6 +424,9 @@ static int smsc9420_ethtool_set_eeprom(struct net_device *dev, | |||
423 | struct smsc9420_pdata *pd = netdev_priv(dev); | 424 | struct smsc9420_pdata *pd = netdev_priv(dev); |
424 | int ret; | 425 | int ret; |
425 | 426 | ||
427 | if (eeprom->magic != SMSC9420_EEPROM_MAGIC) | ||
428 | return -EINVAL; | ||
429 | |||
426 | smsc9420_eeprom_enable_access(pd); | 430 | smsc9420_eeprom_enable_access(pd); |
427 | smsc9420_eeprom_send_cmd(pd, E2P_CMD_EPC_CMD_EWEN_); | 431 | smsc9420_eeprom_send_cmd(pd, E2P_CMD_EPC_CMD_EWEN_); |
428 | ret = smsc9420_eeprom_write_location(pd, eeprom->offset, *data); | 432 | ret = smsc9420_eeprom_write_location(pd, eeprom->offset, *data); |