Inquiry to open device node from user to kernel


#1

Hi,
I’m using Hikey board.
Do I need to add some code when I open device node from user to kernel?
I’ve created device node as /dev/nfc.

I also added permission in device/linaro/Hikey/sepolocy/ as under the text

  • “device/mediatek/mt6797/sepolicy/file_contexts”
    /dev/nfc u:object_r:nfc_device:s0

  • device/mediatek/mt6797/sepolicy/nfc.te
    allow nfc system_data_file:dir { read };
    allow nfc system_data_file:file { read };
    allow nfc nfc_data_file:dir { write };
    allow untrusted_app nfc:unix_stream_socket { connectto };

Do I need to add some more code to open device node?