devices/ccat/update.c
branchstable-1.5
changeset 2569 720172a7563f
parent 2567 d70aad2f131f
child 2570 144e11d93e99
equal deleted inserted replaced
2568:2f3078ec9ffb 2569:720172a7563f
    23 #include <linux/module.h>
    23 #include <linux/module.h>
    24 #include <linux/sched.h>
    24 #include <linux/sched.h>
    25 #include <linux/uaccess.h>
    25 #include <linux/uaccess.h>
    26 #include "compat.h"
    26 #include "compat.h"
    27 #include "module.h"
    27 #include "module.h"
    28 #include "print.h"
       
    29 #include "update.h"
    28 #include "update.h"
    30 
    29 
    31 #define CCAT_DATA_IN_4 0x038
    30 #define CCAT_DATA_IN_4 0x038
    32 #define CCAT_DATA_IN_N 0x7F0
    31 #define CCAT_DATA_IN_N 0x7F0
    33 #define CCAT_DATA_OUT_4 0x030
    32 #define CCAT_DATA_OUT_4 0x030
   399 		return NULL;
   398 		return NULL;
   400 	}
   399 	}
   401 	kref_init(&update->refcount);
   400 	kref_init(&update->refcount);
   402 	update->ioaddr = ccatdev->bar[0].ioaddr + ioread32(addr + 0x8);
   401 	update->ioaddr = ccatdev->bar[0].ioaddr + ioread32(addr + 0x8);
   403 	memcpy_fromio(&update->info, addr, sizeof(update->info));
   402 	memcpy_fromio(&update->info, addr, sizeof(update->info));
   404 	print_update_info(&update->info, update->ioaddr);
   403 
   405 
   404 	if (0x00 != update->info.rev) {
   406 	if (0x00 != update->info.nRevision) {
   405 		pr_warn("CCAT Update rev. %d not supported\n", update->info.rev);
   407 		pr_warn("CCAT Update rev. %d not supported\n",
       
   408 			update->info.nRevision);
       
   409 		goto cleanup;
   406 		goto cleanup;
   410 	}
   407 	}
   411 
   408 
   412 	if (alloc_chrdev_region(&update->dev, 0, 1, KBUILD_MODNAME)) {
   409 	if (alloc_chrdev_region(&update->dev, 0, 1, KBUILD_MODNAME)) {
   413 		pr_warn("alloc_chrdev_region() failed\n");
   410 		pr_warn("alloc_chrdev_region() failed\n");