Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit debe597c authored by Jingoo Han's avatar Jingoo Han Committed by Guenter Roeck
Browse files

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.

Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 4aa3eb4c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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 @@ static int ad7314_probe(struct spi_device *spi_dev)

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);