All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH 2/2] hwmon: The Code Crashes
@ 2015-08-26  5:41 Il Han
  2015-08-26 14:06 ` Guenter Roeck
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Il Han @ 2015-08-26  5:41 UTC (permalink / raw)
  To: lm-sensors

The code crashes, since dev is not an i2c client device.

Signed-off-by: Il Han <corone.il.han@gmail.com>
---
 drivers/hwmon/max31790.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/hwmon/max31790.c b/drivers/hwmon/max31790.c
index d9b0003..f129668 100644
--- a/drivers/hwmon/max31790.c
+++ b/drivers/hwmon/max31790.c
@@ -206,8 +206,8 @@ static ssize_t set_fan_target(struct device *dev,
 			      const char *buf, size_t count)
 {
 	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
-	struct i2c_client *client = to_i2c_client(dev);
-	struct max31790_data *data = i2c_get_clientdata(client);
+	struct max31790_data *data = dev_get_drvdata(dev);
+	struct i2c_client *client = data->client;
 	u8 bits;
 	int sr;
 	int target_count;
@@ -273,8 +273,8 @@ static ssize_t set_pwm(struct device *dev,
 		       const char *buf, size_t count)
 {
 	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
-	struct i2c_client *client = to_i2c_client(dev);
-	struct max31790_data *data = i2c_get_clientdata(client);
+	struct max31790_data *data = dev_get_drvdata(dev);
+	struct i2c_client *client = data->client;
 	unsigned long pwm;
 	int err;
 
@@ -325,8 +325,8 @@ static ssize_t set_pwm_enable(struct device *dev,
 			      const char *buf, size_t count)
 {
 	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
-	struct i2c_client *client = to_i2c_client(dev);
-	struct max31790_data *data = i2c_get_clientdata(client);
+	struct max31790_data *data = dev_get_drvdata(dev);
+	struct i2c_client *client = data->client;
 	unsigned long mode;
 	int err;
 
-- 
2.4.1


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [lm-sensors] [PATCH 2/2] hwmon: The Code Crashes
  2015-08-26  5:41 [lm-sensors] [PATCH 2/2] hwmon: The Code Crashes Il Han
@ 2015-08-26 14:06 ` Guenter Roeck
  2015-08-26 14:56 ` Il Han
  2015-08-26 15:26 ` Guenter Roeck
  2 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2015-08-26 14:06 UTC (permalink / raw)
  To: lm-sensors

On 08/25/2015 10:41 PM, Il Han wrote:
> The code crashes, since dev is not an i2c client device.
>
> Signed-off-by: Il Han <corone.il.han@gmail.com>

You lost me a bit here. Why did you make this a separate patch ?

Also, please version your patches and provide a change log.
I am sure I asked for that before.

Thanks,
Guenter


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [lm-sensors] [PATCH 2/2] hwmon: The Code Crashes
  2015-08-26  5:41 [lm-sensors] [PATCH 2/2] hwmon: The Code Crashes Il Han
  2015-08-26 14:06 ` Guenter Roeck
@ 2015-08-26 14:56 ` Il Han
  2015-08-26 15:26 ` Guenter Roeck
  2 siblings, 0 replies; 4+ messages in thread
From: Il Han @ 2015-08-26 14:56 UTC (permalink / raw)
  To: lm-sensors

2015-08-26 23:06 GMT+09:00 Guenter Roeck <linux@roeck-us.net>:

> On 08/25/2015 10:41 PM, Il Han wrote:
>
>> The code crashes, since dev is not an i2c client device.
>>
>> Signed-off-by: Il Han <corone.il.han@gmail.com>
>>
>
> You lost me a bit here. Why did you make this a separate patch ?
>
> Also, please version your patches and provide a change log.
> I am sure I asked for that before.
>
> Thanks,
> Guenter
>
>
Sorry.
Because I'm not accustomed to commit them with git, I made the mistake.
confused about making a patch version such as [PATCH v2], providing a
change log, etc.
I am going to look up about git commit.
--
Il Han
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [lm-sensors] [PATCH 2/2] hwmon: The Code Crashes
  2015-08-26  5:41 [lm-sensors] [PATCH 2/2] hwmon: The Code Crashes Il Han
  2015-08-26 14:06 ` Guenter Roeck
  2015-08-26 14:56 ` Il Han
@ 2015-08-26 15:26 ` Guenter Roeck
  2 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2015-08-26 15:26 UTC (permalink / raw)
  To: lm-sensors

On 08/26/2015 07:56 AM, Il Han wrote:
> 2015-08-26 23:06 GMT+09:00 Guenter Roeck <linux@roeck-us.net <mailto:linux@roeck-us.net>>:
>
>     On 08/25/2015 10:41 PM, Il Han wrote:
>
>         The code crashes, since dev is not an i2c client device.
>
>         Signed-off-by: Il Han <corone.il.han@gmail.com <mailto:corone.il.han@gmail.com>>
>
>
>     You lost me a bit here. Why did you make this a separate patch ?
>
>     Also, please version your patches and provide a change log.
>     I am sure I asked for that before.
>
>     Thanks,
>     Guenter
>
>
> Sorry.
> Because I'm not accustomed to commit them with git, I made the mistake.
> confused about making a patch version such as [PATCH v2], providing a change log, etc.
> I am going to look up about git commit.

You might be looking for
	git format-patch --subject-prefix="PATCH v2"

Providing a change log doesn't mean to provide separate patches. It means
to tag the patch with a version number ("PATCH v2" instead of "PATCH"),
and to describe the changes below the '---' line in the patch.
This is described in detail in Documentation/SubmittingPatches.

Thanks,
Guenter


_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-26 15:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-26  5:41 [lm-sensors] [PATCH 2/2] hwmon: The Code Crashes Il Han
2015-08-26 14:06 ` Guenter Roeck
2015-08-26 14:56 ` Il Han
2015-08-26 15:26 ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.