All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [lm-sensors] hwmon: (tmp401) Convert to use devm_hwmon_device_register_with_groups
@ 2013-10-18 14:25 Dan Carpenter
  2013-10-18 16:13 ` Guenter Roeck
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Dan Carpenter @ 2013-10-18 14:25 UTC (permalink / raw)
  To: lm-sensors

Hello Guenter Roeck,

The patch 9aeb5c70e84d: "hwmon: (tmp401) Convert to use 
devm_hwmon_device_register_with_groups" from Sep 4, 2013, leads to 
the following warning:
"drivers/hwmon/tmp401.c:360 store_temp()
	 warn: 'data' isn't an ERR_PTR"

drivers/hwmon/tmp401.c
   349  static ssize_t store_temp(struct device *dev, struct device_attribute *devattr,
   350                            const char *buf, size_t count)
   351  {
   352          int nr = to_sensor_dev_attr_2(devattr)->nr;
   353          int index = to_sensor_dev_attr_2(devattr)->index;
   354          struct tmp401_data *data = dev_get_drvdata(dev);
                                           ^^^^^^^^^^^^^^^^^^^
Returns NULL.

   355          struct i2c_client *client = data->client;
                                            ^^^^^^^^^^^^
Dereference.

   356          long val;
   357          u16 reg;
   358          u8 regaddr;
   359  
   360          if (IS_ERR(data))
                    ^^^^^^^^^^^^
Can this test be removed?

   361                  return PTR_ERR(data);
   362  

regards,
dan carpenter


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

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

end of thread, other threads:[~2013-11-06 20:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-18 14:25 [lm-sensors] hwmon: (tmp401) Convert to use devm_hwmon_device_register_with_groups Dan Carpenter
2013-10-18 16:13 ` Guenter Roeck
2013-10-19  8:24 ` Dan Carpenter
2013-11-06 19:28 ` Dan Carpenter
2013-11-06 19:39 ` Guenter Roeck
2013-11-06 20:38 ` Dan Carpenter

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.