Loading drivers/ieee1394/csr1212.c +24 −4 Original line number Diff line number Diff line Loading @@ -518,7 +518,7 @@ void csr1212_detach_keyval_from_directory(struct csr1212_keyval *dir, * will be destroyed as well if their respective refcnts are 0. By means of * list manipulation, this routine will descend a directory structure in a * non-recursive manner. */ void _csr1212_destroy_keyval(struct csr1212_keyval *kv) static void csr1212_destroy_keyval(struct csr1212_keyval *kv) { struct csr1212_keyval *k, *a; struct csr1212_dentry dentry; Loading Loading @@ -566,6 +566,14 @@ void _csr1212_destroy_keyval(struct csr1212_keyval *kv) } } void csr1212_release_keyval(struct csr1212_keyval *kv) { if (kv->refcnt > 1) kv->refcnt--; else csr1212_destroy_keyval(kv); } void csr1212_destroy_csr(struct csr1212_csr *csr) { struct csr1212_csr_rom_cache *c, *oc; Loading Loading @@ -1251,7 +1259,8 @@ int csr1212_parse_keyval(struct csr1212_keyval *kv, return ret; } int _csr1212_read_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv) static int csr1212_read_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv) { struct csr1212_cache_region *cr, *ncr, *newcr = NULL; struct csr1212_keyval_img *kvi = NULL; Loading Loading @@ -1412,6 +1421,17 @@ int _csr1212_read_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv) return csr1212_parse_keyval(kv, cache); } 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; } int csr1212_parse_csr(struct csr1212_csr *csr) { static const int mr_map[] = { 4, 64, 1024, 0 }; Loading Loading @@ -1443,7 +1463,7 @@ int csr1212_parse_csr(struct csr1212_csr *csr) csr->root_kv->valid = 0; csr->root_kv->next = csr->root_kv; csr->root_kv->prev = csr->root_kv; ret = _csr1212_read_keyval(csr, csr->root_kv); ret = csr1212_read_keyval(csr, csr->root_kv); if (ret != CSR1212_SUCCESS) return ret; Loading @@ -1453,7 +1473,7 @@ int csr1212_parse_csr(struct csr1212_csr *csr) dentry; dentry = dentry->next) { if (dentry->kv->key.id == CSR1212_KV_ID_EXTENDED_ROM && !dentry->kv->valid) { ret = _csr1212_read_keyval(csr, dentry->kv); ret = csr1212_read_keyval(csr, dentry->kv); if (ret != CSR1212_SUCCESS) return ret; } Loading drivers/ieee1394/csr1212.h +5 −23 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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 Loading @@ -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); /* Loading drivers/ieee1394/ieee1394_core.c +4 −5 Original line number Diff line number Diff line Loading @@ -1372,11 +1372,10 @@ EXPORT_SYMBOL(hpsb_iso_wake); EXPORT_SYMBOL(hpsb_iso_recv_flush); /** csr1212.c **/ EXPORT_SYMBOL(csr1212_new_directory); EXPORT_SYMBOL(csr1212_attach_keyval_to_directory); EXPORT_SYMBOL(csr1212_detach_keyval_from_directory); EXPORT_SYMBOL(csr1212_release_keyval); EXPORT_SYMBOL(csr1212_read); EXPORT_SYMBOL(csr1212_get_keyval); EXPORT_SYMBOL(csr1212_new_directory); EXPORT_SYMBOL(csr1212_parse_keyval); EXPORT_SYMBOL(_csr1212_read_keyval); EXPORT_SYMBOL(_csr1212_destroy_keyval); EXPORT_SYMBOL(csr1212_read); EXPORT_SYMBOL(csr1212_release_keyval); Loading
drivers/ieee1394/csr1212.c +24 −4 Original line number Diff line number Diff line Loading @@ -518,7 +518,7 @@ void csr1212_detach_keyval_from_directory(struct csr1212_keyval *dir, * will be destroyed as well if their respective refcnts are 0. By means of * list manipulation, this routine will descend a directory structure in a * non-recursive manner. */ void _csr1212_destroy_keyval(struct csr1212_keyval *kv) static void csr1212_destroy_keyval(struct csr1212_keyval *kv) { struct csr1212_keyval *k, *a; struct csr1212_dentry dentry; Loading Loading @@ -566,6 +566,14 @@ void _csr1212_destroy_keyval(struct csr1212_keyval *kv) } } void csr1212_release_keyval(struct csr1212_keyval *kv) { if (kv->refcnt > 1) kv->refcnt--; else csr1212_destroy_keyval(kv); } void csr1212_destroy_csr(struct csr1212_csr *csr) { struct csr1212_csr_rom_cache *c, *oc; Loading Loading @@ -1251,7 +1259,8 @@ int csr1212_parse_keyval(struct csr1212_keyval *kv, return ret; } int _csr1212_read_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv) static int csr1212_read_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv) { struct csr1212_cache_region *cr, *ncr, *newcr = NULL; struct csr1212_keyval_img *kvi = NULL; Loading Loading @@ -1412,6 +1421,17 @@ int _csr1212_read_keyval(struct csr1212_csr *csr, struct csr1212_keyval *kv) return csr1212_parse_keyval(kv, cache); } 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; } int csr1212_parse_csr(struct csr1212_csr *csr) { static const int mr_map[] = { 4, 64, 1024, 0 }; Loading Loading @@ -1443,7 +1463,7 @@ int csr1212_parse_csr(struct csr1212_csr *csr) csr->root_kv->valid = 0; csr->root_kv->next = csr->root_kv; csr->root_kv->prev = csr->root_kv; ret = _csr1212_read_keyval(csr, csr->root_kv); ret = csr1212_read_keyval(csr, csr->root_kv); if (ret != CSR1212_SUCCESS) return ret; Loading @@ -1453,7 +1473,7 @@ int csr1212_parse_csr(struct csr1212_csr *csr) dentry; dentry = dentry->next) { if (dentry->kv->key.id == CSR1212_KV_ID_EXTENDED_ROM && !dentry->kv->valid) { ret = _csr1212_read_keyval(csr, dentry->kv); ret = csr1212_read_keyval(csr, dentry->kv); if (ret != CSR1212_SUCCESS) return ret; } Loading
drivers/ieee1394/csr1212.h +5 −23 Original line number Diff line number Diff line Loading @@ -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; Loading @@ -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 Loading @@ -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); /* Loading
drivers/ieee1394/ieee1394_core.c +4 −5 Original line number Diff line number Diff line Loading @@ -1372,11 +1372,10 @@ EXPORT_SYMBOL(hpsb_iso_wake); EXPORT_SYMBOL(hpsb_iso_recv_flush); /** csr1212.c **/ EXPORT_SYMBOL(csr1212_new_directory); EXPORT_SYMBOL(csr1212_attach_keyval_to_directory); EXPORT_SYMBOL(csr1212_detach_keyval_from_directory); EXPORT_SYMBOL(csr1212_release_keyval); EXPORT_SYMBOL(csr1212_read); EXPORT_SYMBOL(csr1212_get_keyval); EXPORT_SYMBOL(csr1212_new_directory); EXPORT_SYMBOL(csr1212_parse_keyval); EXPORT_SYMBOL(_csr1212_read_keyval); EXPORT_SYMBOL(_csr1212_destroy_keyval); EXPORT_SYMBOL(csr1212_read); EXPORT_SYMBOL(csr1212_release_keyval);