Re: [PATCH] hwmon: (corsair-psu) serialize debugfs access against hwmon

Wilken Gottwalt <[email protected]> Thu, 06 Aug 2026 12:19:23 +0000
Newsgroups org.kernel.vger.linux-hwmon,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
On Thu, 6 Aug 2026 02:23:16 -0700
Guenter Roeck <[email protected]> wrote:

> On 8/5/26 22:23, Wilken Gottwalt wrote:
> 
> > 
> > That does not even compile on a current 7.1.5/7.1.6 kernel. Though, not sure
> > yet, what that is. But I can not risk running a trunk kernel on my workstation.
> > 
> > /usr/lib/modules/7.1.5-arch1-2/build/include/linux/cleanup.h:302:9: error: unknown type name
> > ‘class_hwmon_lock_t’; did you mean ‘class_task_lock_t’? 302 |         class_##_name##_t var
> > __cleanup(class_##_name##_destructor) =   \ |         ^~~~~~
> > /usr/lib/modules/7.1.5-arch1-2/build/include/linux/cleanup.h:422:9: note: in expansion of macro
> > ‘CLASS’ 422 |         CLASS(_name, __UNIQUE_ID(guard))
> >        |         ^~~~~
> > corsair-psu.c:667:9: note: in expansion of macro ‘guard’
> >    667 |         guard(hwmon_lock)(priv->hwmon_dev);
> >        |         ^~~~~
> > corsair-psu.c:667:9: error: cleanup argument not a function
> >    667 |         guard(hwmon_lock)(priv->hwmon_dev);
> >        |         ^~~~~
> > 
> 
> You'll need commit d1e720c7328e ("hwmon: Support guard() and scoped_guard for subsystem locks").

Oh, I got that confused. I saw the commit was added to Torvalds repo in May.
But I wasn't aware that it is still not part of the official kernel releases.
Ah, I can just add the two lines from the commit to the headers of my local
kernel build files. I will test it.

greetings,
Wilken