/* * generic net pointers */ #ifndef __NET_GENERIC_H__ #define __NET_GENERIC_H__ #include #include /* * Generic net pointers are to be used by modules to put some private * stuff on the struct net without explicit struct net modification * * The rules are simple: * 1. set pernet_operations->id. After register_pernet_device you * will have the id of your private pointer. * 2. set pernet_operations->size to have the code allocate and free * a private structure pointed to from struct net. * 3. do not change this pointer while the net is alive; * 4. do not try to have any private reference on the net_generic object. * * After accomplishing all of the above, the private pointer can be * accessed with the net_generic() call. */ struct net_generic { union { struct { unsigned int len; struct rcu_head rcu; } s; void *ptr[0]; }; }; static inline void *net_generic(const struct net *net, unsigned int id) { struct net_generic *ng; void *ptr; rcu_read_lock(); ng = rcu_dereference(net->gen); ptr = ng->ptr[id]; rcu_read_unlock(); return ptr; } #endif tion> net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Lauss <manuel.lauss@gmail.com>2017-01-24 10:12:00 -0800
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2017-01-24 10:27:34 -0800
commit3f5c34c6d4688b3b7e1dbc7bbc68a2f03a0d6b0c (patch)
treeb9387d85890c4466d9cf3d3145c95e0b07235234 /include/scsi/fc
parent62ed8ceda1699acae01b666497f004bfd3d67a6f (diff)
Input: wm97xx - make missing platform data non-fatal
Commit 6480af4915d6 ("power_supply: wm97xx_battery: use power_supply_get_drvdata") made wm97xx platform data mandatory, although it's still optional. This patch fixes an oops during driver probe on one of my MIPS boards with a wm9712. Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com> Reviewed-by: Robert Jarzmik <robert.jarzmik@free.fr> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'include/scsi/fc')