From 15b99ac1729503db9e6dc642a50b9b6cb3bf51f9 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Fri, 31 Mar 2006 17:26:06 +0200 Subject: [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 --- drivers/scsi/pcmcia/aha152x_stub.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'drivers/scsi/pcmcia/aha152x_stub.c') diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c index 21c6b101453..7caa700cf18 100644 --- a/drivers/scsi/pcmcia/aha152x_stub.c +++ b/drivers/scsi/pcmcia/aha152x_stub.c @@ -96,11 +96,11 @@ typedef struct scsi_info_t { static void aha152x_release_cs(struct pcmcia_device *link); static void aha152x_detach(struct pcmcia_device *p_dev); -static void aha152x_config_cs(struct pcmcia_device *link); +static int aha152x_config_cs(struct pcmcia_device *link); static struct pcmcia_device *dev_list; -static int aha152x_attach(struct pcmcia_device *link) +static int aha152x_probe(struct pcmcia_device *link) { scsi_info_t *info; @@ -123,9 +123,7 @@ static int aha152x_attach(struct pcmcia_device *link) link->conf.Present = PRESENT_OPTION; link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; - aha152x_config_cs(link); - - return 0; + return aha152x_config_cs(link); } /* aha152x_attach */ /*====================================================================*/ @@ -146,7 +144,7 @@ static void aha152x_detach(struct pcmcia_device *link) #define CS_CHECK(fn, ret) \ do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) -static void aha152x_config_cs(struct pcmcia_device *link) +static int aha152x_config_cs(struct pcmcia_device *link) { scsi_info_t *info = link->priv; struct aha152x_setup s; @@ -219,12 +217,12 @@ static void aha152x_config_cs(struct pcmcia_device *link) info->host = host; link->state &= ~DEV_CONFIG_PENDING; - return; - + return 0; + cs_failed: cs_error(link, last_fn, last_ret); aha152x_release_cs(link); - return; + return -ENODEV; } static void aha152x_release_cs(struct pcmcia_device *link) @@ -259,7 +257,7 @@ static struct pcmcia_driver aha152x_cs_driver = { .drv = { .name = "aha152x_cs", }, - .probe = aha152x_attach, + .probe = aha152x_probe, .remove = aha152x_detach, .id_table = aha152x_ids, .resume = aha152x_resume, @@ -278,4 +276,3 @@ static void __exit exit_aha152x_cs(void) module_init(init_aha152x_cs); module_exit(exit_aha152x_cs); - -- cgit v1.2.3