diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ata/sata_mv.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index f5333cec2dfa..04b571764aff 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -2881,6 +2881,26 @@ done: | |||
2881 | return rc; | 2881 | return rc; |
2882 | } | 2882 | } |
2883 | 2883 | ||
2884 | static int mv_create_dma_pools(struct mv_host_priv *hpriv, struct device *dev) | ||
2885 | { | ||
2886 | hpriv->crqb_pool = dmam_pool_create("crqb_q", dev, MV_CRQB_Q_SZ, | ||
2887 | MV_CRQB_Q_SZ, 0); | ||
2888 | if (!hpriv->crqb_pool) | ||
2889 | return -ENOMEM; | ||
2890 | |||
2891 | hpriv->crpb_pool = dmam_pool_create("crpb_q", dev, MV_CRPB_Q_SZ, | ||
2892 | MV_CRPB_Q_SZ, 0); | ||
2893 | if (!hpriv->crpb_pool) | ||
2894 | return -ENOMEM; | ||
2895 | |||
2896 | hpriv->sg_tbl_pool = dmam_pool_create("sg_tbl", dev, MV_SG_TBL_SZ, | ||
2897 | MV_SG_TBL_SZ, 0); | ||
2898 | if (!hpriv->sg_tbl_pool) | ||
2899 | return -ENOMEM; | ||
2900 | |||
2901 | return 0; | ||
2902 | } | ||
2903 | |||
2884 | /** | 2904 | /** |
2885 | * mv_platform_probe - handle a positive probe of an soc Marvell | 2905 | * mv_platform_probe - handle a positive probe of an soc Marvell |
2886 | * host | 2906 | * host |
@@ -2934,6 +2954,10 @@ static int mv_platform_probe(struct platform_device *pdev) | |||
2934 | hpriv->base = ioremap(res->start, res->end - res->start + 1); | 2954 | hpriv->base = ioremap(res->start, res->end - res->start + 1); |
2935 | hpriv->base -= MV_SATAHC0_REG_BASE; | 2955 | hpriv->base -= MV_SATAHC0_REG_BASE; |
2936 | 2956 | ||
2957 | rc = mv_create_dma_pools(hpriv, &pdev->dev); | ||
2958 | if (rc) | ||
2959 | return rc; | ||
2960 | |||
2937 | /* initialize adapter */ | 2961 | /* initialize adapter */ |
2938 | rc = mv_init_host(host, chip_soc); | 2962 | rc = mv_init_host(host, chip_soc); |
2939 | if (rc) | 2963 | if (rc) |
@@ -3070,26 +3094,6 @@ static void mv_print_info(struct ata_host *host) | |||
3070 | scc_s, (MV_HP_FLAG_MSI & hpriv->hp_flags) ? "MSI" : "INTx"); | 3094 | scc_s, (MV_HP_FLAG_MSI & hpriv->hp_flags) ? "MSI" : "INTx"); |
3071 | } | 3095 | } |
3072 | 3096 | ||
3073 | static int mv_create_dma_pools(struct mv_host_priv *hpriv, struct device *dev) | ||
3074 | { | ||
3075 | hpriv->crqb_pool = dmam_pool_create("crqb_q", dev, MV_CRQB_Q_SZ, | ||
3076 | MV_CRQB_Q_SZ, 0); | ||
3077 | if (!hpriv->crqb_pool) | ||
3078 | return -ENOMEM; | ||
3079 | |||
3080 | hpriv->crpb_pool = dmam_pool_create("crpb_q", dev, MV_CRPB_Q_SZ, | ||
3081 | MV_CRPB_Q_SZ, 0); | ||
3082 | if (!hpriv->crpb_pool) | ||
3083 | return -ENOMEM; | ||
3084 | |||
3085 | hpriv->sg_tbl_pool = dmam_pool_create("sg_tbl", dev, MV_SG_TBL_SZ, | ||
3086 | MV_SG_TBL_SZ, 0); | ||
3087 | if (!hpriv->sg_tbl_pool) | ||
3088 | return -ENOMEM; | ||
3089 | |||
3090 | return 0; | ||
3091 | } | ||
3092 | |||
3093 | /** | 3097 | /** |
3094 | * mv_pci_init_one - handle a positive probe of a PCI Marvell host | 3098 | * mv_pci_init_one - handle a positive probe of a PCI Marvell host |
3095 | * @pdev: PCI device found | 3099 | * @pdev: PCI device found |