Private
Public Access
2
0

src/x86/up.c: Require kernel FPGA control

abort the loading of mraa if the up kernel module is not loaded

Signed-off-by: Nicola Lunghi <nicola.lunghi@emutex.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Nicola Lunghi
2017-09-07 17:39:07 +01:00
committed by Brendan Le Foll
parent 45127e04b9
commit d78ad91635

View File

@@ -223,7 +223,13 @@ mraa_up_board()
b->adc_raw = 8;
b->adc_supported = 8;
return b;
const char* pinctrl_path = "/sys/bus/platform/drivers/up-pinctrl";
int have_pinctrl = access(pinctrl_path, F_OK) != -1;
syslog(LOG_NOTICE, "up: kernel pinctrl driver %savailable", have_pinctrl ? "" : "un");
if (have_pinctrl)
return b;
error:
syslog(LOG_CRIT, "up: Platform failed to initialise");
free(b);