diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2010-08-09 03:49:58 +0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2010-08-09 04:14:15 +0400 |
commit | d9a145fb6e5f37b9903dea8371ab5c3e34e8e2d1 (patch) | |
tree | e2b4bb46fa00f0ad20447e40dba6fb21a4ae0815 /drivers/ata/ahci_platform.c | |
parent | c9243f5bdd6637b2bb7dc254b54d9edf957ef17e (diff) | |
parent | 45d7f32c7a43cbb9592886d38190e379e2eb2226 (diff) | |
download | linux-d9a145fb6e5f37b9903dea8371ab5c3e34e8e2d1.tar.xz |
Merge commit 'linus/master' into bkl/core
Merge reason: The staging tree has introduced the easycap
driver lately. We need the latest updates to pushdown the
bkl in its ioctl helper.
Diffstat (limited to 'drivers/ata/ahci_platform.c')
-rw-r--r-- | drivers/ata/ahci_platform.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index 5e11b160f247..4e97f33cca44 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c @@ -54,19 +54,13 @@ static int __init ahci_probe(struct platform_device *pdev) return -EINVAL; } - if (pdata && pdata->init) { - rc = pdata->init(dev); - if (rc) - return rc; - } - if (pdata && pdata->ata_port_info) pi = *pdata->ata_port_info; hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL); if (!hpriv) { - rc = -ENOMEM; - goto err0; + dev_err(dev, "can't alloc ahci_host_priv\n"); + return -ENOMEM; } hpriv->flags |= (unsigned long)pi.private_data; @@ -74,8 +68,19 @@ static int __init ahci_probe(struct platform_device *pdev) hpriv->mmio = devm_ioremap(dev, mem->start, resource_size(mem)); if (!hpriv->mmio) { dev_err(dev, "can't map %pR\n", mem); - rc = -ENOMEM; - goto err0; + return -ENOMEM; + } + + /* + * Some platforms might need to prepare for mmio region access, + * which could be done in the following init call. So, the mmio + * region shouldn't be accessed before init (if provided) has + * returned successfully. + */ + if (pdata && pdata->init) { + rc = pdata->init(dev, hpriv->mmio); + if (rc) + return rc; } ahci_save_initial_config(dev, hpriv, @@ -166,7 +171,6 @@ static int __devexit ahci_remove(struct platform_device *pdev) } static struct platform_driver ahci_driver = { - .probe = ahci_probe, .remove = __devexit_p(ahci_remove), .driver = { .name = "ahci", |