Writing Device Drivers

volatile and _depends_on

volatile is a keyword that must be used when declaring any variable that will reference a device register. If this is not done, the optimizer might optimize important accesses away. This is important; neglecting to use volatile can result in bugs that are difficult to track down. See "volatile" for more information.

Note -

_depends_on must not be declared a static variable; if it is, the compiler might optimize it out of the device driver code.