X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fieee1394%2Fcsr1212.h;h=cc23f3abe0cdcc6ca641b3ac56c65dc80e93e201;hb=fd2f3bddaeb20564f32e59f64e5063fbe0c8f4cc;hp=4ef0949589c7c169a8797f00ccc2c3aeaea1a4ba;hpb=64ff712321875c2457d3a77d3fc4ab4989f7a8c0;p=linux-2.6 diff --git a/drivers/ieee1394/csr1212.h b/drivers/ieee1394/csr1212.h index 4ef0949589..cc23f3abe0 100644 --- a/drivers/ieee1394/csr1212.h +++ b/drivers/ieee1394/csr1212.h @@ -31,10 +31,10 @@ #define __CSR1212_H__ #include -#include +#include -#define CSR1212_MALLOC(size) vmalloc((size)) -#define CSR1212_FREE(ptr) vfree(ptr) +#define CSR1212_MALLOC(size) kmalloc((size), GFP_KERNEL) +#define CSR1212_FREE(ptr) kfree(ptr) #define CSR1212_SUCCESS (0) @@ -313,15 +313,11 @@ extern int csr1212_parse_keyval(struct csr1212_keyval *kv, struct csr1212_csr_rom_cache *cache); extern int csr1212_parse_csr(struct csr1212_csr *csr); -/* These are internal functions referenced by inline functions below. */ -extern int _csr1212_read_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv); -extern void _csr1212_destroy_keyval(struct csr1212_keyval *kv); - /* This function allocates a new cache which may be used for either parsing or * generating sub-sets of Configuration ROM images. */ -static inline struct csr1212_csr_rom_cache *csr1212_rom_cache_malloc(u32 offset, - size_t size) +static inline struct csr1212_csr_rom_cache * +csr1212_rom_cache_malloc(u32 offset, size_t size) { struct csr1212_csr_rom_cache *cache; @@ -345,16 +341,8 @@ static inline struct csr1212_csr_rom_cache *csr1212_rom_cache_malloc(u32 offset, /* This function ensures that a keyval contains data when referencing a keyval * created by parsing a Configuration ROM. */ -static inline struct csr1212_keyval *csr1212_get_keyval(struct csr1212_csr *csr, - struct csr1212_keyval *kv) -{ - if (!kv) - return NULL; - if (!kv->valid) - if (_csr1212_read_keyval(csr, kv) != CSR1212_SUCCESS) - return NULL; - return kv; -} +extern struct csr1212_keyval * +csr1212_get_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv); /* This function increments the reference count for a keyval should there be a @@ -369,13 +357,7 @@ static inline void csr1212_keep_keyval(struct csr1212_keyval *kv) * keyval when there are no more users of the keyval. This should be called by * any code that calls csr1212_keep_keyval() or any of the keyval creation * routines csr1212_new_*(). */ -static inline void csr1212_release_keyval(struct csr1212_keyval *kv) -{ - if (kv->refcnt > 1) - kv->refcnt--; - else - _csr1212_destroy_keyval(kv); -} +extern void csr1212_release_keyval(struct csr1212_keyval *kv); /*