aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia/aha152x_stub.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:26:06 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-03-31 10:26:06 -0500
commit15b99ac1729503db9e6dc642a50b9b6cb3bf51f9 (patch)
treecfb8897487beba502aac2b28bc35066a87e34299 /drivers/scsi/pcmcia/aha152x_stub.c
parentfba395eee7d3f342ca739c20f5b3ee635d0420a0 (diff)
[PATCH] pcmcia: add return value to _config() functions
Most of the driver initialization isn't done in the .probe function, but in the internal _config() functions. Make them return a value, so that .probe can properly report whether the probing of the device succeeded or not. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/scsi/pcmcia/aha152x_stub.c')
-rw-r--r--drivers/scsi/pcmcia/aha152x_stub.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c
index 21c6b1014535..7caa700cf189 100644
--- a/drivers/scsi/pcmcia/aha152x_stub.c
+++ b/drivers/scsi/pcmcia/aha152x_stub.c
@@ -96,11 +96,11 @@ typedef struct scsi_info_t {
96 96
97static void aha152x_release_cs(struct pcmcia_device *link); 97static void aha152x_release_cs(struct pcmcia_device *link);
98static void aha152x_detach(struct pcmcia_device *p_dev); 98static void aha152x_detach(struct pcmcia_device *p_dev);
99static void aha152x_config_cs(struct pcmcia_device *link); 99static int aha152x_config_cs(struct pcmcia_device *link);
100 100
101static struct pcmcia_device *dev_list; 101static struct pcmcia_device *dev_list;
102 102
103static int aha152x_attach(struct pcmcia_device *link) 103static int aha152x_probe(struct pcmcia_device *link)
104{ 104{
105 scsi_info_t *info; 105 scsi_info_t *info;
106 106
@@ -123,9 +123,7 @@ static int aha152x_attach(struct pcmcia_device *link)
123 link->conf.Present = PRESENT_OPTION; 123 link->conf.Present = PRESENT_OPTION;
124 124
125 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 125 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
126 aha152x_config_cs(link); 126 return aha152x_config_cs(link);
127
128 return 0;
129} /* aha152x_attach */ 127} /* aha152x_attach */
130 128
131/*====================================================================*/ 129/*====================================================================*/
@@ -146,7 +144,7 @@ static void aha152x_detach(struct pcmcia_device *link)
146#define CS_CHECK(fn, ret) \ 144#define CS_CHECK(fn, ret) \
147do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 145do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
148 146
149static void aha152x_config_cs(struct pcmcia_device *link) 147static int aha152x_config_cs(struct pcmcia_device *link)
150{ 148{
151 scsi_info_t *info = link->priv; 149 scsi_info_t *info = link->priv;
152 struct aha152x_setup s; 150 struct aha152x_setup s;
@@ -219,12 +217,12 @@ static void aha152x_config_cs(struct pcmcia_device *link)
219 info->host = host; 217 info->host = host;
220 218
221 link->state &= ~DEV_CONFIG_PENDING; 219 link->state &= ~DEV_CONFIG_PENDING;
222 return; 220 return 0;
223 221
224cs_failed: 222cs_failed:
225 cs_error(link, last_fn, last_ret); 223 cs_error(link, last_fn, last_ret);
226 aha152x_release_cs(link); 224 aha152x_release_cs(link);
227 return; 225 return -ENODEV;
228} 226}
229 227
230static void aha152x_release_cs(struct pcmcia_device *link) 228static void aha152x_release_cs(struct pcmcia_device *link)
@@ -259,7 +257,7 @@ static struct pcmcia_driver aha152x_cs_driver = {
259 .drv = { 257 .drv = {
260 .name = "aha152x_cs", 258 .name = "aha152x_cs",
261 }, 259 },
262 .probe = aha152x_attach, 260 .probe = aha152x_probe,
263 .remove = aha152x_detach, 261 .remove = aha152x_detach,
264 .id_table = aha152x_ids, 262 .id_table = aha152x_ids,
265 .resume = aha152x_resume, 263 .resume = aha152x_resume,
@@ -278,4 +276,3 @@ static void __exit exit_aha152x_cs(void)
278 276
279module_init(init_aha152x_cs); 277module_init(init_aha152x_cs);
280module_exit(exit_aha152x_cs); 278module_exit(exit_aha152x_cs);
281