Skip to contentSkip to conversation

hwmon: (ad7314) use spi_get_drvdata() and spi_set_drvdata()

PATCH Applied Jingoo Han 2 participants 2 messages Apr 5, 2013 Hardware monitoring

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 hwmon: (ad7314) use spi_get_drvdata() and spi_set_drvdata()

Use the wrapper functions for getting and setting the driver data using spi_device instead of using dev_{get|set}_drvdata with &spi->dev, so we can directly pass a struct spi_device.

---
 drivers/hwmon/ad7314.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/hwmon/ad7314.c +2 -2
index f3c6001..f4f9b21 100644
@@ -116,7 +116,7 @@ static int ad7314_probe(struct spi_device *spi_dev)
 	if (chip = NULL)
 		return -ENOMEM;
 
-	dev_set_drvdata(&spi_dev->dev, chip);
+	spi_set_drvdata(spi_dev, chip);
 
 	ret = sysfs_create_group(&spi_dev->dev.kobj, &ad7314_group);
 	if (ret < 0)
@@ -137,7 +137,7 @@ error_remove_group:
 
 static int ad7314_remove(struct spi_device *spi_dev)
 {
-	struct ad7314_data *chip = dev_get_drvdata(&spi_dev->dev);
+	struct ad7314_data *chip = spi_get_drvdata(spi_dev);
 
 	hwmon_device_unregister(chip->hwmon_dev);
 	sysfs_remove_group(&spi_dev->dev.kobj, &ad7314_group);
Signature · 8 lines
1.7.2.5



_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors