Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/qdio: consolidate thinint init/exit

Wrap the init/exit steps for thinint into a single helper that follows
the established naming scheme.

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Reviewed-by: Steffen Maier <maier@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>

authored by

Julian Wiedmann and committed by
Vasily Gorbik
3050f022 75e82bec

+24 -41
+2 -4
drivers/s390/cio/qdio.h
··· 369 369 void tiqdio_add_device(struct qdio_irq *irq_ptr); 370 370 void tiqdio_remove_device(struct qdio_irq *irq_ptr); 371 371 void tiqdio_inbound_processing(unsigned long q); 372 - int tiqdio_allocate_memory(void); 373 - void tiqdio_free_memory(void); 374 - int tiqdio_register_thinints(void); 375 - void tiqdio_unregister_thinints(void); 372 + int qdio_thinint_init(void); 373 + void qdio_thinint_exit(void); 376 374 int test_nonshared_ind(struct qdio_irq *); 377 375 378 376 /* prototypes for setup */
+2 -8
drivers/s390/cio/qdio_main.c
··· 1861 1861 rc = qdio_setup_init(); 1862 1862 if (rc) 1863 1863 goto out_debug; 1864 - rc = tiqdio_allocate_memory(); 1864 + rc = qdio_thinint_init(); 1865 1865 if (rc) 1866 1866 goto out_cache; 1867 - rc = tiqdio_register_thinints(); 1868 - if (rc) 1869 - goto out_ti; 1870 1867 return 0; 1871 1868 1872 - out_ti: 1873 - tiqdio_free_memory(); 1874 1869 out_cache: 1875 1870 qdio_setup_exit(); 1876 1871 out_debug: ··· 1875 1880 1876 1881 static void __exit exit_QDIO(void) 1877 1882 { 1878 - tiqdio_unregister_thinints(); 1879 - tiqdio_free_memory(); 1883 + qdio_thinint_exit(); 1880 1884 qdio_setup_exit(); 1881 1885 qdio_debug_exit(); 1882 1886 }
+20 -29
drivers/s390/cio/qdio_thinint.c
··· 197 197 return rc; 198 198 } 199 199 200 - /* allocate non-shared indicators and shared indicator */ 201 - int __init tiqdio_allocate_memory(void) 202 - { 203 - q_indicators = kcalloc(TIQDIO_NR_INDICATORS, 204 - sizeof(struct indicator_t), 205 - GFP_KERNEL); 206 - if (!q_indicators) 207 - return -ENOMEM; 208 - return 0; 209 - } 210 - 211 - void tiqdio_free_memory(void) 212 - { 213 - kfree(q_indicators); 214 - } 215 - 216 - int __init tiqdio_register_thinints(void) 217 - { 218 - int rc; 219 - 220 - rc = register_adapter_interrupt(&tiqdio_airq); 221 - if (rc) { 222 - DBF_EVENT("RTI:%x", rc); 223 - return rc; 224 - } 225 - return 0; 226 - } 227 - 228 200 int qdio_establish_thinint(struct qdio_irq *irq_ptr) 229 201 { 230 202 int rc; ··· 224 252 put_indicator(irq_ptr->dsci); 225 253 } 226 254 227 - void __exit tiqdio_unregister_thinints(void) 255 + int __init qdio_thinint_init(void) 256 + { 257 + int rc; 258 + 259 + q_indicators = kcalloc(TIQDIO_NR_INDICATORS, sizeof(struct indicator_t), 260 + GFP_KERNEL); 261 + if (!q_indicators) 262 + return -ENOMEM; 263 + 264 + rc = register_adapter_interrupt(&tiqdio_airq); 265 + if (rc) { 266 + DBF_EVENT("RTI:%x", rc); 267 + kfree(q_indicators); 268 + return rc; 269 + } 270 + return 0; 271 + } 272 + 273 + void __exit qdio_thinint_exit(void) 228 274 { 229 275 WARN_ON(!list_empty(&tiq_list)); 230 276 unregister_adapter_interrupt(&tiqdio_airq); 277 + kfree(q_indicators); 231 278 }