diff --git a/drivers/gpu/drm/nouveau/core/include/engine/disp.h b/drivers/gpu/drm/nouveau/core/include/engine/disp.h index fc307f1317ffaf7836edcd286cc3f8307b036973..626508d8da4002dc9d863fa0bad6ad49525c69df 100644 --- a/drivers/gpu/drm/nouveau/core/include/engine/disp.h +++ b/drivers/gpu/drm/nouveau/core/include/engine/disp.h @@ -18,7 +18,7 @@ struct nouveau_disp { static inline struct nouveau_disp * nouveau_disp(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_ENGINE_DISP]; + return (void *)nouveau_engine(obj, NVDEV_ENGINE_DISP); } extern struct nouveau_oclass *nv04_disp_oclass; diff --git a/drivers/gpu/drm/nouveau/core/include/engine/fifo.h b/drivers/gpu/drm/nouveau/core/include/engine/fifo.h index 2007453f6fce075e3f7deceb47f654510d861e11..c52b939f52f0ab1e303c8fa44c7d63fed5074390 100644 --- a/drivers/gpu/drm/nouveau/core/include/engine/fifo.h +++ b/drivers/gpu/drm/nouveau/core/include/engine/fifo.h @@ -85,7 +85,7 @@ struct nouveau_fifo { static inline struct nouveau_fifo * nouveau_fifo(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_ENGINE_FIFO]; + return (void *)nouveau_engine(obj, NVDEV_ENGINE_FIFO); } #define nouveau_fifo_create(o,e,c,fc,lc,d) \ diff --git a/drivers/gpu/drm/nouveau/core/include/engine/graph.h b/drivers/gpu/drm/nouveau/core/include/engine/graph.h index d5055570d01bcfc88b5c58e7c5f86394d549b7ea..d61dcb7d6d5fe336a5cc7da25401cebc52008764 100644 --- a/drivers/gpu/drm/nouveau/core/include/engine/graph.h +++ b/drivers/gpu/drm/nouveau/core/include/engine/graph.h @@ -35,7 +35,7 @@ struct nouveau_graph { static inline struct nouveau_graph * nouveau_graph(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_ENGINE_GR]; + return (void *)nouveau_engine(obj, NVDEV_ENGINE_GR); } #define nouveau_graph_create(p,e,c,y,d) \ diff --git a/drivers/gpu/drm/nouveau/core/include/engine/perfmon.h b/drivers/gpu/drm/nouveau/core/include/engine/perfmon.h index 88cc812baaa3a93e3dcd9f1479977e7ac246ab08..251c8545ca58604943ceb276e2cc77caac012a95 100644 --- a/drivers/gpu/drm/nouveau/core/include/engine/perfmon.h +++ b/drivers/gpu/drm/nouveau/core/include/engine/perfmon.h @@ -24,7 +24,7 @@ struct nouveau_perfmon { static inline struct nouveau_perfmon * nouveau_perfmon(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_ENGINE_PERFMON]; + return (void *)nouveau_engine(obj, NVDEV_ENGINE_PERFMON); } extern struct nouveau_oclass *nv40_perfmon_oclass; diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/bar.h b/drivers/gpu/drm/nouveau/core/include/subdev/bar.h index 257ddf6d36d46fa5c7e52bb8900d6d5300ab8c45..960e33a30819c0c9ffad5c29e14a7334c80f660b 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/bar.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/bar.h @@ -27,7 +27,7 @@ struct nouveau_bar { static inline struct nouveau_bar * nouveau_bar(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_BAR]; + return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_BAR); } extern struct nouveau_oclass nv50_bar_oclass; diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/bios.h b/drivers/gpu/drm/nouveau/core/include/subdev/bios.h index 5bd1ca8cd20dbe03bee67fa3e0fddd4faf1410cb..39528a9f3c2081319fc2b2b577c36de8097a2695 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/bios.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/bios.h @@ -24,7 +24,7 @@ struct nouveau_bios { static inline struct nouveau_bios * nouveau_bios(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_VBIOS]; + return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_VBIOS); } u8 nvbios_checksum(const u8 *data, int size); diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/bus.h b/drivers/gpu/drm/nouveau/core/include/subdev/bus.h index 697f7ce70aabd6b3ee6c47cb45fb737ae9d36151..2d40f0c2fdfc6dc9b1a25e7d0f53cf97cdd21d93 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/bus.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/bus.h @@ -18,7 +18,7 @@ struct nouveau_bus { static inline struct nouveau_bus * nouveau_bus(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_BUS]; + return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_BUS); } #define nouveau_bus_create(p, e, o, d) \ diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/clock.h b/drivers/gpu/drm/nouveau/core/include/subdev/clock.h index 36ed035d4d421db3ad5b6dc10b563cf46e0280e6..0fd5e4a3a7a276a08fc318e0aa4e25e02492ae48 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/clock.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/clock.h @@ -104,7 +104,7 @@ struct nouveau_clock { static inline struct nouveau_clock * nouveau_clock(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_CLOCK]; + return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_CLOCK); } struct nouveau_clocks { diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/devinit.h b/drivers/gpu/drm/nouveau/core/include/subdev/devinit.h index e007a9d44683fb40b3922e797d6302aabd18a9a2..b627d53295435dec08f04df3c11fb1998a82f199 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/devinit.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/devinit.h @@ -15,7 +15,7 @@ struct nouveau_devinit { static inline struct nouveau_devinit * nouveau_devinit(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_DEVINIT]; + return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_DEVINIT); } extern struct nouveau_oclass *nv04_devinit_oclass; diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/fb.h b/drivers/gpu/drm/nouveau/core/include/subdev/fb.h index 8d0032f152054f57dbe0b0e4f35e784b50171e56..889603fbb0cf2b0b17df2c79905d7fb299f21573 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/fb.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/fb.h @@ -80,7 +80,7 @@ nouveau_fb(void *obj) nv_subidx(obj) == NVDEV_SUBDEV_FB) return obj; - return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_FB]; + return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_FB); } extern struct nouveau_oclass *nv04_fb_oclass; diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/fuse.h b/drivers/gpu/drm/nouveau/core/include/subdev/fuse.h index 2b1ddb2a9a7df17d6f0ce1a6257c91b5236cdda6..cc6b02fec6829efceacd6ec130c832d8967a8470 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/fuse.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/fuse.h @@ -11,7 +11,7 @@ struct nouveau_fuse { static inline struct nouveau_fuse * nouveau_fuse(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_FUSE]; + return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_FUSE); } #define nouveau_fuse_create(p, e, o, d) \ diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/gpio.h b/drivers/gpu/drm/nouveau/core/include/subdev/gpio.h index f855140dbcb70d3c081bbadaf941cfe25a5a14c2..8b60c5de6cb90f74553a3a643c08503b5c9cdf62 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/gpio.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/gpio.h @@ -35,7 +35,7 @@ struct nouveau_gpio { static inline struct nouveau_gpio * nouveau_gpio(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_GPIO]; + return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_GPIO); } extern struct nouveau_oclass *nv10_gpio_oclass; diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/i2c.h b/drivers/gpu/drm/nouveau/core/include/subdev/i2c.h index d94ccacb40bf1ae60081e9458f6ffdaf14d36bb9..a400e67f2d43c5250e47fe3e8be84ae0a4ef8e35 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/i2c.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/i2c.h @@ -81,7 +81,7 @@ struct nouveau_i2c { static inline struct nouveau_i2c * nouveau_i2c(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_I2C]; + return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_I2C); } extern struct nouveau_oclass *nv04_i2c_oclass; diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/ibus.h b/drivers/gpu/drm/nouveau/core/include/subdev/ibus.h index 31df634c0fdcaf775166b34ffc8a7ac54982ad75..b6387d27ea0c153c902b358346d25a7287a344f8 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/ibus.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/ibus.h @@ -11,7 +11,7 @@ struct nouveau_ibus { static inline struct nouveau_ibus * nouveau_ibus(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_IBUS]; + return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_IBUS); } #define nouveau_ibus_create(p,e,o,d) \ diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/instmem.h b/drivers/gpu/drm/nouveau/core/include/subdev/instmem.h index c1df26f3230c17f8fe6ff2a270b95cbafb441c6f..4953e6c6c86b7488a3dc45505343281911f51c90 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/instmem.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/instmem.h @@ -42,7 +42,7 @@ nouveau_instmem(void *obj) nv_subidx(obj) == NVDEV_SUBDEV_INSTMEM) return obj; - return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_INSTMEM]; + return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_INSTMEM); } extern struct nouveau_oclass *nv04_instmem_oclass; diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/ltc.h b/drivers/gpu/drm/nouveau/core/include/subdev/ltc.h index b909a7363f6b26458f8b64706d0fa676cecca556..432717a421d3e8c0c225c7837072d5ebfcf75d29 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/ltc.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/ltc.h @@ -25,7 +25,7 @@ struct nouveau_ltc { static inline struct nouveau_ltc * nouveau_ltc(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_LTC]; + return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_LTC); } extern struct nouveau_oclass *gf100_ltc_oclass; diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/mc.h b/drivers/gpu/drm/nouveau/core/include/subdev/mc.h index 568e4dfc5e9ebc5701ac1c040992ea559f49bc87..af7926f3a93debb5508fc03fd479fa4a545a02b9 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/mc.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/mc.h @@ -14,7 +14,7 @@ struct nouveau_mc { static inline struct nouveau_mc * nouveau_mc(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_MC]; + return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_MC); } extern struct nouveau_oclass *nv04_mc_oclass; diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/mxm.h b/drivers/gpu/drm/nouveau/core/include/subdev/mxm.h index b93b152cb566b026982192c416ca28835b949569..94b8af23c33e3af2b130ffa194574a46d682a8f6 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/mxm.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/mxm.h @@ -15,7 +15,7 @@ struct nouveau_mxm { static inline struct nouveau_mxm * nouveau_mxm(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_MXM]; + return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_MXM); } #define nouveau_mxm_create(p,e,o,d) \ diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/pwr.h b/drivers/gpu/drm/nouveau/core/include/subdev/pwr.h index f2427bf5aeed70e14bff97d84612ae81c62fdd30..ef57c85405ff1c82bb6664acf6e1e1b4f2744870 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/pwr.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/pwr.h @@ -30,7 +30,7 @@ struct nouveau_pwr { static inline struct nouveau_pwr * nouveau_pwr(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_PWR]; + return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_PWR); } extern struct nouveau_oclass *nva3_pwr_oclass; diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/therm.h b/drivers/gpu/drm/nouveau/core/include/subdev/therm.h index a437597dcafc5f58e0fe08953e85037d2b073f97..42f9574a06c988e82466f4e63b80a4ee3a0de9c6 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/therm.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/therm.h @@ -47,7 +47,7 @@ struct nouveau_therm { static inline struct nouveau_therm * nouveau_therm(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_THERM]; + return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_THERM); } #define nouveau_therm_create(p,e,o,d) \ diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/timer.h b/drivers/gpu/drm/nouveau/core/include/subdev/timer.h index db9be803a87440f4274c46f791de5a4b885dcbb6..36b5184e35ec8f51e23399bb2c36ebf9c786294c 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/timer.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/timer.h @@ -42,7 +42,7 @@ struct nouveau_timer { static inline struct nouveau_timer * nouveau_timer(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_TIMER]; + return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_TIMER); } #define nouveau_timer_create(p,e,o,d) \ diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/vm.h b/drivers/gpu/drm/nouveau/core/include/subdev/vm.h index c9509039f94b4b57bff45b718651bbdfd663012c..d56585f1cd8c500f8a9e34bc658413446d3b8e78 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/vm.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/vm.h @@ -91,7 +91,7 @@ struct nouveau_vmmgr { static inline struct nouveau_vmmgr * nouveau_vmmgr(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_VM]; + return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_VM); } #define nouveau_vmmgr_create(p,e,o,i,f,d) \ diff --git a/drivers/gpu/drm/nouveau/core/include/subdev/volt.h b/drivers/gpu/drm/nouveau/core/include/subdev/volt.h index 67db5e58880d3df2ef503fbe9a5f14d6401da802..13e9a83ceccc66d4599232338a91c98fd3ff228f 100644 --- a/drivers/gpu/drm/nouveau/core/include/subdev/volt.h +++ b/drivers/gpu/drm/nouveau/core/include/subdev/volt.h @@ -29,7 +29,7 @@ struct nouveau_volt { static inline struct nouveau_volt * nouveau_volt(void *obj) { - return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_VOLT]; + return (void *)nouveau_subdev(obj, NVDEV_SUBDEV_VOLT); } #define nouveau_volt_create(p, e, o, d) \