[PATCH 05/33] sfc: Correct interpretation of second param to ethtool phys_id()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Ben Hutchings
Date: Friday, December 12, 2008 - 5:49 am

A value of 0 means indefinite repetition (until interrupted).

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/sfc/ethtool.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/sfc/ethtool.c b/drivers/net/sfc/ethtool.c
index cd92c4d..9c533e0 100644
--- a/drivers/net/sfc/ethtool.c
+++ b/drivers/net/sfc/ethtool.c
@@ -182,12 +182,16 @@ static struct efx_ethtool_stat efx_ethtool_stats[] = {
  */
 
 /* Identify device by flashing LEDs */
-static int efx_ethtool_phys_id(struct net_device *net_dev, u32 seconds)
+static int efx_ethtool_phys_id(struct net_device *net_dev, u32 count)
 {
 	struct efx_nic *efx = netdev_priv(net_dev);
 
 	efx->board_info.blink(efx, 1);
-	schedule_timeout_interruptible(seconds * HZ);
+	set_current_state(TASK_INTERRUPTIBLE);
+	if (count)
+		schedule_timeout(count * HZ);
+	else
+		schedule();
 	efx->board_info.blink(efx, 0);
 	return 0;
 }
-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/33] sfc version 2.3, Ben Hutchings, (Fri Dec 12, 5:46 am)
[PATCH 01/33] sfc: Board support fixes, Ben Hutchings, (Fri Dec 12, 5:48 am)
[PATCH 02/33] sfc: Change SPI lengths to type size_t, Ben Hutchings, (Fri Dec 12, 5:48 am)
[PATCH 04/33] sfc: Remove unneeded register write, Ben Hutchings, (Fri Dec 12, 5:49 am)
[PATCH 05/33] sfc: Correct interpretation of second param ..., Ben Hutchings, (Fri Dec 12, 5:49 am)
[PATCH 08/33] sfc: Work around unreliable strap pins, Ben Hutchings, (Fri Dec 12, 5:51 am)
[PATCH 09/33] sfc: Restore phy_flash_cfg module parameter, Ben Hutchings, (Fri Dec 12, 5:51 am)
[PATCH 14/33] sfc: Remove MII extension cruft, Ben Hutchings, (Fri Dec 12, 5:53 am)
[PATCH 15/33] sfc: Add support for MMDs numbered &gt;15, Ben Hutchings, (Fri Dec 12, 5:53 am)
[PATCH 16/33] sfc: Add phy_type device attribute, Ben Hutchings, (Fri Dec 12, 5:54 am)
[PATCH 17/33] sfc: Clean up board identification, Ben Hutchings, (Fri Dec 12, 5:54 am)
[PATCH 18/33] sfc: Clean up MDIO flag setting, Ben Hutchings, (Fri Dec 12, 5:54 am)
[PATCH 19/33] sfc: Add support for sub-10G speeds, Ben Hutchings, (Fri Dec 12, 5:54 am)
[PATCH 20/33] sfc: Implement auto-negotiation, Ben Hutchings, (Fri Dec 12, 5:55 am)
[PATCH 23/33] sfc: Add support for SFN4111T, Ben Hutchings, (Fri Dec 12, 5:56 am)
[PATCH 26/33] sfc: Remove leading spaces, Ben Hutchings, (Fri Dec 12, 5:57 am)
[PATCH 29/33] sfc: Use model numbers for PHY type names, Ben Hutchings, (Fri Dec 12, 5:59 am)
Re: [PATCH 01/33] sfc: Board support fixes, David Miller, (Fri Dec 12, 10:29 pm)
Re: [PATCH 02/33] sfc: Change SPI lengths to type size_t, David Miller, (Fri Dec 12, 10:30 pm)
Re: [PATCH 04/33] sfc: Remove unneeded register write, David Miller, (Fri Dec 12, 10:31 pm)
Re: [PATCH 08/33] sfc: Work around unreliable strap pins, David Miller, (Fri Dec 12, 10:34 pm)
Re: [PATCH 14/33] sfc: Remove MII extension cruft, David Miller, (Fri Dec 12, 10:43 pm)
Re: [PATCH 16/33] sfc: Add phy_type device attribute, David Miller, (Fri Dec 12, 10:47 pm)
Re: [PATCH 17/33] sfc: Clean up board identification, David Miller, (Fri Dec 12, 10:48 pm)
Re: [PATCH 18/33] sfc: Clean up MDIO flag setting, David Miller, (Fri Dec 12, 10:49 pm)
Re: [PATCH 19/33] sfc: Add support for sub-10G speeds, David Miller, (Fri Dec 12, 10:50 pm)
Re: [PATCH 20/33] sfc: Implement auto-negotiation, David Miller, (Fri Dec 12, 10:50 pm)
Re: [PATCH 02/33] sfc: Change SPI lengths to type size_t, David Miller, (Fri Dec 12, 10:53 pm)
Re: [PATCH 23/33] sfc: Add support for SFN4111T, David Miller, (Fri Dec 12, 11:01 pm)
Re: [PATCH 26/33] sfc: Remove leading spaces, David Miller, (Fri Dec 12, 11:05 pm)
Re: [PATCH 02/33] sfc: Change SPI lengths to type size_t, Ben Hutchings, (Fri Dec 12, 11:30 pm)