[PATCH linux dev-4.10 v2] drivers/hwmon/occ: Add reference count and switch to non-blocking read

Joel Stanley joel at jms.id.au
Wed Sep 20 11:56:23 AEST 2017


2017-09-20 5:49 GMT+09:30 Eddie James <eajames at linux.vnet.ibm.com>:
> diff --git a/drivers/hwmon/occ/common.c b/drivers/hwmon/occ/common.c
> index 34002fb..15f156e 100644
> --- a/drivers/hwmon/occ/common.c
> +++ b/drivers/hwmon/occ/common.c
> @@ -118,6 +118,12 @@ struct extended_sensor {
>         u8 data[6];
>  } __packed;
>
> +/* not available in 4.10 */

I'd prefer to backport an upstream patch.

It looks like 4.10 does have kobject_get_unless_zero, it's just not
exported. I will backport c70c176ff8c3 "kobject: Export
kobject_get_unless_zero()" from upstream and you can drop this hunk.

> +static bool kobject_get_unless_zero(struct kobject *kobj)
> +{
> +       return kref_get_unless_zero(&kobj->kref);
> +}
> +


More information about the openbmc mailing list