lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55CF51D1.3090506@kernel.org>
Date:	Sat, 15 Aug 2015 15:50:57 +0100
From:	Jonathan Cameron <jic23@...nel.org>
To:	Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
	Markus Pargmann <mpa@...gutronix.de>
Cc:	Vlad Dogaru <vlad.dogaru@...el.com>,
	Paul Bolle <pebolle@...cali.nl>, linux-iio@...r.kernel.org,
	linux-kernel@...r.kernel.org, kernel@...gutronix.de
Subject: Re: [PATCH v3 3/6] iio: bmg160: Use generic dev_drvdata

On 12/08/15 17:05, Srinivas Pandruvada wrote:
> On Wed, 2015-08-12 at 16:50 +0200, Markus Pargmann wrote:
>> i2c_get_clientdata() is specifically for i2c. Replace it with the
>> generic dev_get/set_drvdata() to support different protocols.
>>
>> Signed-off-by: Markus Pargmann <mpa@...gutronix.de>
> Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
Applied.
>> ---
>>  drivers/iio/gyro/bmg160.c | 10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/iio/gyro/bmg160.c b/drivers/iio/gyro/bmg160.c
>> index 4701ea17baea..6eab91ba8977 100644
>> --- a/drivers/iio/gyro/bmg160.c
>> +++ b/drivers/iio/gyro/bmg160.c
>> @@ -1020,7 +1020,7 @@ static int bmg160_probe(struct i2c_client *client,
>>  		return -ENOMEM;
>>  
>>  	data = iio_priv(indio_dev);
>> -	i2c_set_clientdata(client, indio_dev);
>> +	dev_set_drvdata(&client->dev, indio_dev);
>>  	data->dev = &client->dev;
>>  
>>  	ret = bmg160_chip_init(data);
>> @@ -1154,7 +1154,7 @@ static int bmg160_remove(struct i2c_client *client)
>>  #ifdef CONFIG_PM_SLEEP
>>  static int bmg160_suspend(struct device *dev)
>>  {
>> -	struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
>> +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
>>  	struct bmg160_data *data = iio_priv(indio_dev);
>>  
>>  	mutex_lock(&data->mutex);
>> @@ -1166,7 +1166,7 @@ static int bmg160_suspend(struct device *dev)
>>  
>>  static int bmg160_resume(struct device *dev)
>>  {
>> -	struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
>> +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
>>  	struct bmg160_data *data = iio_priv(indio_dev);
>>  
>>  	mutex_lock(&data->mutex);
>> @@ -1182,7 +1182,7 @@ static int bmg160_resume(struct device *dev)
>>  #ifdef CONFIG_PM
>>  static int bmg160_runtime_suspend(struct device *dev)
>>  {
>> -	struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
>> +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
>>  	struct bmg160_data *data = iio_priv(indio_dev);
>>  	int ret;
>>  
>> @@ -1197,7 +1197,7 @@ static int bmg160_runtime_suspend(struct device *dev)
>>  
>>  static int bmg160_runtime_resume(struct device *dev)
>>  {
>> -	struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
>> +	struct iio_dev *indio_dev = dev_get_drvdata(dev);
>>  	struct bmg160_data *data = iio_priv(indio_dev);
>>  	int ret;
>>  
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ