aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/net/zd1201.c
diff options
context:
space:
mode:
authorArtem B. Bityuckiy <dedekind@infradead.org>2005-07-06 10:43:18 -0400
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-07-06 13:40:38 -0400
commitb3539219c9ea20ebf6a5ea3cc534f423a3607c41 (patch)
treed17c31c0eac0a7290ba5011b59a100fd9e9c9532 /drivers/usb/net/zd1201.c
parent6430a8def12edebc1c9c7c2621d33ca0e8653c33 (diff)
parenta18bcb7450840f07a772a45229de4811d930f461 (diff)
Merge with rsync://fileserver/linux
Update to 2.6.12-rc3
Diffstat (limited to 'drivers/usb/net/zd1201.c')
-rw-r--r--drivers/usb/net/zd1201.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/drivers/usb/net/zd1201.c b/drivers/usb/net/zd1201.c
index 341ae5f732dd..3b387b005739 100644
--- a/drivers/usb/net/zd1201.c
+++ b/drivers/usb/net/zd1201.c
@@ -1884,12 +1884,53 @@ static void zd1201_disconnect(struct usb_interface *interface)
1884 kfree(zd); 1884 kfree(zd);
1885} 1885}
1886 1886
1887#ifdef CONFIG_PM
1888
1889static int zd1201_suspend(struct usb_interface *interface,
1890 pm_message_t message)
1891{
1892 struct zd1201 *zd = usb_get_intfdata(interface);
1893
1894 netif_device_detach(zd->dev);
1895
1896 zd->was_enabled = zd->mac_enabled;
1897
1898 if (zd->was_enabled)
1899 return zd1201_disable(zd);
1900 else
1901 return 0;
1902}
1903
1904static int zd1201_resume(struct usb_interface *interface)
1905{
1906 struct zd1201 *zd = usb_get_intfdata(interface);
1907
1908 if (!zd || !zd->dev)
1909 return -ENODEV;
1910
1911 netif_device_attach(zd->dev);
1912
1913 if (zd->was_enabled)
1914 return zd1201_enable(zd);
1915 else
1916 return 0;
1917}
1918
1919#else
1920
1921#define zd1201_suspend NULL
1922#define zd1201_resume NULL
1923
1924#endif
1925
1887static struct usb_driver zd1201_usb = { 1926static struct usb_driver zd1201_usb = {
1888 .owner = THIS_MODULE, 1927 .owner = THIS_MODULE,
1889 .name = "zd1201", 1928 .name = "zd1201",
1890 .probe = zd1201_probe, 1929 .probe = zd1201_probe,
1891 .disconnect = zd1201_disconnect, 1930 .disconnect = zd1201_disconnect,
1892 .id_table = zd1201_table, 1931 .id_table = zd1201_table,
1932 .suspend = zd1201_suspend,
1933 .resume = zd1201_resume,
1893}; 1934};
1894 1935
1895static int __init zd1201_init(void) 1936static int __init zd1201_init(void)