diff options
author | Jiyoung Yun <jy910.yun@samsung.com> | 2015-01-02 11:10:39 +0900 |
---|---|---|
committer | Lukasz Stelmach <l.stelmach@samsung.com> | 2015-01-13 22:52:06 -0800 |
commit | 4d16440882cdff9a2a73346a2de2a1d2d1bddd36 (patch) | |
tree | 6d4e55c0beca19705b3890c0cac145faea8596f3 /devices/led.c | |
parent | 032b4a930fed8679f32f7300b5fe747c5ca4e6b0 (diff) | |
download | libdevice-node-4d16440882cdff9a2a73346a2de2a1d2d1bddd36.tar.gz libdevice-node-4d16440882cdff9a2a73346a2de2a1d2d1bddd36.tar.bz2 libdevice-node-4d16440882cdff9a2a73346a2de2a1d2d1bddd36.zip |
device-node: Add null check operation of interface function
If there is no interface for something to do,
it will return -ENOTSUP error instead of segfault.
Bug-Tizen: TC-1932
Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
Change-Id: If9dfdaecf53c88e14879dc66986e12cdcd1c2355
Diffstat (limited to 'devices/led.c')
-rw-r--r-- | devices/led.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/devices/led.c b/devices/led.c index 57db061..becf30e 100644 --- a/devices/led.c +++ b/devices/led.c @@ -23,11 +23,11 @@ static int led_get_prop(int prop, int *val) { switch (prop) { case PROP_LED_MAX_BRIGHTNESS: - return PLUGIN_GET(leds_torch_max_brightness)(val); + return PLUGIN_GET(leds_torch_max_brightness, val); case PROP_LED_BRIGHTNESS: - return PLUGIN_GET(leds_torch_brightness)(val); + return PLUGIN_GET(leds_torch_brightness, val); case PROP_LED_HARDKEY: - return PLUGIN_GET(hardkey_backlight)(val); + return PLUGIN_GET(hardkey_backlight, val); } return -1; @@ -37,11 +37,11 @@ static int led_set_prop(int prop, int val) { switch (prop) { case PROP_LED_BRIGHTNESS: - return PLUGIN_SET(leds_torch_brightness)(val); + return PLUGIN_SET(leds_torch_brightness, val); case PROP_LED_IR_COMMAND: - return PLUGIN_SET(irled_control)((char*)val); + return PLUGIN_SET(irled_control, (char*)val); case PROP_LED_HARDKEY: - return PLUGIN_SET(hardkey_backlight)(val); + return PLUGIN_SET(hardkey_backlight, val); } return -1; |