diff options
| author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-03-20 15:04:26 -0400 |
|---|---|---|
| committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-05-10 04:23:24 -0400 |
| commit | a371b37ccdb97ccf99b25645c7976f6448bb7274 (patch) | |
| tree | 0d5bf5ccc53358421da5788cd06432b5ad42c3b7 | |
| parent | 378b451ede192163780bb15b1ad0a913aa8ee4ae (diff) | |
pata_pcmcia: get rid of extra indirection
We don't need ata_pcmcia_info any more.
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| -rw-r--r-- | drivers/ata/pata_pcmcia.c | 41 |
1 files changed, 6 insertions, 35 deletions
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c index 2aab1e0f6633..aa39bda6441a 100644 --- a/drivers/ata/pata_pcmcia.c +++ b/drivers/ata/pata_pcmcia.c | |||
| @@ -45,16 +45,6 @@ | |||
| 45 | #define DRV_NAME "pata_pcmcia" | 45 | #define DRV_NAME "pata_pcmcia" |
| 46 | #define DRV_VERSION "0.3.5" | 46 | #define DRV_VERSION "0.3.5" |
| 47 | 47 | ||
| 48 | /* | ||
| 49 | * Private data structure to glue stuff together | ||
| 50 | */ | ||
| 51 | |||
| 52 | struct ata_pcmcia_info { | ||
| 53 | struct pcmcia_device *pdev; | ||
| 54 | int ndev; | ||
| 55 | dev_node_t node; | ||
| 56 | }; | ||
| 57 | |||
| 58 | /** | 48 | /** |
| 59 | * pcmcia_set_mode - PCMCIA specific mode setup | 49 | * pcmcia_set_mode - PCMCIA specific mode setup |
| 60 | * @link: link | 50 | * @link: link |
| @@ -248,7 +238,6 @@ static int pcmcia_init_one(struct pcmcia_device *pdev) | |||
| 248 | { | 238 | { |
| 249 | struct ata_host *host; | 239 | struct ata_host *host; |
| 250 | struct ata_port *ap; | 240 | struct ata_port *ap; |
| 251 | struct ata_pcmcia_info *info; | ||
| 252 | struct pcmcia_config_check *stk = NULL; | 241 | struct pcmcia_config_check *stk = NULL; |
| 253 | int is_kme = 0, ret = -ENOMEM, p; | 242 | int is_kme = 0, ret = -ENOMEM, p; |
| 254 | unsigned long io_base, ctl_base; | 243 | unsigned long io_base, ctl_base; |
| @@ -256,14 +245,6 @@ static int pcmcia_init_one(struct pcmcia_device *pdev) | |||
| 256 | int n_ports = 1; | 245 | int n_ports = 1; |
| 257 | struct ata_port_operations *ops = &pcmcia_port_ops; | 246 | struct ata_port_operations *ops = &pcmcia_port_ops; |
| 258 | 247 | ||
| 259 | info = kzalloc(sizeof(*info), GFP_KERNEL); | ||
| 260 | if (info == NULL) | ||
| 261 | return -ENOMEM; | ||
| 262 | |||
| 263 | /* Glue stuff together. FIXME: We may be able to get rid of info with care */ | ||
| 264 | info->pdev = pdev; | ||
| 265 | pdev->priv = info; | ||
| 266 | |||
| 267 | /* Set up attributes in order to probe card and get resources */ | 248 | /* Set up attributes in order to probe card and get resources */ |
| 268 | pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 249 | pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; |
| 269 | pdev->io.Attributes2 = IO_DATA_PATH_WIDTH_8; | 250 | pdev->io.Attributes2 = IO_DATA_PATH_WIDTH_8; |
| @@ -347,16 +328,14 @@ static int pcmcia_init_one(struct pcmcia_device *pdev) | |||
| 347 | if (ret) | 328 | if (ret) |
| 348 | goto failed; | 329 | goto failed; |
| 349 | 330 | ||
| 350 | info->ndev = 1; | 331 | pdev->priv = host; |
| 351 | kfree(stk); | 332 | kfree(stk); |
| 352 | return 0; | 333 | return 0; |
| 353 | 334 | ||
| 354 | failed: | 335 | failed: |
| 355 | kfree(stk); | 336 | kfree(stk); |
| 356 | info->ndev = 0; | ||
| 357 | pcmcia_disable_device(pdev); | 337 | pcmcia_disable_device(pdev); |
| 358 | out1: | 338 | out1: |
| 359 | kfree(info); | ||
| 360 | return ret; | 339 | return ret; |
| 361 | } | 340 | } |
| 362 | 341 | ||
| @@ -370,20 +349,12 @@ out1: | |||
| 370 | 349 | ||
| 371 | static void pcmcia_remove_one(struct pcmcia_device *pdev) | 350 | static void pcmcia_remove_one(struct pcmcia_device *pdev) |
| 372 | { | 351 | { |
| 373 | struct ata_pcmcia_info *info = pdev->priv; | 352 | struct ata_host *host = pdev->priv; |
| 374 | struct device *dev = &pdev->dev; | 353 | |
| 375 | 354 | if (host) | |
| 376 | if (info != NULL) { | 355 | ata_host_detach(host); |
| 377 | /* If we have attached the device to the ATA layer, detach it */ | 356 | |
| 378 | if (info->ndev) { | ||
| 379 | struct ata_host *host = dev_get_drvdata(dev); | ||
| 380 | ata_host_detach(host); | ||
| 381 | } | ||
| 382 | info->ndev = 0; | ||
| 383 | pdev->priv = NULL; | ||
| 384 | } | ||
| 385 | pcmcia_disable_device(pdev); | 357 | pcmcia_disable_device(pdev); |
| 386 | kfree(info); | ||
| 387 | } | 358 | } |
| 388 | 359 | ||
| 389 | static struct pcmcia_device_id pcmcia_devices[] = { | 360 | static struct pcmcia_device_id pcmcia_devices[] = { |
