Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[pb] Fix building on older kernel versions
Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
  • Loading branch information
mcb30 committed Sep 11, 2013
1 parent 8f1abdb commit 6435015
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
35 changes: 35 additions & 0 deletions kernel/compat.h
@@ -0,0 +1,35 @@
/*
* Copyright (C) 2010 Michael Brown <mbrown@fensystems.co.uk>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/

#ifndef _PULSEBLASTER_COMPAT_H
#define _PULSEBLASTER_COMPAT_H

#include <linux/version.h>

/* On kernels earlier than 2.6.35, there is no "filp" argument in the
* bin_attribute write() method.
*/
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
#define pb_attr_program_write(filp, kobj, attr, buf, off, len) \
pb_attr_program_write(kobj, attr, buf, off, len)
#define pb_attr_bin_write(filp, kobj, attr, buf, off, len, handle) \
pb_attr_bin_write(kobj, attr, buf, off, len, handle)
#endif /* 2.6.35 */

#endif /* _PULSEBLASTER_COMPAT_H */
1 change: 1 addition & 0 deletions kernel/pulseblaster.c
Expand Up @@ -25,6 +25,7 @@
#include <linux/delay.h>
#include <linux/semaphore.h>
#include "pulseblaster.h"
#include "compat.h"

/** Pulseblaster driver name */
#define PB_NAME "pulseblaster"
Expand Down

0 comments on commit 6435015

Please sign in to comment.