From a5752e0123b33605a5983bf671960d0ecd1ec410 Mon Sep 17 00:00:00 2001 From: Florian Pose Date: Mon, 9 Mar 2009 09:08:09 +0000 Subject: [PATCH] Preparations to compile against 2.6.27. --- master/master.c | 14 +++++++++----- master/master.h | 5 +++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/master/master.c b/master/master.c index 3483f92d..8c7d02c8 100644 --- a/master/master.c +++ b/master/master.c @@ -202,18 +202,22 @@ int ec_master_init(ec_master_t *master, /**< EtherCAT master */ if (ret) goto out_clear_fsm; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) + master->class_device = device_create(class, NULL, + MKDEV(MAJOR(device_number), master->index), NULL, + "EtherCAT%u", master->index); +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) master->class_device = device_create(class, NULL, MKDEV(MAJOR(device_number), master->index), "EtherCAT%u", master->index); #elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 15) master->class_device = class_device_create(class, NULL, - MKDEV(MAJOR(device_number), master->index), - NULL, "EtherCAT%u", master->index); + MKDEV(MAJOR(device_number), master->index), NULL, + "EtherCAT%u", master->index); #else master->class_device = class_device_create(class, - MKDEV(MAJOR(device_number), master->index), - NULL, "EtherCAT%u", master->index); + MKDEV(MAJOR(device_number), master->index), NULL, + "EtherCAT%u", master->index); #endif if (IS_ERR(master->class_device)) { EC_ERR("Failed to create class device!\n"); diff --git a/master/master.h b/master/master.h index a2ffcac2..2c5706be 100644 --- a/master/master.h +++ b/master/master.h @@ -42,7 +42,12 @@ #include #include #include + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) +#include +#else #include +#endif #include "device.h" #include "domain.h"