summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-03-08TTY: simserial, final cleanupJiri Slaby
* remove pointless checks (tty cannot be NULL at that points) * fix some printks (use __func__, print text directly w/o using global strings) * remove some empty lines This is the last patch for simserial. Overall, the driver is 400 lines shorter. Being now at 560 lines. It was tested using ski with a busybox userspace. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: simserial, reindent some codeJiri Slaby
Make the code to conform to the standard. Also make it readable. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: simserial, fix includesJiri Slaby
Use headers from linux/* instead of asm/. Remove declaration of console_drivers, it's in linux/console.h already. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: simserial, remove useless commentsJiri Slaby
Or the obsolete ones like: "Let's have a little bit of fun" I have never had fun with software. For fun, one needs hard-ware. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: simserial, use tty_port_hangupJiri Slaby
Convert shutdown to be tty_port_operations->shutdown. Then we can use tty_port_hangup. (And we have to use tty_port_close.) This means we no longer touch ASYNC_INITIALIZED, TTY_IO_ERROR. Also we do not need to do any peculiar TTY logic in the file now. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: simserial, use tty_port_openJiri Slaby
So now we convert startup to be ->activate of tty_port. This means we no longer care about INITIALIZED and TTY_IO_ERROR flags. After we have ->activate much of the code may go as it duplicates what tty_port_open does. In this case tty_port_open adds block_til_ready to the path. But we do not define carrier hooks, so it is a noop. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: simserial, properly refcount tty_port->ttyJiri Slaby
So that we will not be surprised in the ISR anymore. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: simserial, use tty_port_close_startJiri Slaby
I.e. remove more copied bloat. The only change is that we wait_until_sent now. Which is what we really should do. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: simserial, use tty_port_close_endJiri Slaby
The code is identical except locking. But added locks to protect counts do not hurt here. Rather the contrary. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: simserial, remove some tty opsJiri Slaby
All ->start, ->stop and ->wait_until_sent are empty and need not be defined. The time to remove them is now. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: simserial, define local tty_port pointerJiri Slaby
And use it to make the code more readable. Since tport doesn't conflict with port anymore and there are not many tport accessors left, do also s/\<tport\>/port/g. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: simserial no longer needs serialPJiri Slaby
Let's do a spin-off of serial_state structure with only needed elements. And remove serialP crap from includes. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: simserial, stop using serial_state->{line,icount}Jiri Slaby
* instead of line, use tty->index or an iterator * icount is not made public, only the tx path increments it Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: simserial, remove tmp_bufJiri Slaby
It is totally unused. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: simserial, remove static initializationJiri Slaby
We do not use any of the preinitialized rs_state members for something real. So there is no need to initialize them. At the places we used them for printing, just print the values. And since only one port is supported, get rid of the loop. This simplifies simrs_init a heap. Thus we can handle fail paths in a standard way without panicing. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: amiserial/simserial, use flags from tty_portJiri Slaby
This changes flags' type to ulong which is appropriate for all the set/clear_bits performed in the drivers.. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: amiserial/simserial, use count from tty_portJiri Slaby
Nothing special. Just remove count from serial_state and change all users to use tty_port. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: amiserial/simserial, use close delays from tty_portJiri Slaby
Note that previously simserial set the delay to 0. So we preserve that. BUT, is it correct? Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: amiserial/simserial, use tty_portJiri Slaby
Add tty_port to serial_state and start using common tty port members from tty_port in amiserial and simserial. The rest will follow one by one. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: simserial, pass tty down to functionsJiri Slaby
This avoids pain with tty refcounting and touching tty_port in the future. It allows us to remove some state->tty tests because the tty passed down to them can never be NULL. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: amiserial, pass tty down to functionsJiri Slaby
This avoids pain with tty refcounting and touching tty_port in the future. It allows us to remove some info->tty tests because the tty passed down to them can never be NULL. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: amiserial, simplify set_serial_infoJiri Slaby
Do not copy whole serial_state. We only need to know whether the speed is to be changed. Hence store the info in advance and use it later. A simple bool is enough. Also remove reduntant assignments and move the tests directly to the 'if'. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: serialP, merge serial_state and async_structJiri Slaby
This is the final step to get rid of the one of the structures. A further cleanup will follow. And I struct serial_state deserves cease to exist after a switch to tty_port too. While changing the lines, it removes also pointless tty->driver_data casts. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: amiserial, remove IRQ_portsJiri Slaby
They used to work as a storage for 'info' pointer used in ISRs. They are not really needed. Just pass the pointer through request_irq to the handlers. It was set to NULL and tested in the ISRs, but we do not need the tests as we disable all the interrupts at the same places where NULL sets were. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: simserial, remove IRQ_TJiri Slaby
We do not set ASYNC_SHARE_IRQ anywhere. And since IRQF_DISABLED is a noop, pass zero to request_irq directly instead of this ugly macro. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: simserial, remove support of shared interruptsJiri Slaby
It never worked there. The ISR was never written for that kind of stuff. So remove all that crap with a hash of linked lists and pass the pointer directly to the ISR. BTW this answers the question there: * I don't know exactly why they don't use the dev_id opaque data * pointer instead of this extra lookup table -> Because they thought they will support more devices bound to a single interrupt w/o IRQF_SHARED. They would need exactly the hash there. What I don't understand is rebinding of the interrupt in the shutdown path. They perhaps meant to do just synchronize_irq? In any case, this is all gone and free_irq there properly. By removing the hash we save some bits (exactly NR_IRQS * 8 bytes of .bss and over a kilo of .text): before: text data bss dec hex filename 19600 320 8227 28147 6df3 ../a/ia64/arch/ia64/hp/sim/simserial.o after: text data bss dec hex filename 18568 320 28 18916 49e4 ../a/ia64/arch/ia64/hp/sim/simserial.o Note that a shared interrupt could not work too. request_irq requires data parameter to be non-NULL. So the whole IRQ_T exercise was pointless. Finally, this helps us remove another two members of async_struct :). Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: simserial/amiserial, use one instance of other membersJiri Slaby
This means: * close_delay * closing_wait * line * port * xmit_fifo_size This actually fixes a bug in amiserial. It initializes one and uses the other of the close delays. Yes, duplicating structure members is evil. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: simserial, use only one copy of async flagsJiri Slaby
The same as for amiserial. Use only one instance of the flags. Also remove them from async_struct now. Nobody else uses them. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08simserial, bail out when request_irq failsJiri Slaby
Without this, the code succeeds when the port is opened by root and we get unwanted interrupts storm on the first key stroke. Instead of that, tell the user we failed and that we won't continue. I suppose, the code was copied from the serial layer where we may want to change the irq number, so we must allow open even of the failing port. This is not the case for this driver at all. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08hpsim, initialize chip for assigned irqsJiri Slaby
Currently, when assign_irq_vector is called and the irq connected in the simulator, the irq is not ready. request_irq will return ENOSYS immediately. It is because the irq chip is unset. Hence set the chip properly to irq_type_hp_sim. And make sure this is done from both users of simulated interrupts. Also we have to set handler here, otherwise we end up in handle_bad_int resulting in spam in logs and no irqs handled. We use handle_simple_irq as these are SW interrupts that need no ACK or anything. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08simserial, include some headersJiri Slaby
And remove declarations which are already in the headers. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08hpsim, fix SAL handling in fw-emuJiri Slaby
The switch-cases of SAL_FREQ_BASE generate non-relocatable code. The same as for the ifs one level upper. This causes oopses early in boot because the kernel jumps to the hell instead of the offset in sal callback. So use ifs here for SAL_FREQ_BASE decision too. Isn't there any compiler directive or settings to solve that cleanly? Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: amiserial, use only one copy of async flagsJiri Slaby
Huh, why would one want to store two copies of them? Get rid of the one from async_struct. That structure is going away as a whole soon. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: amiserial, remove tasklet for tty_wakeupJiri Slaby
tty_wakeup is safe to be called from all contexts. No need to schedule a tasklet for that. Let's call it directly like in other drivers. This allows us to kill another member of async_struct structure. (If we remove the dummy uses in simserial.) Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: serialP, remove unused materialJiri Slaby
First, remove unused macro and rs_multiport_struct structure. Nobody uses them at all. Further, the 2 drivers (they are below) which use the rest of structures from serialP.h (async_struct and serial_state) do not use all the members. Remove the members: * which are unused or * which are only initialized and never used for something real. Everybody should avoid the structures with a looong distance. Finally, remove the ALPHA kludge MCR quirks. They are 1:1 copy from 8250.h. No need to redefine them here. The 2 promised users of the structures: arch/ia64/hp/sim/simserial.c drivers/tty/amiserial.c Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: speakup, do not use serialPJiri Slaby
The structures there are going away. And speakup has enough troubles already. So define a structure similar to what 8250 does: old_serial_port. There define an array of speed, port base and so on needed for configuration. Then use this structure instead of serial_state defined in serialP.h. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: William Hubbs <w.d.hubbs@gmail.com> Cc: Chris Brannon <chris@the-brannons.com> Cc: Kirk Reiser <kirk@braille.uwo.ca> Cc: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: remove serialP.h inclusion from some filesJiri Slaby
All of them do not use the ugly interface defined in that header. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: serial, include pci.h in m32r_sioJiri Slaby
It uses pointers to pci_dev, but compiler complains it doesn't know it: In file included from .../m32r_sio.c:53: .../m32r_sio.h:21: warning: "struct pci_dev" declared inside parameter list .../m32r_sio.h:21: warning: its scope is only this definition or declaration, which is probably not what you want .../m32r_sio.h:22: warning: "struct pci_dev" declared inside parameter list Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: serial, use atomic_inc_return in ioc4_serialJiri Slaby
We want to know the value of the atomic variable in intr_connect after the increment. But atomic_inc doesn't, per definition, return the value. It is just a pure coincidence that ia64 defines atomic_inc as atomic_inc_return. So fix this mistake by using atomic_inc_return properly. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: iss/console, use tty_portJiri Slaby
Even though the port is not used for anything real there yet, this will change as tty buffers will be in tty_port in the near future. So the port will be needed in all drivers. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Chris Zankel <chris@zankel.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08XTENSA: iss/console, fix potential deadlockJiri Slaby
If the timer ticks while we are holding the spinlock, the system deadlocks. It is due to synchronous del_timer. So to fix that, use spinlocks that properly disable bottom halves. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Chris Zankel <chris@zankel.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08XTENSA: iss/console, use setup_timerJiri Slaby
Use setup_timer instead of explicit assignments. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Chris Zankel <chris@zankel.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08NET: pc300, show version info from module initJiri Slaby
Again, no need to do that from the pci probe function. Hmm, I noticed this driver is marked as BROKEN. Won't touch it more, it has to be converted to dynamic tty driver allocation first. Perhaps it is time to move it to staging? Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: netdev@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08NET: pc300, do not zero global variablesJiri Slaby
They are in .bss which is initialized to zeros when the module is loaded/kernel booted. What a strange way to do the initialization once in the pci probe routine... Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: netdev@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: ipwireless, fix tty->index handlingJiri Slaby
* do not test if tty->index is in bounds. It is always. * tty->index is not a minor! Fix that. >From now on, let's assume that the parameter of the function is tty index with base being zero. This makes also the code more readable. Factually, there is no real change as tty_driver->minor_start is zero, so the tests are equivalent. But it did not make sense. And if this had changed eventually, it would have caused troubles. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Acked-by: Jiri Kosina <jkosina@suse.cz> Cc: David Sterba <dsterba@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: remove unneeded tty->index checksJiri Slaby
Checking if tty->index is in bounds is not needed. The tty has the index set in the initial open. This is done in get_tty_driver. And it can be only in interval <0,driver->num). So remove the tests which check exactly this interval. Some are left untouched as they check against the current backing device count. (Leaving apart that the check is racy in most of the cases.) Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: serialP, remove DECLARE_WAITQUEUE checkJiri Slaby
The macro is always defined now. This was there only for historical reasons. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08TTY: srmcons, convert to use tty_portJiri Slaby
This is needed because the tty buffer will become a tty_port member later. That will help us to wipe out most of the races and checks for the tty pointer in hot paths. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Matt Turner <mattst88@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08ALPHA: srmcons, fix racy singleton structureJiri Slaby
The test and the assignment were racy. Make it really a singleton. This is achieved by one global variable initialized at the module init. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Matt Turner <mattst88@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-08ALPHA: srmcons, use timer functionsJiri Slaby
It makes the code more readable. We move the setup to the allocation location because we need to initialize timers only once. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Matt Turner <mattst88@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>