From 6c2959aa7b81b83c9c4b4cb822bb7c0a637e869a Mon Sep 17 00:00:00 2001 From: Hannes Eder Date: Thu, 12 Feb 2009 09:28:40 +0000 Subject: drivers/isdn/hardware/mISDN: fix sparse warnings: make symbols static Fix this sparse warnings: drivers/isdn/hardware/mISDN/hfcpci.c:59:19: warning: symbol 'hfc_tl' was not declared. Should it be static? drivers/isdn/hardware/mISDN/hfcpci.c:60:9: warning: symbol 'hfc_jiffies' was not declared. Should it be static? drivers/isdn/hardware/mISDN/hfcsusb.h:201:6: warning: symbol 'conf_str' was not declared. Should it be static? drivers/isdn/hardware/mISDN/hfcsusb.h:319:12: warning: symbol 'HFC_TE_LAYER1_STATES' was not declared. Should it be static? drivers/isdn/hardware/mISDN/hfcsusb.h:331:12: warning: symbol 'HFC_NT_LAYER1_STATES' was not declared. Should it be static? drivers/isdn/hardware/mISDN/hfcsusb.c:38:12: warning: symbol 'hfcsusb_rev' was not declared. Should it be static? drivers/isdn/hardware/mISDN/hfcsusb.c:978:1: warning: symbol 'fill_isoc_urb' was not declared. Should it be static? drivers/isdn/hardware/mISDN/hfcsusb.c:1724:1: warning: symbol 'setup_hfcsusb' was not declared. Should it be static? Signed-off-by: Hannes Eder Signed-off-by: David S. Miller --- drivers/isdn/hardware/mISDN/hfcpci.c | 4 ++-- drivers/isdn/hardware/mISDN/hfcsusb.c | 6 +++--- drivers/isdn/hardware/mISDN/hfcsusb.h | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'drivers/isdn') diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c index f0e14dfcf71d..2bb85c48b9b7 100644 --- a/drivers/isdn/hardware/mISDN/hfcpci.c +++ b/drivers/isdn/hardware/mISDN/hfcpci.c @@ -56,8 +56,8 @@ static const char *hfcpci_revision = "2.0"; static int HFC_cnt; static uint debug; static uint poll, tics; -struct timer_list hfc_tl; -u32 hfc_jiffies; +static struct timer_list hfc_tl; +static u32 hfc_jiffies; MODULE_AUTHOR("Karsten Keil"); MODULE_LICENSE("GPL"); diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers/isdn/hardware/mISDN/hfcsusb.c index ba6925fbf38a..9c427fb204ee 100644 --- a/drivers/isdn/hardware/mISDN/hfcsusb.c +++ b/drivers/isdn/hardware/mISDN/hfcsusb.c @@ -35,7 +35,7 @@ #include #include "hfcsusb.h" -const char *hfcsusb_rev = "Revision: 0.3.3 (socket), 2008-11-05"; +static const char *hfcsusb_rev = "Revision: 0.3.3 (socket), 2008-11-05"; static unsigned int debug; static int poll = DEFAULT_TRANSP_BURST_SZ; @@ -974,7 +974,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len, spin_unlock(&hw->lock); } -void +static void fill_isoc_urb(struct urb *urb, struct usb_device *dev, unsigned int pipe, void *buf, int num_packets, int packet_size, int interval, usb_complete_t complete, void *context) @@ -1720,7 +1720,7 @@ hfcsusb_stop_endpoint(struct hfcsusb *hw, int channel) /* Hardware Initialization */ -int +static int setup_hfcsusb(struct hfcsusb *hw) { int err; diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.h b/drivers/isdn/hardware/mISDN/hfcsusb.h index 098486b8e8d2..43efe7358fa3 100644 --- a/drivers/isdn/hardware/mISDN/hfcsusb.h +++ b/drivers/isdn/hardware/mISDN/hfcsusb.h @@ -198,7 +198,7 @@ validconf[][19] = { }; /* string description of chosen config */ -char *conf_str[] = { +static char *conf_str[] = { "4 Interrupt IN + 3 Isochron OUT", "3 Interrupt IN + 3 Isochron OUT", "4 Isochron IN + 3 Isochron OUT", @@ -316,7 +316,7 @@ struct hfcsusb_vdata { #define HFC_MAX_TE_LAYER1_STATE 8 #define HFC_MAX_NT_LAYER1_STATE 4 -const char *HFC_TE_LAYER1_STATES[HFC_MAX_TE_LAYER1_STATE + 1] = { +static const char *HFC_TE_LAYER1_STATES[HFC_MAX_TE_LAYER1_STATE + 1] = { "TE F0 - Reset", "TE F1 - Reset", "TE F2 - Sensing", @@ -328,7 +328,7 @@ const char *HFC_TE_LAYER1_STATES[HFC_MAX_TE_LAYER1_STATE + 1] = { "TE F8 - Lost framing", }; -const char *HFC_NT_LAYER1_STATES[HFC_MAX_NT_LAYER1_STATE + 1] = { +static const char *HFC_NT_LAYER1_STATES[HFC_MAX_NT_LAYER1_STATE + 1] = { "NT G0 - Reset", "NT G1 - Deactive", "NT G2 - Pending activation", -- cgit v1.2.3 From f8532fde95c53e8ef2b5ea44542c82c117d28041 Mon Sep 17 00:00:00 2001 From: Hannes Eder Date: Thu, 12 Feb 2009 09:32:41 +0000 Subject: drivers/isdn/mISDN: fix sparse warnings: make symbols static Fix this sparse warnings: drivers/isdn/mISDN/clock.c:44:1: warning: symbol 'iclock_lock' was not declared. Should it be static? drivers/isdn/mISDN/clock.c:45:9: warning: symbol 'iclock_count' was not declared. Should it be static? drivers/isdn/mISDN/clock.c:46:17: warning: symbol 'iclock_tv' was not declared. Should it be static? drivers/isdn/mISDN/clock.c:47:9: warning: symbol 'iclock_tv_valid' was not declared. Should it be static? drivers/isdn/mISDN/clock.c:48:20: warning: symbol 'iclock_current' was not declared. Should it be static? Signed-off-by: Hannes Eder Signed-off-by: David S. Miller --- drivers/isdn/mISDN/clock.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/isdn') diff --git a/drivers/isdn/mISDN/clock.c b/drivers/isdn/mISDN/clock.c index 44d9c3d5d33d..f1bbc88763b2 100644 --- a/drivers/isdn/mISDN/clock.c +++ b/drivers/isdn/mISDN/clock.c @@ -41,11 +41,11 @@ static u_int *debug; static LIST_HEAD(iclock_list); -DEFINE_RWLOCK(iclock_lock); -u16 iclock_count; /* counter of last clock */ -struct timeval iclock_tv; /* time stamp of last clock */ -int iclock_tv_valid; /* already received one timestamp */ -struct mISDNclock *iclock_current; +static DEFINE_RWLOCK(iclock_lock); +static u16 iclock_count; /* counter of last clock */ +static struct timeval iclock_tv; /* time stamp of last clock */ +static int iclock_tv_valid; /* already received one timestamp */ +static struct mISDNclock *iclock_current; void mISDN_init_clock(u_int *dp) -- cgit v1.2.3 From aa611f85d0d656870dbb906e75d8cac6acb58943 Mon Sep 17 00:00:00 2001 From: Hannes Eder Date: Sat, 14 Feb 2009 13:10:33 +0000 Subject: drivers/isdn/hardware/mISDN: change type of hfc_jiffies to unsigned long Jiffies are unsigned long, make sure we fit in jiffies store variable on archs with bits per long > 32. Patch suggested by Jiri Slaby. Signed-off-by: Hannes Eder Signed-off-by: David S. Miller --- drivers/isdn/hardware/mISDN/hfcpci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/isdn') diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c index 2bb85c48b9b7..641a9cd1a532 100644 --- a/drivers/isdn/hardware/mISDN/hfcpci.c +++ b/drivers/isdn/hardware/mISDN/hfcpci.c @@ -57,7 +57,7 @@ static int HFC_cnt; static uint debug; static uint poll, tics; static struct timer_list hfc_tl; -static u32 hfc_jiffies; +static unsigned long hfc_jiffies; MODULE_AUTHOR("Karsten Keil"); MODULE_LICENSE("GPL"); -- cgit v1.2.3 From 211174ea8dca4502e20008de7ff2ad389db023a5 Mon Sep 17 00:00:00 2001 From: Eric Sesterhenn Date: Thu, 26 Feb 2009 22:38:15 -0800 Subject: MISDN: list usage cleanup Trivial cleanup, list_del(); list_add_tail() is equivalent to list_move_tail(). Semantic patch for coccinelle can be found at www.cccmz.de/~snakebyte/list_move_tail.spatch Signed-off-by: Eric Sesterhenn Acked-by: Karsten Keil Signed-off-by: David S. Miller --- drivers/isdn/mISDN/timerdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/isdn') diff --git a/drivers/isdn/mISDN/timerdev.c b/drivers/isdn/mISDN/timerdev.c index f2b32186d4a1..bbd99d3282c0 100644 --- a/drivers/isdn/mISDN/timerdev.c +++ b/drivers/isdn/mISDN/timerdev.c @@ -152,8 +152,7 @@ dev_expire_timer(unsigned long data) u_long flags; spin_lock_irqsave(&timer->dev->lock, flags); - list_del(&timer->list); - list_add_tail(&timer->list, &timer->dev->expired); + list_move_tail(&timer->list, &timer->dev->expired); spin_unlock_irqrestore(&timer->dev->lock, flags); wake_up_interruptible(&timer->dev->wait); } -- cgit v1.2.3 From d46604e178f01305e63564864517926bb752d4a3 Mon Sep 17 00:00:00 2001 From: Wei Yongjun Date: Wed, 25 Feb 2009 00:12:09 +0000 Subject: isdn: remove some pointless conditionals before kfree_skb() Remove some pointless conditionals before kfree_skb(). Signed-off-by: Wei Yongjun Signed-off-by: David S. Miller --- drivers/isdn/capi/capi.c | 2 +- drivers/isdn/pcbit/layer2.c | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'drivers/isdn') diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c index 1b5bf87c4cf4..3e468d2cf730 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c @@ -277,7 +277,7 @@ static void capiminor_free(struct capiminor *mp) list_del(&mp->list); write_unlock_irqrestore(&capiminor_list_lock, flags); - if (mp->ttyskb) kfree_skb(mp->ttyskb); + kfree_skb(mp->ttyskb); mp->ttyskb = NULL; skb_queue_purge(&mp->inqueue); skb_queue_purge(&mp->outqueue); diff --git a/drivers/isdn/pcbit/layer2.c b/drivers/isdn/pcbit/layer2.c index 5ba2a879df14..e075e8d2fce0 100644 --- a/drivers/isdn/pcbit/layer2.c +++ b/drivers/isdn/pcbit/layer2.c @@ -347,8 +347,7 @@ pcbit_receive(struct pcbit_dev *dev) if (dev->read_frame) { printk(KERN_DEBUG "pcbit_receive: Type 0 frame and read_frame != NULL\n"); /* discard previous queued frame */ - if (dev->read_frame->skb) - kfree_skb(dev->read_frame->skb); + kfree_skb(dev->read_frame->skb); kfree(dev->read_frame); dev->read_frame = NULL; } @@ -601,8 +600,7 @@ pcbit_l2_err_recover(unsigned long data) dev->w_busy = dev->r_busy = 1; if (dev->read_frame) { - if (dev->read_frame->skb) - kfree_skb(dev->read_frame->skb); + kfree_skb(dev->read_frame->skb); kfree(dev->read_frame); dev->read_frame = NULL; } -- cgit v1.2.3 From dfe925e8e9058c8af0d203ae7262437235623a68 Mon Sep 17 00:00:00 2001 From: Hannes Eder Date: Wed, 25 Feb 2009 13:08:40 +0000 Subject: drivers/isdn/capi: fix sparse warning: context imbalance Impact: Attribute functions with __acquires(...) resp. __releases(...). Fix this sparse warnings: drivers/isdn/capi/kcapi_proc.c:241:13: warning: context imbalance in 'capi_driver_start' - wrong count at exit drivers/isdn/capi/kcapi_proc.c:252:13: warning: context imbalance in 'capi_driver_stop' - unexpected unlock Signed-off-by: Hannes Eder Signed-off-by: David S. Miller --- drivers/isdn/capi/kcapi_proc.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/isdn') diff --git a/drivers/isdn/capi/kcapi_proc.c b/drivers/isdn/capi/kcapi_proc.c index c29208bd7521..50ed778f63fc 100644 --- a/drivers/isdn/capi/kcapi_proc.c +++ b/drivers/isdn/capi/kcapi_proc.c @@ -239,6 +239,7 @@ static const struct file_operations proc_applstats_ops = { // --------------------------------------------------------------------------- static void *capi_driver_start(struct seq_file *seq, loff_t *pos) + __acquires(&capi_drivers_list_lock) { read_lock(&capi_drivers_list_lock); return seq_list_start(&capi_drivers, *pos); @@ -250,6 +251,7 @@ static void *capi_driver_next(struct seq_file *seq, void *v, loff_t *pos) } static void capi_driver_stop(struct seq_file *seq, void *v) + __releases(&capi_drivers_list_lock) { read_unlock(&capi_drivers_list_lock); } -- cgit v1.2.3 From cf80063a7d8b1b477236e5491730c1ff71fc5577 Mon Sep 17 00:00:00 2001 From: Hannes Eder Date: Wed, 25 Feb 2009 13:09:52 +0000 Subject: drivers/isdn/act2000: fix sparse warning: symbol shadows an earlier one Impact: Rename local variable 'c' to 't'. Fix this sparse warning: drivers/isdn/act2000/act2000_isa.c:260:70: warning: symbol 'c' shadows an earlier one Signed-off-by: Hannes Eder Signed-off-by: David S. Miller --- drivers/isdn/act2000/act2000_isa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/isdn') diff --git a/drivers/isdn/act2000/act2000_isa.c b/drivers/isdn/act2000/act2000_isa.c index 1bd8960ead33..fea5b783335d 100644 --- a/drivers/isdn/act2000/act2000_isa.c +++ b/drivers/isdn/act2000/act2000_isa.c @@ -257,9 +257,9 @@ act2000_isa_receive(act2000_card *card) printk(KERN_WARNING "act2000_isa_receive: Invalid CAPI msg\n"); { - int i; __u8 *p; __u8 *c; __u8 tmp[30]; - for (i = 0, p = (__u8 *)&card->idat.isa.rcvhdr, c = tmp; i < 8; i++) - c += sprintf(c, "%02x ", *(p++)); + int i; __u8 *p; __u8 *t; __u8 tmp[30]; + for (i = 0, p = (__u8 *)&card->idat.isa.rcvhdr, t = tmp; i < 8; i++) + t += sprintf(t, "%02x ", *(p++)); printk(KERN_WARNING "act2000_isa_receive: %s\n", tmp); } } -- cgit v1.2.3 From e86a6a1b7849217bb3b1ef725c7fee86ed6dae33 Mon Sep 17 00:00:00 2001 From: Hannes Eder Date: Wed, 25 Feb 2009 13:11:03 +0000 Subject: drivers/isdn/hisax: fix sparse warning: Should it be static? Impact: Move declarations to a header file. Fix this sparse warning: drivers/isdn/hisax/callc.c:24:12: warning: symbol 'lli_revision' was not declared. Should it be static? drivers/isdn/hisax/config.c:84:12: warning: symbol 'CardType' was not declared. Should it be static? drivers/isdn/hisax/config.c:362:5: warning: symbol 'nrcards' was not declared. Should it be static? drivers/isdn/hisax/isdnl1.c:21:12: warning: symbol 'l1_revision' was not declared. Should it be static? drivers/isdn/hisax/isdnl2.c:22:12: warning: symbol 'l2_revision' was not declared. Should it be static? drivers/isdn/hisax/isdnl3.c:22:12: warning: symbol 'l3_revision' was not declared. Should it be static? drivers/isdn/hisax/tei.c:23:12: warning: symbol 'tei_revision' was not declared. Should it be static? Signed-off-by: Hannes Eder Signed-off-by: David S. Miller --- drivers/isdn/hisax/callc.c | 1 - drivers/isdn/hisax/config.c | 6 ------ drivers/isdn/hisax/hfcscard.c | 2 -- drivers/isdn/hisax/hisax.h | 9 +++++++++ drivers/isdn/hisax/isdnl1.c | 4 ++-- drivers/isdn/hisax/sedlbauer.c | 2 -- drivers/isdn/hisax/teles0.c | 2 -- drivers/isdn/hisax/teles3.c | 1 - 8 files changed, 11 insertions(+), 16 deletions(-) (limited to 'drivers/isdn') diff --git a/drivers/isdn/hisax/callc.c b/drivers/isdn/hisax/callc.c index 7c56c44f0fd1..025a20d487c5 100644 --- a/drivers/isdn/hisax/callc.c +++ b/drivers/isdn/hisax/callc.c @@ -24,7 +24,6 @@ const char *lli_revision = "$Revision: 2.59.2.4 $"; extern struct IsdnCard cards[]; -extern int nrcards; static int init_b_st(struct Channel *chanp, int incoming); static void release_b_st(struct Channel *chanp); diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c index ded9d0baf607..4fab18d4d02f 100644 --- a/drivers/isdn/hisax/config.c +++ b/drivers/isdn/hisax/config.c @@ -361,12 +361,6 @@ module_param_array(io1, int, NULL, 0); int nrcards; -extern const char *l1_revision; -extern const char *l2_revision; -extern const char *l3_revision; -extern const char *lli_revision; -extern const char *tei_revision; - char *HiSax_getrev(const char *revision) { char *rev; diff --git a/drivers/isdn/hisax/hfcscard.c b/drivers/isdn/hisax/hfcscard.c index cf082665cc8b..20d7688b397b 100644 --- a/drivers/isdn/hisax/hfcscard.c +++ b/drivers/isdn/hisax/hfcscard.c @@ -16,8 +16,6 @@ #include "hfc_2bds0.h" #include "isdnl1.h" -extern const char *CardType[]; - static const char *hfcs_revision = "$Revision: 1.10.2.4 $"; static irqreturn_t diff --git a/drivers/isdn/hisax/hisax.h b/drivers/isdn/hisax/hisax.h index e8d429fda846..f8527046f197 100644 --- a/drivers/isdn/hisax/hisax.h +++ b/drivers/isdn/hisax/hisax.h @@ -121,6 +121,15 @@ #ifdef __KERNEL__ +extern const char *CardType[]; +extern int nrcards; + +extern const char *l1_revision; +extern const char *l2_revision; +extern const char *l3_revision; +extern const char *lli_revision; +extern const char *tei_revision; + /* include l3dss1 & ni1 specific process structures, but no other defines */ #ifdef CONFIG_HISAX_EURO #define l3dss1_process diff --git a/drivers/isdn/hisax/isdnl1.c b/drivers/isdn/hisax/isdnl1.c index a14204ec88ee..317f16f516f2 100644 --- a/drivers/isdn/hisax/isdnl1.c +++ b/drivers/isdn/hisax/isdnl1.c @@ -18,12 +18,12 @@ * */ -const char *l1_revision = "$Revision: 2.46.2.5 $"; - #include #include "hisax.h" #include "isdnl1.h" +const char *l1_revision = "$Revision: 2.46.2.5 $"; + #define TIMER3_VALUE 7000 static struct Fsm l1fsm_b; diff --git a/drivers/isdn/hisax/sedlbauer.c b/drivers/isdn/hisax/sedlbauer.c index a10dfa82c734..5569a522e2a1 100644 --- a/drivers/isdn/hisax/sedlbauer.c +++ b/drivers/isdn/hisax/sedlbauer.c @@ -48,8 +48,6 @@ #include #include -extern const char *CardType[]; - static const char *Sedlbauer_revision = "$Revision: 1.34.2.6 $"; static const char *Sedlbauer_Types[] = diff --git a/drivers/isdn/hisax/teles0.c b/drivers/isdn/hisax/teles0.c index 48581335f43c..3ca0bed1b88c 100644 --- a/drivers/isdn/hisax/teles0.c +++ b/drivers/isdn/hisax/teles0.c @@ -21,8 +21,6 @@ #include "isac.h" #include "hscx.h" -extern const char *CardType[]; - static const char *teles0_revision = "$Revision: 2.15.2.4 $"; #define TELES_IOMEM_SIZE 0x400 diff --git a/drivers/isdn/hisax/teles3.c b/drivers/isdn/hisax/teles3.c index 5dc9f1a43629..e9f5bb4cdffa 100644 --- a/drivers/isdn/hisax/teles3.c +++ b/drivers/isdn/hisax/teles3.c @@ -20,7 +20,6 @@ #include "hscx.h" #include "isdnl1.h" -extern const char *CardType[]; static const char *teles3_revision = "$Revision: 2.19.2.4 $"; #define byteout(addr,val) outb(val,addr) -- cgit v1.2.3 From 215a9c78ae92c0e33261f7973d52d70d9eeb367c Mon Sep 17 00:00:00 2001 From: Hannes Eder Date: Wed, 25 Feb 2009 13:11:23 +0000 Subject: drivers/isdn/hardware/icon: fix sparse warning: cast truncates bits Fix this sparse warning: drivers/isdn/hardware/eicon/debug.c:1201:32: warning: cast truncates bits from constant value (1000 becomes 0) Signed-off-by: Hannes Eder Signed-off-by: David S. Miller --- drivers/isdn/hardware/eicon/debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/isdn') diff --git a/drivers/isdn/hardware/eicon/debug.c b/drivers/isdn/hardware/eicon/debug.c index 84318ec8d13e..33ce89eed65b 100644 --- a/drivers/isdn/hardware/eicon/debug.c +++ b/drivers/isdn/hardware/eicon/debug.c @@ -1198,7 +1198,7 @@ int SuperTraceASSIGN (void* AdapterHandle, byte* data) { pC->xbuffer[5] = (byte)(rx_dma_magic >> 8); pC->xbuffer[6] = (byte)(rx_dma_magic >> 16); pC->xbuffer[7] = (byte)(rx_dma_magic >> 24); - pC->xbuffer[8] = (byte)DIVA_MAX_MANAGEMENT_TRANSFER_SIZE; + pC->xbuffer[8] = (byte)(DIVA_MAX_MANAGEMENT_TRANSFER_SIZE & 0xFF); pC->xbuffer[9] = (byte)(DIVA_MAX_MANAGEMENT_TRANSFER_SIZE >> 8); pC->xbuffer[10] = 0; -- cgit v1.2.3 From 465e985087e9a15ddbe8ad62d9a983ae434d84c6 Mon Sep 17 00:00:00 2001 From: Hannes Eder Date: Wed, 25 Feb 2009 13:11:37 +0000 Subject: drivers/isdn/hardware/eicon: fix sparse warnings: Should it be static? Impact: Make symbols static. Fix this sparse warnings: drivers/isdn/hardware/eicon/message.c:1197:6: warning: symbol 'connect_req' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:1414:6: warning: symbol 'connect_res' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:1570:6: warning: symbol 'connect_a_res' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:1576:6: warning: symbol 'disconnect_req' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:1631:6: warning: symbol 'disconnect_res' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:1658:6: warning: symbol 'listen_req' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:1707:6: warning: symbol 'info_req' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:1816:6: warning: symbol 'info_res' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:1822:6: warning: symbol 'alert_req' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:1852:6: warning: symbol 'facility_req' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:2602:6: warning: symbol 'facility_res' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:2608:6: warning: symbol 'connect_b3_req' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:2842:6: warning: symbol 'connect_b3_res' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:2957:6: warning: symbol 'connect_b3_a_res' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:2977:6: warning: symbol 'disconnect_b3_req' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:3033:6: warning: symbol 'disconnect_b3_res' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:3089:6: warning: symbol 'data_b3_req' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:3166:6: warning: symbol 'data_b3_res' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:3199:6: warning: symbol 'reset_b3_req' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:3240:6: warning: symbol 'reset_b3_res' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:3264:6: warning: symbol 'connect_b3_t90_a_res' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:3298:6: warning: symbol 'select_b_req' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:8692:6: warning: symbol 'sig_req' was not declared. Should it be static? drivers/isdn/hardware/eicon/message.c:8792:6: warning: symbol 'send_data' was not declared. Should it be static? Signed-off-by: Hannes Eder Signed-off-by: David S. Miller --- drivers/isdn/hardware/eicon/message.c | 70 +++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 24 deletions(-) (limited to 'drivers/isdn') diff --git a/drivers/isdn/hardware/eicon/message.c b/drivers/isdn/hardware/eicon/message.c index 4cc94f200b72..31f91c18c698 100644 --- a/drivers/isdn/hardware/eicon/message.c +++ b/drivers/isdn/hardware/eicon/message.c @@ -1194,7 +1194,8 @@ static char hex_digit_table[0x10] = /* translation function for each message */ /*------------------------------------------------------------------*/ -byte connect_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) +static byte connect_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *parms) { word ch; word i; @@ -1411,7 +1412,8 @@ byte connect_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, return 2; } -byte connect_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) +static byte connect_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *parms) { word i, Info; word Reject; @@ -1567,13 +1569,15 @@ byte connect_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, return 1; } -byte connect_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * msg) +static byte connect_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *msg) { dbug(1,dprintf("connect_a_res")); return false; } -byte disconnect_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * msg) +static byte disconnect_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *msg) { word Info; word i; @@ -1628,7 +1632,8 @@ byte disconnect_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plc return false; } -byte disconnect_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * msg) +static byte disconnect_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *msg) { dbug(1,dprintf("disconnect_res")); if(plci) @@ -1655,7 +1660,8 @@ byte disconnect_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plc return 0; } -byte listen_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) +static byte listen_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *parms) { word Info; byte i; @@ -1704,7 +1710,8 @@ byte listen_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, A return false; } -byte info_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * msg) +static byte info_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *msg) { word i; API_PARSE * ai; @@ -1813,13 +1820,15 @@ byte info_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APP return false; } -byte info_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * msg) +static byte info_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *msg) { dbug(1,dprintf("info_res")); return false; } -byte alert_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * msg) +static byte alert_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *msg) { word Info; byte ret; @@ -1849,7 +1858,8 @@ byte alert_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, AP return ret; } -byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * msg) +static byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *msg) { word Info = 0; word i = 0; @@ -2599,13 +2609,15 @@ byte facility_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, return false; } -byte facility_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * msg) +static byte facility_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *msg) { dbug(1,dprintf("facility_res")); return false; } -byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) +static byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *parms) { word Info = 0; byte req; @@ -2839,7 +2851,8 @@ byte connect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plc return false; } -byte connect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) +static byte connect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *parms) { word ncci; API_PARSE * ncpi; @@ -2954,7 +2967,8 @@ byte connect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plc return false; } -byte connect_b3_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) +static byte connect_b3_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *parms) { word ncci; @@ -2974,7 +2988,8 @@ byte connect_b3_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * p return false; } -byte disconnect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) +static byte disconnect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *parms) { word Info; word ncci; @@ -3030,7 +3045,8 @@ byte disconnect_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * return false; } -byte disconnect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) +static byte disconnect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *parms) { word ncci; word i; @@ -3086,7 +3102,8 @@ byte disconnect_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * return false; } -byte data_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) +static byte data_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *parms) { NCCI *ncci_ptr; DATA_B3_DESC *data; @@ -3163,7 +3180,8 @@ byte data_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, return false; } -byte data_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) +static byte data_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *parms) { word n; word ncci; @@ -3196,7 +3214,8 @@ byte data_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, return false; } -byte reset_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) +static byte reset_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *parms) { word Info; word ncci; @@ -3237,7 +3256,8 @@ byte reset_b3_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, return false; } -byte reset_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) +static byte reset_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *parms) { word ncci; @@ -3261,7 +3281,8 @@ byte reset_b3_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, return false; } -byte connect_b3_t90_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * parms) +static byte connect_b3_t90_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *parms) { word ncci; API_PARSE * ncpi; @@ -3295,7 +3316,8 @@ byte connect_b3_t90_a_res(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI } -byte select_b_req(dword Id, word Number, DIVA_CAPI_ADAPTER * a, PLCI * plci, APPL * appl, API_PARSE * msg) +static byte select_b_req(dword Id, word Number, DIVA_CAPI_ADAPTER *a, + PLCI *plci, APPL *appl, API_PARSE *msg) { word Info=0; word i; @@ -8689,7 +8711,7 @@ static word add_modem_b23 (PLCI * plci, API_PARSE* bp_parms) /* send a request for the signaling entity */ /*------------------------------------------------------------------*/ -void sig_req(PLCI * plci, byte req, byte Id) +static void sig_req(PLCI *plci, byte req, byte Id) { if(!plci) return; if(plci->adapter->adapter_disabled) return; @@ -8789,7 +8811,7 @@ static void send_req(PLCI *plci) dbug(1,dprintf("send_ok")); } -void send_data(PLCI * plci) +static void send_data(PLCI *plci) { DIVA_CAPI_ADAPTER * a; DATA_B3_DESC * data; -- cgit v1.2.3 From 3c420f27b7b2340a81989c8d9ed619e545dd2ad7 Mon Sep 17 00:00:00 2001 From: Tilman Schmidt Date: Sat, 7 Mar 2009 12:11:02 +0000 Subject: gigaset: Kconfig cleanup Streamline dependencies and remove some obsolete or redundant comments in the Gigaset ISDN driver's Kconfig file. In particular, remove the strong warning against the GIGASET_UNDOCREQ option, as in seven years of existence, the code in question has never been reported to cause any harm. Impact: Kconfig cleanup, no functional change Signed-off-by: Tilman Schmidt Signed-off-by: David S. Miller --- drivers/isdn/gigaset/Kconfig | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'drivers/isdn') diff --git a/drivers/isdn/gigaset/Kconfig b/drivers/isdn/gigaset/Kconfig index 0017e50c6948..9ca889adf120 100644 --- a/drivers/isdn/gigaset/Kconfig +++ b/drivers/isdn/gigaset/Kconfig @@ -1,5 +1,5 @@ menuconfig ISDN_DRV_GIGASET - tristate "Siemens Gigaset support (isdn)" + tristate "Siemens Gigaset support" select CRC_CCITT select BITREVERSE help @@ -11,11 +11,11 @@ menuconfig ISDN_DRV_GIGASET one of the connection specific parts that follow. This will build a module called "gigaset". -if ISDN_DRV_GIGASET!=n +if ISDN_DRV_GIGASET config GIGASET_BASE tristate "Gigaset base station support" - depends on ISDN_DRV_GIGASET && USB + depends on USB help Say M here if you want to use the USB interface of the Gigaset base for connection to your system. @@ -23,7 +23,7 @@ config GIGASET_BASE config GIGASET_M105 tristate "Gigaset M105 support" - depends on ISDN_DRV_GIGASET && USB + depends on USB help Say M here if you want to connect to the Gigaset base via DECT using a Gigaset M105 (Sinus 45 Data 2) USB DECT device. @@ -31,7 +31,6 @@ config GIGASET_M105 config GIGASET_M101 tristate "Gigaset M101 support" - depends on ISDN_DRV_GIGASET help Say M here if you want to connect to the Gigaset base via DECT using a Gigaset M101 (Sinus 45 Data 1) RS232 DECT device. @@ -48,7 +47,6 @@ config GIGASET_UNDOCREQ help This enables support for USB requests we only know from reverse engineering (currently M105 only). If you need - features like configuration mode of M105, say yes. If you - care about your device, say no. + features like configuration mode of M105, say yes. -endif # ISDN_DRV_GIGASET != n +endif # ISDN_DRV_GIGASET -- cgit v1.2.3 From 3f612132c7164d5cc9ed677a2fdf8950222d2170 Mon Sep 17 00:00:00 2001 From: Paul Bolle Date: Sun, 8 Mar 2009 05:23:13 +0000 Subject: gigaset: return -ENOTTY for unimplemented functions A number of functions in the usb_gigaset module will return -EINVAL if CONFIG_GIGASET_UNDOCREQ is not set. Make these return -ENOTTY as it's more specific and it might make it easier to see (from userspace) why these functions actually fail. Impact: some error return codes changed Signed-off-by: Paul Bolle Signed-off-by: Tilman Schmidt Signed-off-by: David S. Miller --- drivers/isdn/gigaset/usb-gigaset.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/isdn') diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c index fba61f670527..d78385166099 100644 --- a/drivers/isdn/gigaset/usb-gigaset.c +++ b/drivers/isdn/gigaset/usb-gigaset.c @@ -278,17 +278,17 @@ static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag) static int gigaset_set_modem_ctrl(struct cardstate *cs, unsigned old_state, unsigned new_state) { - return -EINVAL; + return -ENOTTY; } static int gigaset_set_line_ctrl(struct cardstate *cs, unsigned cflag) { - return -EINVAL; + return -ENOTTY; } static int gigaset_baud_rate(struct cardstate *cs, unsigned cflag) { - return -EINVAL; + return -ENOTTY; } #endif @@ -577,7 +577,7 @@ static int gigaset_brkchars(struct cardstate *cs, const unsigned char buf[6]) return usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x19, 0x41, 0, 0, &buf, 6, 2000); #else - return -EINVAL; + return -ENOTTY; #endif } -- cgit v1.2.3 From 170ebf85160dd128e1c4206cc197cce7d1424705 Mon Sep 17 00:00:00 2001 From: Tilman Schmidt Date: Wed, 18 Mar 2009 23:44:23 -0700 Subject: bas_gigaset: correctly allocate USB interrupt transfer buffer Every USB transfer buffer has to be allocated individually by kmalloc. Impact: bugfix, no functional change Signed-off-by: Tilman Schmidt Tested-by: Kolja Waschk Signed-off-by: David S. Miller --- drivers/isdn/gigaset/bas-gigaset.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'drivers/isdn') diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c index 18dd8aacbe8d..831ddce1467b 100644 --- a/drivers/isdn/gigaset/bas-gigaset.c +++ b/drivers/isdn/gigaset/bas-gigaset.c @@ -46,6 +46,9 @@ MODULE_PARM_DESC(cidmode, "Call-ID mode"); /* length limit according to Siemens 3070usb-protokoll.doc ch. 2.1 */ #define IF_WRITEBUF 264 +/* interrupt pipe message size according to ibid. ch. 2.2 */ +#define IP_MSGSIZE 3 + /* Values for the Gigaset 307x */ #define USB_GIGA_VENDOR_ID 0x0681 #define USB_3070_PRODUCT_ID 0x0001 @@ -110,7 +113,7 @@ struct bas_cardstate { unsigned char *rcvbuf; /* AT reply receive buffer */ struct urb *urb_int_in; /* URB for interrupt pipe */ - unsigned char int_in_buf[3]; + unsigned char *int_in_buf; spinlock_t lock; /* locks all following */ int basstate; /* bitmap (BS_*) */ @@ -657,7 +660,7 @@ static void read_int_callback(struct urb *urb) } /* drop incomplete packets even if the missing bytes wouldn't matter */ - if (unlikely(urb->actual_length < 3)) { + if (unlikely(urb->actual_length < IP_MSGSIZE)) { dev_warn(cs->dev, "incomplete interrupt packet (%d bytes)\n", urb->actual_length); goto resubmit; @@ -2127,6 +2130,7 @@ static void gigaset_reinitbcshw(struct bc_state *bcs) static void gigaset_freecshw(struct cardstate *cs) { /* timers, URBs and rcvbuf are disposed of in disconnect */ + kfree(cs->hw.bas->int_in_buf); kfree(cs->hw.bas); cs->hw.bas = NULL; } @@ -2140,6 +2144,12 @@ static int gigaset_initcshw(struct cardstate *cs) pr_err("out of memory\n"); return 0; } + ucs->int_in_buf = kmalloc(IP_MSGSIZE, GFP_KERNEL); + if (!ucs->int_in_buf) { + kfree(ucs); + pr_err("out of memory\n"); + return 0; + } ucs->urb_cmd_in = NULL; ucs->urb_cmd_out = NULL; @@ -2292,7 +2302,7 @@ static int gigaset_probe(struct usb_interface *interface, usb_fill_int_urb(ucs->urb_int_in, udev, usb_rcvintpipe(udev, (endpoint->bEndpointAddress) & 0x0f), - ucs->int_in_buf, 3, read_int_callback, cs, + ucs->int_in_buf, IP_MSGSIZE, read_int_callback, cs, endpoint->bInterval); if ((rc = usb_submit_urb(ucs->urb_int_in, GFP_KERNEL)) != 0) { dev_err(cs->dev, "could not submit interrupt URB: %s\n", -- cgit v1.2.3 From 71b3e0c1ad90f28e34c105069175cbd4edb43dfa Mon Sep 17 00:00:00 2001 From: Eric Miao Date: Sat, 31 Jan 2009 22:47:44 +0800 Subject: platform: make better use of to_platform_{device,driver}() macros This helps the code look more consistent and cleaner. Signed-off-by: Eric Miao Cc: Kay Sievers Signed-off-by: Greg Kroah-Hartman --- drivers/base/platform.c | 21 +++++++++------------ drivers/block/floppy.c | 3 +-- drivers/isdn/gigaset/ser-gigaset.c | 3 +-- 3 files changed, 11 insertions(+), 16 deletions(-) (limited to 'drivers/isdn') diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 349a1013603f..62a8768d96b3 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c @@ -603,9 +603,8 @@ static int platform_uevent(struct device *dev, struct kobj_uevent_env *env) */ static int platform_match(struct device *dev, struct device_driver *drv) { - struct platform_device *pdev; + struct platform_device *pdev = to_platform_device(dev); - pdev = container_of(dev, struct platform_device, dev); return (strcmp(pdev->name, drv->name) == 0); } @@ -623,26 +622,24 @@ static int platform_legacy_suspend(struct device *dev, pm_message_t mesg) static int platform_legacy_suspend_late(struct device *dev, pm_message_t mesg) { - struct platform_driver *drv = to_platform_driver(dev->driver); - struct platform_device *pdev; + struct platform_driver *pdrv = to_platform_driver(dev->driver); + struct platform_device *pdev = to_platform_device(dev); int ret = 0; - pdev = container_of(dev, struct platform_device, dev); - if (dev->driver && drv->suspend_late) - ret = drv->suspend_late(pdev, mesg); + if (dev->driver && pdrv->suspend_late) + ret = pdrv->suspend_late(pdev, mesg); return ret; } static int platform_legacy_resume_early(struct device *dev) { - struct platform_driver *drv = to_platform_driver(dev->driver); - struct platform_device *pdev; + struct platform_driver *pdrv = to_platform_driver(dev->driver); + struct platform_device *pdev = to_platform_device(dev); int ret = 0; - pdev = container_of(dev, struct platform_device, dev); - if (dev->driver && drv->resume_early) - ret = drv->resume_early(pdev); + if (dev->driver && pdrv->resume_early) + ret = pdrv->resume_early(pdev); return ret; } diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 83d8ed39433d..c2c95e614506 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4135,10 +4135,9 @@ static int have_no_fdc = -ENODEV; static ssize_t floppy_cmos_show(struct device *dev, struct device_attribute *attr, char *buf) { - struct platform_device *p; + struct platform_device *p = to_platform_device(dev); int drive; - p = container_of(dev, struct platform_device,dev); drive = p->id; return sprintf(buf, "%X\n", UDP->cmos); } diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c index ac245e7e96a5..3071a52467ed 100644 --- a/drivers/isdn/gigaset/ser-gigaset.c +++ b/drivers/isdn/gigaset/ser-gigaset.c @@ -389,8 +389,7 @@ static void gigaset_freecshw(struct cardstate *cs) static void gigaset_device_release(struct device *dev) { - struct platform_device *pdev = - container_of(dev, struct platform_device, dev); + struct platform_device *pdev = to_platform_device(dev); /* adapted from platform_device_release() in drivers/base/platform.c */ //FIXME is this actually necessary? -- cgit v1.2.3