|
|
@@ -3,6 +3,7 @@
|
|
|
#include <linux/of.h>
|
|
|
|
|
|
struct device_node *nd; /* 设备节点 */
|
|
|
+struct property *comppro;
|
|
|
|
|
|
static int __init helloworld_init(void) {
|
|
|
pr_info("Hello world initialization!\n");
|
|
|
@@ -16,7 +17,16 @@ static int __init helloworld_init(void) {
|
|
|
printk("my_backlight node found!\n");
|
|
|
}
|
|
|
|
|
|
- return 0;
|
|
|
+ comppro = of_find_property(nd, "compatible", NULL);
|
|
|
+ if(comppro == NULL){
|
|
|
+ ret = -EINVAL;
|
|
|
+ goto fail_finish;
|
|
|
+ }else{
|
|
|
+ printk("compatible=%s\r\n",(char *)comppro->value);
|
|
|
+ }
|
|
|
+
|
|
|
+goto fail_finish:
|
|
|
+ return ret;
|
|
|
}
|
|
|
|
|
|
static void __exit helloworld_exit(void) {
|