Commit ec49b5c2 authored by Marcin Slusarz's avatar Marcin Slusarz Committed by Ben Skeggs

drm/nouveau/therm: reduce stack usage of nouveau_therm_ic_ctor

Before: 1496 bytes
After:   152 bytes
Signed-off-by: default avatarMarcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 07df3043
...@@ -53,14 +53,8 @@ probe_monitoring_device(struct nouveau_i2c_port *i2c, ...@@ -53,14 +53,8 @@ probe_monitoring_device(struct nouveau_i2c_port *i2c,
return true; return true;
} }
void static struct i2c_board_info
nouveau_therm_ic_ctor(struct nouveau_therm *therm) nv_board_infos[] = {
{
struct nouveau_therm_priv *priv = (void *)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("w83l785ts", 0x2d) },
{ I2C_BOARD_INFO("w83781d", 0x2d) }, { I2C_BOARD_INFO("w83781d", 0x2d) },
{ I2C_BOARD_INFO("adt7473", 0x2e) }, { I2C_BOARD_INFO("adt7473", 0x2e) },
...@@ -82,7 +76,15 @@ nouveau_therm_ic_ctor(struct nouveau_therm *therm) ...@@ -82,7 +76,15 @@ nouveau_therm_ic_ctor(struct nouveau_therm *therm)
{ I2C_BOARD_INFO("lm63", 0x18) }, { I2C_BOARD_INFO("lm63", 0x18) },
{ I2C_BOARD_INFO("lm63", 0x4e) }, { I2C_BOARD_INFO("lm63", 0x4e) },
{ } { }
}; };
void
nouveau_therm_ic_ctor(struct nouveau_therm *therm)
{
struct nouveau_therm_priv *priv = (void *)therm;
struct nouveau_bios *bios = nouveau_bios(therm);
struct nouveau_i2c *i2c = nouveau_i2c(therm);
struct nvbios_extdev_func extdev_entry;
if (!nvbios_extdev_find(bios, NVBIOS_EXTDEV_LM89, &extdev_entry)) { if (!nvbios_extdev_find(bios, NVBIOS_EXTDEV_LM89, &extdev_entry)) {
struct i2c_board_info board[] = { struct i2c_board_info board[] = {
...@@ -111,6 +113,6 @@ nouveau_therm_ic_ctor(struct nouveau_therm *therm) ...@@ -111,6 +113,6 @@ nouveau_therm_ic_ctor(struct nouveau_therm *therm)
/* The vbios doesn't provide the address of an exisiting monitoring /* The vbios doesn't provide the address of an exisiting monitoring
device. Let's try our static list. device. Let's try our static list.
*/ */
i2c->identify(i2c, NV_I2C_DEFAULT(0), "monitoring device", info, i2c->identify(i2c, NV_I2C_DEFAULT(0), "monitoring device",
probe_monitoring_device); nv_board_infos, probe_monitoring_device);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment