I was interested in what modern, C-based, Linux device driver development looked like, and so I took a good gander at [this excellent article](http://www.freesoftwaremagazine.com/articles/drivers_linux).

I didn't read every single line, but perused the majority of it, and my take away is this: *writing device drivers for Linux seems like an incredibly painful process*. Now that's my opinion, and I'm sure many Linux/C gurus out there would disagree, but there's one thing that I just can't wrap my head around here.

Every CPU/MCU exposes a C library that defines I/O registers, ports, etc. for accessing (both reads and writes) every single pin on the chip. On AVR controllers, for instance, there is `<avr/io.h`>. For ARM chips there is [CMSIS](http://www.arm.com/products/processors/cortex-m/cortex-microcontroller-software-interface-standard.php).

So my question is this:

**Why would I go to all the 'trouble' (more work) of following the guidelines in that article and building a proper device driver in Linux, when I could just write a C library that uses one of these processor-provided I/O registry accessors (again, `avr/io.h`, CMSIS, etc.) to access all the pins on the chip (which seems like less work)?**

I'm sure there's a reason: I'm just not seeing it. What is gained by using a proper device driver? What is lost by not using one and just using one of these libs directly?