* Version lincan-0.2 9 Jul 2003
*/
-#define __NO_VERSION__
-#include <linux/module.h>
-
-#include <linux/autoconf.h>
-
-#include <linux/version.h>
-#include <linux/kernel.h>
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0))
-#include <linux/malloc.h>
-#else
-#include <linux/slab.h>
-#endif
-#include <linux/proc_fs.h>
-#include <linux/version.h>
-
+#include "../include/can.h"
+#include "../include/can_sysdep.h"
#include "../include/main.h"
#include "../include/proc.h"
#include "../include/setup.h"
+#define __NO_VERSION__
+#include <linux/module.h>
+
int add_channel_to_procdir(struct candevice_t *candev);
int remove_channel_from_procdir(void);
int add_object_to_procdir(int chip_nr);
{
struct proc_dir_entry *new_entry = NULL;
- new_entry = (struct proc_dir_entry *) kmalloc(sizeof(struct
- proc_dir_entry), GFP_KERNEL);
+ new_entry = (struct proc_dir_entry *)
+ can_checked_malloc(sizeof(struct proc_dir_entry));
if (new_entry == NULL)
return NULL;
{
if (del != NULL) {
proc_unregister(parent, del->low_ino);
- kfree(del);
- del = NULL;
+ can_checked_free(del);
return 0;
}
else return -ENODEV;
for (i=0; i < candev->nr_all_chips; i++) {
base->channel[cc] = (struct channelproc_t *)
- kmalloc(sizeof(struct channelproc_t), GFP_KERNEL);
+ can_checked_malloc(sizeof(struct channelproc_t));
if (base->channel[cc] == NULL)
return -ENOMEM;
- else if (add_mem_to_list(base->channel[cc]))
- return -ENOMEM;
sprintf(base->channel[cc]->ch_name, "channel%d",cc);
for (i=0; i<max_objects; i++) {
base->channel[chip_nr]->object[i] = (struct objectproc_t *)
- kmalloc(sizeof(struct objectproc_t),GFP_KERNEL);
-
-
+ can_checked_malloc(sizeof(struct objectproc_t));
+
if (base->channel[chip_nr]->object[i] == NULL)
return -ENOMEM;
- else if (add_mem_to_list( base->channel[chip_nr]->object[i]))
- return -ENOMEM;
sprintf(base->channel[chip_nr]->object[i]->obj_name,"object%d",i);
sprintf(base->channel[chip_nr]->object[i]->lnk_name,"dev");