aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/pcmcia/driver-changes.txt5
-rw-r--r--drivers/pcmcia/ds.c101
-rw-r--r--include/pcmcia/ds.h36
3 files changed, 5 insertions, 137 deletions
diff --git a/Documentation/pcmcia/driver-changes.txt b/Documentation/pcmcia/driver-changes.txt
index adfb83e58675..446f43b309df 100644
--- a/Documentation/pcmcia/driver-changes.txt
+++ b/Documentation/pcmcia/driver-changes.txt
@@ -1,5 +1,10 @@
1This file details changes in 2.6 which affect PCMCIA card driver authors: 1This file details changes in 2.6 which affect PCMCIA card driver authors:
2 2
3* no cs_error / CS_CHECK / CONFIG_PCMCIA_DEBUG (as of 2.6.33)
4 Instead of the cs_error() callback or the CS_CHECK() macro, please use
5 Linux-style checking of return values, and -- if necessary -- debug
6 messages using "dev_dbg()" or "pr_debug()".
7
3* New CIS tuple access (as of 2.6.33) 8* New CIS tuple access (as of 2.6.33)
4 Instead of pcmcia_get_{first,next}_tuple(), pcmcia_get_tuple_data() and 9 Instead of pcmcia_get_{first,next}_tuple(), pcmcia_get_tuple_data() and
5 pcmcia_parse_tuple(), a driver shall use "pcmcia_get_tuple()" if it is 10 pcmcia_parse_tuple(), a driver shall use "pcmcia_get_tuple()" if it is
diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
index 5b069aeaf17a..05893d41dd41 100644
--- a/drivers/pcmcia/ds.c
+++ b/drivers/pcmcia/ds.c
@@ -46,107 +46,6 @@ spinlock_t pcmcia_dev_list_lock;
46 46
47/*====================================================================*/ 47/*====================================================================*/
48 48
49/* code which was in cs.c before */
50
51/* String tables for error messages */
52
53typedef struct lookup_t {
54 const int key;
55 const char *msg;
56} lookup_t;
57
58static const lookup_t error_table[] = {
59 { 0, "Operation succeeded" },
60 { -EIO, "Input/Output error" },
61 { -ENODEV, "No card present" },
62 { -EINVAL, "Bad parameter" },
63 { -EACCES, "Configuration locked" },
64 { -EBUSY, "Resource in use" },
65 { -ENOSPC, "No more items" },
66 { -ENOMEM, "Out of resource" },
67};
68
69
70static const lookup_t service_table[] = {
71 { AccessConfigurationRegister, "AccessConfigurationRegister" },
72 { AddSocketServices, "AddSocketServices" },
73 { AdjustResourceInfo, "AdjustResourceInfo" },
74 { CheckEraseQueue, "CheckEraseQueue" },
75 { CloseMemory, "CloseMemory" },
76 { DeregisterClient, "DeregisterClient" },
77 { DeregisterEraseQueue, "DeregisterEraseQueue" },
78 { GetCardServicesInfo, "GetCardServicesInfo" },
79 { GetClientInfo, "GetClientInfo" },
80 { GetConfigurationInfo, "GetConfigurationInfo" },
81 { GetEventMask, "GetEventMask" },
82 { GetFirstClient, "GetFirstClient" },
83 { GetFirstRegion, "GetFirstRegion" },
84 { GetFirstTuple, "GetFirstTuple" },
85 { GetNextClient, "GetNextClient" },
86 { GetNextRegion, "GetNextRegion" },
87 { GetNextTuple, "GetNextTuple" },
88 { GetStatus, "GetStatus" },
89 { GetTupleData, "GetTupleData" },
90 { MapMemPage, "MapMemPage" },
91 { ModifyConfiguration, "ModifyConfiguration" },
92 { ModifyWindow, "ModifyWindow" },
93 { OpenMemory, "OpenMemory" },
94 { ParseTuple, "ParseTuple" },
95 { ReadMemory, "ReadMemory" },
96 { RegisterClient, "RegisterClient" },
97 { RegisterEraseQueue, "RegisterEraseQueue" },
98 { RegisterMTD, "RegisterMTD" },
99 { ReleaseConfiguration, "ReleaseConfiguration" },
100 { ReleaseIO, "ReleaseIO" },
101 { ReleaseIRQ, "ReleaseIRQ" },
102 { ReleaseWindow, "ReleaseWindow" },
103 { RequestConfiguration, "RequestConfiguration" },
104 { RequestIO, "RequestIO" },
105 { RequestIRQ, "RequestIRQ" },
106 { RequestSocketMask, "RequestSocketMask" },
107 { RequestWindow, "RequestWindow" },
108 { ResetCard, "ResetCard" },
109 { SetEventMask, "SetEventMask" },
110 { ValidateCIS, "ValidateCIS" },
111 { WriteMemory, "WriteMemory" },
112 { BindDevice, "BindDevice" },
113 { BindMTD, "BindMTD" },
114 { ReportError, "ReportError" },
115 { SuspendCard, "SuspendCard" },
116 { ResumeCard, "ResumeCard" },
117 { EjectCard, "EjectCard" },
118 { InsertCard, "InsertCard" },
119 { ReplaceCIS, "ReplaceCIS" }
120};
121
122const char *pcmcia_error_func(int func)
123{
124 int i;
125
126 for (i = 0; i < ARRAY_SIZE(service_table); i++)
127 if (service_table[i].key == func)
128 return service_table[i].msg;
129
130 return "Unknown service number";
131}
132EXPORT_SYMBOL(pcmcia_error_func);
133
134const char *pcmcia_error_ret(int ret)
135{
136 int i;
137
138 for (i = 0; i < ARRAY_SIZE(error_table); i++)
139 if (error_table[i].key == ret)
140 return error_table[i].msg;
141
142 return "unknown";
143}
144EXPORT_SYMBOL(pcmcia_error_ret);
145
146/*======================================================================*/
147
148
149
150static void pcmcia_check_driver(struct pcmcia_driver *p_drv) 49static void pcmcia_check_driver(struct pcmcia_driver *p_drv)
151{ 50{
152 struct pcmcia_device_id *did = p_drv->id_table; 51 struct pcmcia_device_id *did = p_drv->id_table;
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 6c37d4ed7832..d82392de4e92 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -142,42 +142,6 @@ struct pcmcia_device {
142#define handle_to_dev(handle) (handle->dev) 142#define handle_to_dev(handle) (handle->dev)
143 143
144 144
145/* (deprecated) error reporting by PCMCIA devices. Use dev_printk()
146 * or dev_dbg() directly in the driver, without referring to pcmcia_error_func()
147 * and/or pcmcia_error_ret() for those functions will go away soon.
148 */
149enum service {
150 AccessConfigurationRegister, AddSocketServices,
151 AdjustResourceInfo, CheckEraseQueue, CloseMemory, CopyMemory,
152 DeregisterClient, DeregisterEraseQueue, GetCardServicesInfo,
153 GetClientInfo, GetConfigurationInfo, GetEventMask,
154 GetFirstClient, GetFirstPartion, GetFirstRegion, GetFirstTuple,
155 GetNextClient, GetNextPartition, GetNextRegion, GetNextTuple,
156 GetStatus, GetTupleData, MapLogSocket, MapLogWindow, MapMemPage,
157 MapPhySocket, MapPhyWindow, ModifyConfiguration, ModifyWindow,
158 OpenMemory, ParseTuple, ReadMemory, RegisterClient,
159 RegisterEraseQueue, RegisterMTD, RegisterTimer,
160 ReleaseConfiguration, ReleaseExclusive, ReleaseIO, ReleaseIRQ,
161 ReleaseSocketMask, ReleaseWindow, ReplaceSocketServices,
162 RequestConfiguration, RequestExclusive, RequestIO, RequestIRQ,
163 RequestSocketMask, RequestWindow, ResetCard, ReturnSSEntry,
164 SetEventMask, SetRegion, ValidateCIS, VendorSpecific,
165 WriteMemory, BindDevice, BindMTD, ReportError,
166 SuspendCard, ResumeCard, EjectCard, InsertCard, ReplaceCIS,
167 GetFirstWindow, GetNextWindow, GetMemPage
168};
169const char *pcmcia_error_func(int func);
170const char *pcmcia_error_ret(int ret);
171
172#define cs_error(p_dev, func, ret) \
173 { \
174 dev_printk(KERN_NOTICE, &p_dev->dev, \
175 "%s : %s\n", \
176 pcmcia_error_func(func), \
177 pcmcia_error_ret(ret)); \
178 }
179
180
181/* 145/*
182 * CIS access. 146 * CIS access.
183 * 147 *