Re: [PATCH] posix-clock: initialize cdev state before publishing
From: Haoli Zhang
Date: Thu Nov 19 2026 - 21:46:58 EST
Hi Frederic,
Yes. cdev_device_add() calls cdev_add() before device_add(). By “expose
the cdev”, I mean that the cdev is registered in cdev_map and its file
operations may be invoked before device_add() starts. I do not mean
that device_add() has already registered the struct device or created
a devtmpfs node.
The cdev_device_add() documentation requires callers to assume that
userspace may open the cdev and call its file operations even if the
helper later fails.
Thanks,
Haoli