[PATCH] pcmcia: ds.c cleanup

Clean up ds.c

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Dominik Brodowski and committed by Linus Torvalds 3448139b 33519ddd

+58 -62
-34
drivers/pcmcia/pcmcia_compat.c
··· 74 74 } 75 75 EXPORT_SYMBOL(pcmcia_validate_cis); 76 76 77 - int pcmcia_get_configuration_info(client_handle_t handle, 78 - config_info_t *config) 79 - { 80 - struct pcmcia_socket *s; 81 - 82 - if ((CHECK_HANDLE(handle)) || !config) 83 - return CS_BAD_HANDLE; 84 - s = SOCKET(handle); 85 - if (!s) 86 - return CS_BAD_HANDLE; 87 - return pccard_get_configuration_info(s, handle->Function, config); 88 - } 89 - EXPORT_SYMBOL(pcmcia_get_configuration_info); 90 77 91 78 int pcmcia_reset_card(client_handle_t handle, client_req_t *req) 92 79 { ··· 88 101 return pccard_reset_card(skt); 89 102 } 90 103 EXPORT_SYMBOL(pcmcia_reset_card); 91 - 92 - int pcmcia_get_status(client_handle_t handle, cs_status_t *status) 93 - { 94 - struct pcmcia_socket *s; 95 - if (CHECK_HANDLE(handle)) 96 - return CS_BAD_HANDLE; 97 - s = SOCKET(handle); 98 - return pccard_get_status(s, handle->Function, status); 99 - } 100 - EXPORT_SYMBOL(pcmcia_get_status); 101 - 102 - int pcmcia_access_configuration_register(client_handle_t handle, 103 - conf_reg_t *reg) 104 - { 105 - struct pcmcia_socket *s; 106 - if (CHECK_HANDLE(handle)) 107 - return CS_BAD_HANDLE; 108 - s = SOCKET(handle); 109 - return pccard_access_configuration_register(s, handle->Function, reg); 110 - } 111 - EXPORT_SYMBOL(pcmcia_access_configuration_register); 112 104
+23
drivers/pcmcia/pcmcia_ioctl.c
··· 71 71 #define ds_dbg(lvl, fmt, arg...) do { } while (0) 72 72 #endif 73 73 74 + static const char *release = "Linux Kernel Card Services"; 75 + 76 + /** pcmcia_get_card_services_info 77 + * 78 + * Return information about this version of Card Services 79 + */ 80 + static int pcmcia_get_card_services_info(servinfo_t *info) 81 + { 82 + unsigned int socket_count = 0; 83 + struct list_head *tmp; 84 + info->Signature[0] = 'C'; 85 + info->Signature[1] = 'S'; 86 + down_read(&pcmcia_socket_list_rwsem); 87 + list_for_each(tmp, &pcmcia_socket_list) 88 + socket_count++; 89 + up_read(&pcmcia_socket_list_rwsem); 90 + info->Count = socket_count; 91 + info->Revision = CS_RELEASE_CODE; 92 + info->CSLevel = 0x0210; 93 + info->VendorString = (char *)release; 94 + return CS_SUCCESS; 95 + } /* get_card_services_info */ 96 + 74 97 75 98 /* backwards-compatible accessing of driver --- by name! */ 76 99
+35 -27
drivers/pcmcia/pcmcia_resource.c
··· 36 36 #include "ds_internal.h" 37 37 38 38 39 - static const char *release = "Linux Kernel Card Services"; 40 - 41 39 /* Access speed for IO windows */ 42 40 static int io_speed = 0; 43 41 module_param(io_speed, int, 0444); ··· 200 202 } 201 203 return CS_SUCCESS; 202 204 } /* pccard_access_configuration_register */ 203 - EXPORT_SYMBOL(pccard_access_configuration_register); 205 + 206 + int pcmcia_access_configuration_register(client_handle_t handle, 207 + conf_reg_t *reg) 208 + { 209 + struct pcmcia_socket *s; 210 + if (CHECK_HANDLE(handle)) 211 + return CS_BAD_HANDLE; 212 + s = SOCKET(handle); 213 + return pccard_access_configuration_register(s, handle->Function, reg); 214 + } 215 + EXPORT_SYMBOL(pcmcia_access_configuration_register); 216 + 204 217 205 218 206 219 int pccard_get_configuration_info(struct pcmcia_socket *s, ··· 269 260 270 261 return CS_SUCCESS; 271 262 } /* pccard_get_configuration_info */ 272 - EXPORT_SYMBOL(pccard_get_configuration_info); 273 263 274 - 275 - /** pcmcia_get_card_services_info 276 - * 277 - * Return information about this version of Card Services 278 - */ 279 - 280 - int pcmcia_get_card_services_info(servinfo_t *info) 264 + int pcmcia_get_configuration_info(client_handle_t handle, 265 + config_info_t *config) 281 266 { 282 - unsigned int socket_count = 0; 283 - struct list_head *tmp; 284 - info->Signature[0] = 'C'; 285 - info->Signature[1] = 'S'; 286 - down_read(&pcmcia_socket_list_rwsem); 287 - list_for_each(tmp, &pcmcia_socket_list) 288 - socket_count++; 289 - up_read(&pcmcia_socket_list_rwsem); 290 - info->Count = socket_count; 291 - info->Revision = CS_RELEASE_CODE; 292 - info->CSLevel = 0x0210; 293 - info->VendorString = (char *)release; 294 - return CS_SUCCESS; 295 - } /* get_card_services_info */ 296 - EXPORT_SYMBOL(pcmcia_get_card_services_info); 267 + struct pcmcia_socket *s; 268 + 269 + if ((CHECK_HANDLE(handle)) || !config) 270 + return CS_BAD_HANDLE; 271 + s = SOCKET(handle); 272 + if (!s) 273 + return CS_BAD_HANDLE; 274 + return pccard_get_configuration_info(s, handle->Function, config); 275 + } 276 + EXPORT_SYMBOL(pcmcia_get_configuration_info); 297 277 298 278 299 279 /** pcmcia_get_window ··· 377 379 (val & SS_READY) ? CS_EVENT_READY_CHANGE : 0; 378 380 return CS_SUCCESS; 379 381 } /* pccard_get_status */ 380 - EXPORT_SYMBOL(pccard_get_status); 382 + 383 + int pcmcia_get_status(client_handle_t handle, cs_status_t *status) 384 + { 385 + struct pcmcia_socket *s; 386 + if (CHECK_HANDLE(handle)) 387 + return CS_BAD_HANDLE; 388 + s = SOCKET(handle); 389 + return pccard_get_status(s, handle->Function, status); 390 + } 391 + EXPORT_SYMBOL(pcmcia_get_status); 392 + 381 393 382 394 383 395 /** pcmcia_get_mem_page
-1
include/pcmcia/cs.h
··· 396 396 int pcmcia_access_configuration_register(client_handle_t handle, conf_reg_t *reg); 397 397 int pcmcia_deregister_client(client_handle_t handle); 398 398 int pcmcia_get_configuration_info(client_handle_t handle, config_info_t *config); 399 - int pcmcia_get_card_services_info(servinfo_t *info); 400 399 int pcmcia_get_first_window(window_handle_t *win, win_req_t *req); 401 400 int pcmcia_get_next_window(window_handle_t *win, win_req_t *req); 402 401 int pcmcia_get_status(client_handle_t handle, cs_status_t *status);