From: Guenter Roeck Date: Thu, 15 Mar 2012 04:40:05 +0000 (-0700) Subject: Convert REG_CONFIG to pointer X-Git-Tag: nct6775-v0.9~52 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=61ae9eb78e3defd8f355486956bb58ca589e2315;p=groeck-nct6775 Convert REG_CONFIG to pointer Signed-off-by: Guenter Roeck --- diff --git a/nct6775.c b/nct6775.c index 242bdfc..89ddf4d 100644 --- a/nct6775.c +++ b/nct6775.c @@ -469,6 +469,7 @@ struct nct6775_data { u16 reg_temp_config[NUM_REG_TEMP]; const char * const *temp_label; + u16 REG_CONFIG; u16 REG_VBAT; const u16 *REG_VIN; @@ -2768,10 +2769,11 @@ static inline void __devinit nct6775_init_device(struct nct6775_data *data) u8 tmp; /* Start monitoring if needed */ - tmp = nct6775_read_value(data, NCT6775_REG_CONFIG); - if (!(tmp & 0x01)) - nct6775_write_value(data, NCT6775_REG_CONFIG, - tmp | 0x01); + if (data->REG_CONFIG) { + tmp = nct6775_read_value(data, data->REG_CONFIG); + if (!(tmp & 0x01)) + nct6775_write_value(data, data->REG_CONFIG, tmp | 0x01); + } /* Enable temperature sensors if needed */ for (i = 0; i < NUM_REG_TEMP; i++) { @@ -2949,6 +2951,7 @@ static int __devinit nct6775_probe(struct platform_device *pdev) data->fan_from_reg = fan_from_reg16; data->fan_from_reg_min = fan_from_reg8; + data->REG_CONFIG = NCT6775_REG_CONFIG; data->REG_VBAT = NCT6775_REG_VBAT; data->REG_VIN = NCT6775_REG_IN; data->REG_IN_MINMAX[0] = NCT6775_REG_IN_MIN; @@ -2999,6 +3002,7 @@ static int __devinit nct6775_probe(struct platform_device *pdev) data->fan_from_reg = fan_from_reg13; data->fan_from_reg_min = fan_from_reg13; + data->REG_CONFIG = NCT6775_REG_CONFIG; data->REG_VBAT = NCT6775_REG_VBAT; data->REG_VIN = NCT6775_REG_IN; data->REG_IN_MINMAX[0] = NCT6775_REG_IN_MIN; @@ -3051,6 +3055,7 @@ static int __devinit nct6775_probe(struct platform_device *pdev) data->fan_from_reg = fan_from_reg13; data->fan_from_reg_min = fan_from_reg13; + data->REG_CONFIG = NCT6775_REG_CONFIG; data->REG_VBAT = NCT6775_REG_VBAT; data->REG_VIN = NCT6779_REG_IN; data->REG_IN_MINMAX[0] = NCT6775_REG_IN_MIN;