From: Graeme Smecher <gsmecher@threespeedlogic.com>
Date: Tue, 3 Apr 2012 23:42:21 +0000 (-0400)
Subject: hwmon: (ad7314) Adds missing spi_dev initialization
X-Git-Tag: firefly_0821_release~3680^2~3142^2
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e16de9137c8beab02d78fb4fa82bb96e9f3d0ac3;p=firefly-linux-kernel-4.4.55.git

hwmon: (ad7314) Adds missing spi_dev initialization

This driver was recently moved from IIO (where it worked) to hwmon (where
it doesn't.) This breakage occured because the hwmon version neglected to
correctly initialize a reference to spi_dev in its drvdata. The result is a
segfault every time the temperature is queried.

Signed-off-by: Graeme Smecher <gsmecher@threespeedlogic.com>
Cc: stable@vger.kernel.org # 3.2+
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
---

diff --git a/drivers/hwmon/ad7314.c b/drivers/hwmon/ad7314.c
index 0e0cfcc36f8d..ce43642ef03e 100644
--- a/drivers/hwmon/ad7314.c
+++ b/drivers/hwmon/ad7314.c
@@ -128,6 +128,7 @@ static int __devinit ad7314_probe(struct spi_device *spi_dev)
 		ret = PTR_ERR(chip->hwmon_dev);
 		goto error_remove_group;
 	}
+	chip->spi_dev = spi_dev;
 
 	return 0;
 error_remove_group: