diff --git a/drivers/cam_sensor_module/cam_flash/cam_flash_core.c b/drivers/cam_sensor_module/cam_flash/cam_flash_core.c index ed2afb3e89f2..c9a0d611e69c 100644 --- a/drivers/cam_sensor_module/cam_flash/cam_flash_core.c +++ b/drivers/cam_sensor_module/cam_flash/cam_flash_core.c @@ -20,7 +20,7 @@ int cam_flash_led_prepare(struct led_trigger *trigger, int options, int rc = 0; if (is_wled) { -#ifdef CONFIG_BACKLIGHT_QCOM_SPMI_WLED +#if IS_REACHABLE(CONFIG_BACKLIGHT_QCOM_SPMI_WLED) rc = wled_flash_led_prepare(trigger, options, max_current); if (rc) { CAM_ERR(CAM_FLASH, "enable reg failed: rc: %d", diff --git a/drivers/cam_sync/cam_sync.c b/drivers/cam_sync/cam_sync.c index 7f6a38a283f4..8f38bcca160b 100644 --- a/drivers/cam_sync/cam_sync.c +++ b/drivers/cam_sync/cam_sync.c @@ -9,14 +9,15 @@ #include #include #include +#if IS_REACHABLE(CONFIG_MSM_GLOBAL_SYNX) +#include +#endif + #include "cam_sync_util.h" #include "cam_debug_util.h" #include "cam_common_util.h" #include "camera_main.h" -#ifdef CONFIG_MSM_GLOBAL_SYNX -#include -#endif struct sync_device *sync_dev; /* @@ -948,7 +949,7 @@ static struct v4l2_file_operations cam_sync_v4l2_fops = { #endif }; -#if defined(CONFIG_MEDIA_CONTROLLER) +#if IS_REACHABLE(CONFIG_MEDIA_CONTROLLER) static int cam_sync_media_controller_init(struct sync_device *sync_dev, struct platform_device *pdev) { @@ -1031,8 +1032,8 @@ static int cam_sync_create_debugfs(void) return 0; } -#ifdef CONFIG_MSM_GLOBAL_SYNX -static void cam_sync_register_synx_bind_ops(void) +#if IS_REACHABLE(CONFIG_MSM_GLOBAL_SYNX) +static int cam_sync_register_synx_bind_ops(void) { int rc = 0; struct synx_register_params params; @@ -1046,7 +1047,9 @@ static void cam_sync_register_synx_bind_ops(void) rc = synx_register_ops(¶ms); if (rc) - CAM_ERR(CAM_SYNC, "synx registration fail with %d", rc); + CAM_ERR(CAM_SYNC, "synx registration fail with rc=%d", rc); + + return rc; } #endif @@ -1124,8 +1127,11 @@ static int cam_sync_component_bind(struct device *dev, trigger_cb_without_switch = false; cam_sync_create_debugfs(); -#ifdef CONFIG_MSM_GLOBAL_SYNX - cam_sync_register_synx_bind_ops(); +#if IS_REACHABLE(CONFIG_MSM_GLOBAL_SYNX) + CAM_INFO(CAM_SYNC, "Registering with synx driver"); + rc = cam_sync_register_synx_bind_ops(); + if (rc) + goto v4l2_fail; #endif CAM_DBG(CAM_SYNC, "Component bound successfully"); return rc;