Writing Device Drivers

Use cmn_err() to Log Driver Activity

Use the cmn_err() function to print messages to the console from within the device driver. cmn_err() is similar to printf(3C), but provides additional format characters (such as %b) to print device register bits. See the cmn_err(9F) man page for more information.


Note –

To ensure that the driver is DDI-compliant, use cmn_err() instead of printf() and uprintf().