Commit 483f29cc authored by Alexander Beregalov's avatar Alexander Beregalov Committed by Greg Kroah-Hartman
Browse files

Staging: meilhaus: remove dependence on kernel version



Cc: David Kiliani <mail@davidkiliani.de>
Signed-off-by: default avatarAlexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a44522b2
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -337,11 +337,7 @@ static void me0600_ext_irq_destructor(struct me_subdevice *subdevice)
	kfree(instance);
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
static irqreturn_t me0600_isr(int irq, void *dev_id)
#else
static irqreturn_t me0600_isr(int irq, void *dev_id, struct pt_regs *regs)
#endif
{
	me0600_ext_irq_subdevice_t *instance;
	uint32_t status;
+0 −5
Original line number Diff line number Diff line
@@ -323,12 +323,7 @@ static int me1400_ext_irq_query_subdevice_caps_args(struct me_subdevice
	return ME_ERRNO_NOT_SUPPORTED;
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
static irqreturn_t me1400_ext_irq_isr(int irq, void *dev_id)
#else
static irqreturn_t me1400_ext_irq_isr(int irq, void *dev_id,
				      struct pt_regs *regs)
#endif
{
	me1400_ext_irq_subdevice_t *instance;
	uint32_t status;
+0 −17
Original line number Diff line number Diff line
@@ -55,11 +55,7 @@

static void me1600_ao_destructor(struct me_subdevice *subdevice);

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
static void me1600_ao_work_control_task(void *subdevice);
#else
static void me1600_ao_work_control_task(struct work_struct *work);
#endif

static int me1600_ao_io_reset_subdevice(me_subdevice_t * subdevice,
					struct file *filep, int flags);
@@ -200,13 +196,8 @@ me1600_ao_subdevice_t *me1600_ao_constructor(uint32_t reg_base,
	subdevice->me1600_workqueue = me1600_wq;

/* workqueue API changed in kernel 2.6.20 */
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) )
	INIT_WORK(&subdevice->ao_control_task, me1600_ao_work_control_task,
		  (void *)subdevice);
#else
	INIT_DELAYED_WORK(&subdevice->ao_control_task,
			  me1600_ao_work_control_task);
#endif
	return subdevice;
}

@@ -962,22 +953,14 @@ static int me1600_ao_query_range_info(me_subdevice_t * subdevice,
	return ME_ERRNO_SUCCESS;
}

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
static void me1600_ao_work_control_task(void *subdevice)
#else
static void me1600_ao_work_control_task(struct work_struct *work)
#endif
{
	me1600_ao_subdevice_t *instance;
	int reschedule = 1;
	int signaling = 0;

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
	instance = (me1600_ao_subdevice_t *) subdevice;
#else
	instance =
	    container_of((void *)work, me1600_ao_subdevice_t, ao_control_task);
#endif

	PINFO("<%s: %ld> executed. idx=%d\n", __func__, jiffies,
	      instance->ao_idx);
+0 −4
Original line number Diff line number Diff line
@@ -98,11 +98,7 @@ typedef struct me1600_ao_subdevice {
	wait_queue_head_t wait_queue;							/**< Wait queue to put on tasks waiting for data to arrive. */
	me1600_ao_timeout_t timeout;							/**< The timeout for start in blocking and non-blocking mode. */
	struct workqueue_struct *me1600_workqueue;
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
	struct work_struct ao_control_task;
#else
	struct delayed_work ao_control_task;
#endif

	volatile int ao_control_task_flag;						/**< Flag controling reexecuting of control task */
} me1600_ao_subdevice_t;
+0 −25
Original line number Diff line number Diff line
@@ -125,11 +125,7 @@ static int me4600_ai_query_subdevice_caps(me_subdevice_t * subdevice,
static int me4600_ai_query_subdevice_caps_args(struct me_subdevice *subdevice,
					       int cap, int *args, int count);

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
static irqreturn_t me4600_ai_isr(int irq, void *dev_id);
#else
static irqreturn_t me4600_ai_isr(int irq, void *dev_id, struct pt_regs *regs);
#endif

static int ai_mux_toggler(me4600_ai_subdevice_t * subdevice);

@@ -177,11 +173,7 @@ void inline ai_limited_ISM(me4600_ai_subdevice_t * instance,
/** Set ISM to next stage for limited mode */
void inline ai_data_acquisition_logic(me4600_ai_subdevice_t * instance);

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
static void me4600_ai_work_control_task(void *subdevice);
#else
static void me4600_ai_work_control_task(struct work_struct *work);
#endif

/* Definitions
 */
@@ -360,13 +352,8 @@ me4600_ai_subdevice_t *me4600_ai_constructor(uint32_t reg_base,
	subdevice->me4600_workqueue = me4600_wq;

/* workqueue API changed in kernel 2.6.20 */
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) )
	INIT_WORK(&subdevice->ai_control_task, me4600_ai_work_control_task,
		  (void *)subdevice);
#else
	INIT_DELAYED_WORK(&subdevice->ai_control_task,
			  me4600_ai_work_control_task);
#endif

	return subdevice;
}
@@ -2603,11 +2590,7 @@ void ai_infinite_isr(me4600_ai_subdevice_t * instance,
	}
}

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
static irqreturn_t me4600_ai_isr(int irq, void *dev_id)
#else
static irqreturn_t me4600_ai_isr(int irq, void *dev_id, struct pt_regs *regs)
#endif
{				/// @note This is time critical function!
	uint32_t irq_status;
	uint32_t ctrl_status;
@@ -3310,11 +3293,7 @@ static int inline ai_read_data_pooling(me4600_ai_subdevice_t * instance)
	return (!status) ? copied : -ME_ERRNO_RING_BUFFER_OVERFLOW;
}

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
static void me4600_ai_work_control_task(void *subdevice)
#else
static void me4600_ai_work_control_task(struct work_struct *work)
#endif
{
	me4600_ai_subdevice_t *instance;
	uint32_t status;
@@ -3323,12 +3302,8 @@ static void me4600_ai_work_control_task(struct work_struct *work)
	int reschedule = 0;
	int signaling = 0;

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
	instance = (me4600_ai_subdevice_t *) subdevice;
#else
	instance =
	    container_of((void *)work, me4600_ai_subdevice_t, ai_control_task);
#endif
	PINFO("<%s: %ld> executed.\n", __func__, jiffies);

	status = inl(instance->status_reg);
Loading