staging:iio:imu: Use dev_to_iio_dev()
Replace open-coded instances of getting a iio_dev struct from a device struct with dev_to_iio_dev(). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
		
					parent
					
						
							
								ba86dc46b8
							
						
					
				
			
			
				commit
				
					
						dedb1e77aa
					
				
			
		
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -179,7 +179,7 @@ static ssize_t adis16400_read_frequency(struct device *dev,
 | 
				
			||||||
		struct device_attribute *attr,
 | 
							struct device_attribute *attr,
 | 
				
			||||||
		char *buf)
 | 
							char *buf)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct iio_dev *indio_dev = dev_get_drvdata(dev);
 | 
						struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 | 
				
			||||||
	int ret, len = 0;
 | 
						int ret, len = 0;
 | 
				
			||||||
	ret = adis16400_get_freq(indio_dev);
 | 
						ret = adis16400_get_freq(indio_dev);
 | 
				
			||||||
	if (ret < 0)
 | 
						if (ret < 0)
 | 
				
			||||||
| 
						 | 
					@ -225,7 +225,7 @@ static ssize_t adis16400_write_frequency(struct device *dev,
 | 
				
			||||||
		const char *buf,
 | 
							const char *buf,
 | 
				
			||||||
		size_t len)
 | 
							size_t len)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct iio_dev *indio_dev = dev_get_drvdata(dev);
 | 
						struct iio_dev *indio_dev = dev_to_iio_dev(dev);
 | 
				
			||||||
	struct adis16400_state *st = iio_priv(indio_dev);
 | 
						struct adis16400_state *st = iio_priv(indio_dev);
 | 
				
			||||||
	long val;
 | 
						long val;
 | 
				
			||||||
	int ret;
 | 
						int ret;
 | 
				
			||||||
| 
						 | 
					@ -279,7 +279,7 @@ static ssize_t adis16400_write_reset(struct device *dev,
 | 
				
			||||||
	if (ret < 0)
 | 
						if (ret < 0)
 | 
				
			||||||
		return ret;
 | 
							return ret;
 | 
				
			||||||
	if (val) {
 | 
						if (val) {
 | 
				
			||||||
		ret = adis16400_reset(dev_get_drvdata(dev));
 | 
							ret = adis16400_reset(dev_to_iio_dev(dev));
 | 
				
			||||||
		if (ret < 0)
 | 
							if (ret < 0)
 | 
				
			||||||
			return ret;
 | 
								return ret;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue