diff options
author | Roland Dreier <roland@topspin.com> | 2005-04-16 18:26:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:26:32 -0400 |
commit | d10ddbf6d7f6699c386d1f41bf542189de32b6be (patch) | |
tree | b2e3ab95925407472fa9c62bb6016d85f822cb68 /drivers/infiniband/hw/mthca/mthca_main.c | |
parent | 6bd6228eed52ef188ebe46865ccff72da936c968 (diff) |
[PATCH] IB/mthca: encapsulate mem-free check into mthca_is_memfree()
Clean up mem-free mode support by introducing mthca_is_memfree() function,
which encapsulates the logic of deciding if a device is mem-free.
Signed-off-by: Roland Dreier <roland@topspin.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/infiniband/hw/mthca/mthca_main.c')
-rw-r--r-- | drivers/infiniband/hw/mthca/mthca_main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/mthca/mthca_main.c b/drivers/infiniband/hw/mthca/mthca_main.c index fdfc2b788e64..c9c94686e7a9 100644 --- a/drivers/infiniband/hw/mthca/mthca_main.c +++ b/drivers/infiniband/hw/mthca/mthca_main.c | |||
@@ -601,7 +601,7 @@ err_disable: | |||
601 | 601 | ||
602 | static int __devinit mthca_init_hca(struct mthca_dev *mdev) | 602 | static int __devinit mthca_init_hca(struct mthca_dev *mdev) |
603 | { | 603 | { |
604 | if (mdev->hca_type == ARBEL_NATIVE) | 604 | if (mthca_is_memfree(mdev)) |
605 | return mthca_init_arbel(mdev); | 605 | return mthca_init_arbel(mdev); |
606 | else | 606 | else |
607 | return mthca_init_tavor(mdev); | 607 | return mthca_init_tavor(mdev); |
@@ -835,7 +835,7 @@ static void mthca_close_hca(struct mthca_dev *mdev) | |||
835 | 835 | ||
836 | mthca_CLOSE_HCA(mdev, 0, &status); | 836 | mthca_CLOSE_HCA(mdev, 0, &status); |
837 | 837 | ||
838 | if (mdev->hca_type == ARBEL_NATIVE) { | 838 | if (mthca_is_memfree(mdev)) { |
839 | mthca_free_icm_table(mdev, mdev->cq_table.table); | 839 | mthca_free_icm_table(mdev, mdev->cq_table.table); |
840 | mthca_free_icm_table(mdev, mdev->qp_table.eqp_table); | 840 | mthca_free_icm_table(mdev, mdev->qp_table.eqp_table); |
841 | mthca_free_icm_table(mdev, mdev->qp_table.qp_table); | 841 | mthca_free_icm_table(mdev, mdev->qp_table.qp_table); |
@@ -939,7 +939,7 @@ static int __devinit mthca_init_one(struct pci_dev *pdev, | |||
939 | mdev->pdev = pdev; | 939 | mdev->pdev = pdev; |
940 | mdev->hca_type = id->driver_data; | 940 | mdev->hca_type = id->driver_data; |
941 | 941 | ||
942 | if (mdev->hca_type == ARBEL_NATIVE && !mthca_memfree_warned++) | 942 | if (mthca_is_memfree(mdev) && !mthca_memfree_warned++) |
943 | mthca_warn(mdev, "Warning: native MT25208 mode support is incomplete. " | 943 | mthca_warn(mdev, "Warning: native MT25208 mode support is incomplete. " |
944 | "Your HCA may not work properly.\n"); | 944 | "Your HCA may not work properly.\n"); |
945 | 945 | ||