* [PATCH 1/2] siw: Fix ib_register_device() for > v2.6.34 kernels
@ 2010-09-22 20:30 Nicholas A. Bellinger
2010-09-23 15:26 ` Bernard Metzler
0 siblings, 1 reply; 2+ messages in thread
From: Nicholas A. Bellinger @ 2010-09-22 20:30 UTC (permalink / raw)
To: linux-kernel, netdev, linux-rdma, Bernard Metzler
Cc: David Miller, Matthew Wilcox, Andi Keen, Roland Dreier,
Nicholas Bellinger
From: Nicholas Bellinger <nab@linux-iscsi.org>
This patch adds a LINUX_VERSION_CODE > v2.6.34 check inside of siw_main.c:siw_register_device()
around the use of ib_register_device(). In post v2.6.34 kernels this function accepts a second
parameter used a sysfs port callback described here:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=9a6edb60ec10d86b1025a0cdad68fd89f1ddaf02
This patch currently sets this second parameter to NULL.
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
---
softiwarp/siw_main.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/softiwarp/siw_main.c b/softiwarp/siw_main.c
index cacedea..c97adee 100644
--- a/softiwarp/siw_main.c
+++ b/softiwarp/siw_main.c
@@ -233,8 +233,11 @@ int siw_register_device(struct siw_dev *dev)
ibdev->iwcm->add_ref = siw_qp_get_ref;
ibdev->iwcm->rem_ref = siw_qp_put_ref;
ibdev->iwcm->get_qp = siw_get_ofaqp;
-
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 34)
+ rv = ib_register_device(ibdev, NULL);
+#else
rv = ib_register_device(ibdev);
+#endif
if (rv) {
dprint(DBG_DM|DBG_ON, "(dev=%s): "
"ib_register_device failed: rv=%d\n", ibdev->name, rv);
--
1.5.6.5
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH 1/2] siw: Fix ib_register_device() for > v2.6.34 kernels
2010-09-22 20:30 [PATCH 1/2] siw: Fix ib_register_device() for > v2.6.34 kernels Nicholas A. Bellinger
@ 2010-09-23 15:26 ` Bernard Metzler
0 siblings, 0 replies; 2+ messages in thread
From: Bernard Metzler @ 2010-09-23 15:26 UTC (permalink / raw)
To: Nicholas A. Bellinger
Cc: Andi Keen, David Miller, linux-kernel, linux-rdma,
linux-rdma-owner, Nicholas Bellinger, netdev, Roland Dreier,
Matthew Wilcox
Thanks, Nicholas. Just applied your patch.
Bernard.
linux-rdma-owner@vger.kernel.org wrote on 09/22/2010 10:30:17 PM:
> From: Nicholas Bellinger <nab@linux-iscsi.org>
>
> This patch adds a LINUX_VERSION_CODE > v2.6.34 check inside of
> siw_main.c:siw_register_device()
> around the use of ib_register_device(). In post v2.6.34 kernels
> this function accepts a second
> parameter used a sysfs port callback described here:
>
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;
> a=commitdiff;h=9a6edb60ec10d86b1025a0cdad68fd89f1ddaf02
>
> This patch currently sets this second parameter to NULL.
>
> Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
> ---
> softiwarp/siw_main.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/softiwarp/siw_main.c b/softiwarp/siw_main.c
> index cacedea..c97adee 100644
> --- a/softiwarp/siw_main.c
> +++ b/softiwarp/siw_main.c
> @@ -233,8 +233,11 @@ int siw_register_device(struct siw_dev *dev)
> ibdev->iwcm->add_ref = siw_qp_get_ref;
> ibdev->iwcm->rem_ref = siw_qp_put_ref;
> ibdev->iwcm->get_qp = siw_get_ofaqp;
> -
> +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 34)
> + rv = ib_register_device(ibdev, NULL);
> +#else
> rv = ib_register_device(ibdev);
> +#endif
> if (rv) {
> dprint(DBG_DM|DBG_ON, "(dev=%s): "
> "ib_register_device failed: rv=%d\n", ibdev->name, rv);
> --
> 1.5.6.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-23 15:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-22 20:30 [PATCH 1/2] siw: Fix ib_register_device() for > v2.6.34 kernels Nicholas A. Bellinger
2010-09-23 15:26 ` Bernard Metzler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®