mfd: wm8350-i2c: Make sure the i2c regmap functions are compiled
[linux/fpc-iii.git] / arch / s390 / include / asm / chpid.h
blob38c405ef89cee13a1790308de7d32382bf316548
1 /*
2 * Copyright IBM Corp. 2007, 2012
3 * Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
4 */
5 #ifndef _ASM_S390_CHPID_H
6 #define _ASM_S390_CHPID_H
8 #include <uapi/asm/chpid.h>
9 #include <asm/cio.h>
11 static inline void chp_id_init(struct chp_id *chpid)
13 memset(chpid, 0, sizeof(struct chp_id));
16 static inline int chp_id_is_equal(struct chp_id *a, struct chp_id *b)
18 return (a->id == b->id) && (a->cssid == b->cssid);
21 static inline void chp_id_next(struct chp_id *chpid)
23 if (chpid->id < __MAX_CHPID)
24 chpid->id++;
25 else {
26 chpid->id = 0;
27 chpid->cssid++;
31 static inline int chp_id_is_valid(struct chp_id *chpid)
33 return (chpid->cssid <= __MAX_CSSID);
37 #define chp_id_for_each(c) \
38 for (chp_id_init(c); chp_id_is_valid(c); chp_id_next(c))
39 #endif /* _ASM_S390_CHPID_H */