[OpenWrt-Devel] kernel module runtime configuration

Brent Thomson brentthomson at gmail.com
Thu Aug 14 18:45:41 EDT 2014


Hey all. I'm working on my first Linux kernel module. It's an
adaptation of an hd44780-over-GPIO driver. You can see it here:

    https://github.com/brnt/openwrt-hd44780

The driver is working fine, but I'd like to allow the user to
configure which GPIOs are used by the driver. Rather than hard-coding
the values in the C file (as they're currently done) I'd prefer to
read values from a config file (or the equivalent). Is there a best
practice for doing this at the kernel level module? In my googling,
I've seen comments indicating that reading from files at the kernel
level is a no-no? I'd prefer not to have to pass commands to insmod
and instead allow a static file (potentially managed by uci). What's
the right way to do this?

--

Brent
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list