drm/nouveau/therm: reduce stack usage of nouveau_therm_ic_ctor
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Tue, 5 Feb 2013 19:44:19 +0000 (20:44 +0100)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 20 Feb 2013 06:00:43 +0000 (16:00 +1000)
Before: 1496 bytes
After:   152 bytes

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/subdev/therm/ic.c

index e512ff0aae605e7b4fd069e6654a7420e9cf2253..95a63e12c52c9f4112da7c11ae8351ad1baca898 100644 (file)
@@ -53,6 +53,31 @@ probe_monitoring_device(struct nouveau_i2c_port *i2c,
        return true;
 }
 
+static struct i2c_board_info
+nv_board_infos[] = {
+       { I2C_BOARD_INFO("w83l785ts", 0x2d) },
+       { I2C_BOARD_INFO("w83781d", 0x2d) },
+       { I2C_BOARD_INFO("adt7473", 0x2e) },
+       { I2C_BOARD_INFO("adt7473", 0x2d) },
+       { I2C_BOARD_INFO("adt7473", 0x2c) },
+       { I2C_BOARD_INFO("f75375", 0x2e) },
+       { I2C_BOARD_INFO("lm99", 0x4c) },
+       { I2C_BOARD_INFO("lm90", 0x4c) },
+       { I2C_BOARD_INFO("lm90", 0x4d) },
+       { I2C_BOARD_INFO("adm1021", 0x18) },
+       { I2C_BOARD_INFO("adm1021", 0x19) },
+       { I2C_BOARD_INFO("adm1021", 0x1a) },
+       { I2C_BOARD_INFO("adm1021", 0x29) },
+       { I2C_BOARD_INFO("adm1021", 0x2a) },
+       { I2C_BOARD_INFO("adm1021", 0x2b) },
+       { I2C_BOARD_INFO("adm1021", 0x4c) },
+       { I2C_BOARD_INFO("adm1021", 0x4d) },
+       { I2C_BOARD_INFO("adm1021", 0x4e) },
+       { I2C_BOARD_INFO("lm63", 0x18) },
+       { I2C_BOARD_INFO("lm63", 0x4e) },
+       { }
+};
+
 void
 nouveau_therm_ic_ctor(struct nouveau_therm *therm)
 {
@@ -60,29 +85,6 @@ nouveau_therm_ic_ctor(struct nouveau_therm *therm)
        struct nouveau_bios *bios = nouveau_bios(therm);
        struct nouveau_i2c *i2c = nouveau_i2c(therm);
        struct nvbios_extdev_func extdev_entry;
-       struct i2c_board_info info[] = {
-               { I2C_BOARD_INFO("w83l785ts", 0x2d) },
-               { I2C_BOARD_INFO("w83781d", 0x2d) },
-               { I2C_BOARD_INFO("adt7473", 0x2e) },
-               { I2C_BOARD_INFO("adt7473", 0x2d) },
-               { I2C_BOARD_INFO("adt7473", 0x2c) },
-               { I2C_BOARD_INFO("f75375", 0x2e) },
-               { I2C_BOARD_INFO("lm99", 0x4c) },
-               { I2C_BOARD_INFO("lm90", 0x4c) },
-               { I2C_BOARD_INFO("lm90", 0x4d) },
-               { I2C_BOARD_INFO("adm1021", 0x18) },
-               { I2C_BOARD_INFO("adm1021", 0x19) },
-               { I2C_BOARD_INFO("adm1021", 0x1a) },
-               { I2C_BOARD_INFO("adm1021", 0x29) },
-               { I2C_BOARD_INFO("adm1021", 0x2a) },
-               { I2C_BOARD_INFO("adm1021", 0x2b) },
-               { I2C_BOARD_INFO("adm1021", 0x4c) },
-               { I2C_BOARD_INFO("adm1021", 0x4d) },
-               { I2C_BOARD_INFO("adm1021", 0x4e) },
-               { I2C_BOARD_INFO("lm63", 0x18) },
-               { I2C_BOARD_INFO("lm63", 0x4e) },
-               { }
-       };
 
        if (!nvbios_extdev_find(bios, NVBIOS_EXTDEV_LM89, &extdev_entry)) {
                struct i2c_board_info board[] = {
@@ -111,6 +113,6 @@ nouveau_therm_ic_ctor(struct nouveau_therm *therm)
        /* The vbios doesn't provide the address of an exisiting monitoring
           device. Let's try our static list.
         */
-       i2c->identify(i2c, NV_I2C_DEFAULT(0), "monitoring device", info,
-                     probe_monitoring_device);
+       i2c->identify(i2c, NV_I2C_DEFAULT(0), "monitoring device",
+                     nv_board_infos, probe_monitoring_device);
 }