diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-01-15 05:18:12 -0500 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2006-03-31 10:15:53 -0500 |
commit | 4bbed5231468014b500b048d7370a1c6c349231a (patch) | |
tree | 5dfafd6a932201fbbfbb2466c11f5392b3240342 | |
parent | 8661bb5b4af1849c1f5a4e80c4e275fd13c155d6 (diff) |
[PATCH] pcmcia: remove export of pcmcia_release_configuration
Handle the _modifying_ operation sm91c92_cs requires in
pcmcia_modify_configuration, so that the only remaining users
of pcmcia_release_configuration() are within the pcmcia core
module.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
-rw-r--r-- | drivers/mtd/maps/pcmciamtd.c | 3 | ||||
-rw-r--r-- | drivers/net/pcmcia/smc91c92_cs.c | 29 | ||||
-rw-r--r-- | drivers/pcmcia/ds_internal.h | 2 | ||||
-rw-r--r-- | drivers/pcmcia/pcmcia_resource.c | 23 | ||||
-rw-r--r-- | include/pcmcia/cs.h | 10 |
5 files changed, 41 insertions, 26 deletions
diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c index f988c817e196..f45ff2581dd3 100644 --- a/drivers/mtd/maps/pcmciamtd.c +++ b/drivers/mtd/maps/pcmciamtd.c | |||
@@ -353,8 +353,7 @@ static void pcmciamtd_release(dev_link_t *link) | |||
353 | } | 353 | } |
354 | pcmcia_release_window(link->win); | 354 | pcmcia_release_window(link->win); |
355 | } | 355 | } |
356 | pcmcia_release_configuration(link->handle); | 356 | pcmcia_disable_device(link->handle); |
357 | link->state &= ~DEV_CONFIG; | ||
358 | } | 357 | } |
359 | 358 | ||
360 | 359 | ||
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c index 84e18bbed9d2..86942c09d8da 100644 --- a/drivers/net/pcmcia/smc91c92_cs.c +++ b/drivers/net/pcmcia/smc91c92_cs.c | |||
@@ -874,11 +874,8 @@ static int smc91c92_suspend(struct pcmcia_device *p_dev) | |||
874 | dev_link_t *link = dev_to_instance(p_dev); | 874 | dev_link_t *link = dev_to_instance(p_dev); |
875 | struct net_device *dev = link->priv; | 875 | struct net_device *dev = link->priv; |
876 | 876 | ||
877 | if (link->state & DEV_CONFIG) { | 877 | if ((link->state & DEV_CONFIG) && (link->open)) |
878 | if (link->open) | 878 | netif_device_detach(dev); |
879 | netif_device_detach(dev); | ||
880 | pcmcia_release_configuration(link->handle); | ||
881 | } | ||
882 | 879 | ||
883 | return 0; | 880 | return 0; |
884 | } | 881 | } |
@@ -894,7 +891,6 @@ static int smc91c92_resume(struct pcmcia_device *p_dev) | |||
894 | if ((smc->manfid == MANFID_MEGAHERTZ) && | 891 | if ((smc->manfid == MANFID_MEGAHERTZ) && |
895 | (smc->cardid == PRODID_MEGAHERTZ_EM3288)) | 892 | (smc->cardid == PRODID_MEGAHERTZ_EM3288)) |
896 | mhz_3288_power(link); | 893 | mhz_3288_power(link); |
897 | pcmcia_request_configuration(link->handle, &link->conf); | ||
898 | if (smc->manfid == MANFID_MOTOROLA) | 894 | if (smc->manfid == MANFID_MOTOROLA) |
899 | mot_config(link); | 895 | mot_config(link); |
900 | if ((smc->manfid == MANFID_OSITECH) && | 896 | if ((smc->manfid == MANFID_OSITECH) && |
@@ -963,18 +959,15 @@ static int check_sig(dev_link_t *link) | |||
963 | } | 959 | } |
964 | 960 | ||
965 | if (width) { | 961 | if (width) { |
966 | printk(KERN_INFO "smc91c92_cs: using 8-bit IO window.\n"); | 962 | modconf_t mod = { |
967 | /* call pcmcia_release_configuration() in _suspend */ | 963 | .Attributes = CONF_IO_CHANGE_WIDTH, |
968 | smc91c92_suspend(link->handle); | 964 | }; |
969 | 965 | printk(KERN_INFO "smc91c92_cs: using 8-bit IO window.\n"); | |
970 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 966 | |
971 | link->handle->socket->io[0].res->flags &= ~IO_DATA_PATH_WIDTH; | 967 | smc91c92_suspend(link->handle); |
972 | link->handle->socket->io[0].res->flags |= IO_DATA_PATH_WIDTH_8; | 968 | pcmcia_modify_configuration(link->handle, &mod); |
973 | 969 | smc91c92_resume(link->handle); | |
974 | /* call pcmcia_request_configuration() in _resume, it handles the | 970 | return check_sig(link); |
975 | * flag update */ | ||
976 | smc91c92_resume(link->handle); | ||
977 | return check_sig(link); | ||
978 | } | 971 | } |
979 | return -ENODEV; | 972 | return -ENODEV; |
980 | } | 973 | } |
diff --git a/drivers/pcmcia/ds_internal.h b/drivers/pcmcia/ds_internal.h index 783d8617a05c..3a2b25e6ed73 100644 --- a/drivers/pcmcia/ds_internal.h +++ b/drivers/pcmcia/ds_internal.h | |||
@@ -8,6 +8,8 @@ extern void pcmcia_put_dev(struct pcmcia_device *p_dev); | |||
8 | 8 | ||
9 | struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int function); | 9 | struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int function); |
10 | 10 | ||
11 | extern int pcmcia_release_configuration(struct pcmcia_device *p_dev); | ||
12 | |||
11 | #ifdef CONFIG_PCMCIA_IOCTL | 13 | #ifdef CONFIG_PCMCIA_IOCTL |
12 | extern void __init pcmcia_setup_ioctl(void); | 14 | extern void __init pcmcia_setup_ioctl(void); |
13 | extern void __exit pcmcia_cleanup_ioctl(void); | 15 | extern void __exit pcmcia_cleanup_ioctl(void); |
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c index f4dcea6ac44b..16504f852af2 100644 --- a/drivers/pcmcia/pcmcia_resource.c +++ b/drivers/pcmcia/pcmcia_resource.c | |||
@@ -442,6 +442,28 @@ int pcmcia_modify_configuration(struct pcmcia_device *p_dev, | |||
442 | (mod->Attributes & CONF_VPP2_CHANGE_VALID)) | 442 | (mod->Attributes & CONF_VPP2_CHANGE_VALID)) |
443 | return CS_BAD_VPP; | 443 | return CS_BAD_VPP; |
444 | 444 | ||
445 | if (mod->Attributes & CONF_IO_CHANGE_WIDTH) { | ||
446 | pccard_io_map io_off = { 0, 0, 0, 0, 1 }; | ||
447 | pccard_io_map io_on; | ||
448 | int i; | ||
449 | |||
450 | io_on.speed = io_speed; | ||
451 | for (i = 0; i < MAX_IO_WIN; i++) { | ||
452 | if (!s->io[i].res) | ||
453 | continue; | ||
454 | io_off.map = i; | ||
455 | io_on.map = i; | ||
456 | |||
457 | io_on.flags = MAP_ACTIVE | IO_DATA_PATH_WIDTH_8; | ||
458 | io_on.start = s->io[i].res->start; | ||
459 | io_on.stop = s->io[i].res->end; | ||
460 | |||
461 | s->ops->set_io_map(s, &io_off); | ||
462 | mdelay(40); | ||
463 | s->ops->set_io_map(s, &io_on); | ||
464 | } | ||
465 | } | ||
466 | |||
445 | return CS_SUCCESS; | 467 | return CS_SUCCESS; |
446 | } /* modify_configuration */ | 468 | } /* modify_configuration */ |
447 | EXPORT_SYMBOL(pcmcia_modify_configuration); | 469 | EXPORT_SYMBOL(pcmcia_modify_configuration); |
@@ -479,7 +501,6 @@ int pcmcia_release_configuration(struct pcmcia_device *p_dev) | |||
479 | 501 | ||
480 | return CS_SUCCESS; | 502 | return CS_SUCCESS; |
481 | } /* pcmcia_release_configuration */ | 503 | } /* pcmcia_release_configuration */ |
482 | EXPORT_SYMBOL(pcmcia_release_configuration); | ||
483 | 504 | ||
484 | 505 | ||
485 | /** pcmcia_release_io | 506 | /** pcmcia_release_io |
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h index 7b915200c116..087b3bc0489c 100644 --- a/include/pcmcia/cs.h +++ b/include/pcmcia/cs.h | |||
@@ -116,10 +116,11 @@ typedef struct modconf_t { | |||
116 | } modconf_t; | 116 | } modconf_t; |
117 | 117 | ||
118 | /* Attributes for ModifyConfiguration */ | 118 | /* Attributes for ModifyConfiguration */ |
119 | #define CONF_IRQ_CHANGE_VALID 0x100 | 119 | #define CONF_IRQ_CHANGE_VALID 0x0100 |
120 | #define CONF_VCC_CHANGE_VALID 0x200 | 120 | #define CONF_VCC_CHANGE_VALID 0x0200 |
121 | #define CONF_VPP1_CHANGE_VALID 0x400 | 121 | #define CONF_VPP1_CHANGE_VALID 0x0400 |
122 | #define CONF_VPP2_CHANGE_VALID 0x800 | 122 | #define CONF_VPP2_CHANGE_VALID 0x0800 |
123 | #define CONF_IO_CHANGE_WIDTH 0x1000 | ||
123 | 124 | ||
124 | /* For RequestConfiguration */ | 125 | /* For RequestConfiguration */ |
125 | typedef struct config_req_t { | 126 | typedef struct config_req_t { |
@@ -378,7 +379,6 @@ int pcmcia_get_status(struct pcmcia_device *p_dev, cs_status_t *status); | |||
378 | int pcmcia_get_mem_page(window_handle_t win, memreq_t *req); | 379 | int pcmcia_get_mem_page(window_handle_t win, memreq_t *req); |
379 | int pcmcia_map_mem_page(window_handle_t win, memreq_t *req); | 380 | int pcmcia_map_mem_page(window_handle_t win, memreq_t *req); |
380 | int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); | 381 | int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); |
381 | int pcmcia_release_configuration(struct pcmcia_device *p_dev); | ||
382 | int pcmcia_release_window(window_handle_t win); | 382 | int pcmcia_release_window(window_handle_t win); |
383 | int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req); | 383 | int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req); |
384 | int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req); | 384 | int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req); |