Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4a3039e2 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Mauro Carvalho Chehab
Browse files

media: staging: atomisp: imx: remove dead code



Making some functions 'static' has uncovered a few functions that
have no caller, through the gcc warnings:

atomisp/i2c/imx/imx.c:1111:12: error: 'imx_t_focus_vcm' defined but not used [-Werror=unused-function]
atomisp/i2c/imx/imx.c:1103:12: error: 'imx_vcm_init' defined but not used [-Werror=unused-function]
atomisp/i2c/imx/imx.c:1095:12: error: 'imx_vcm_power_down' defined but not used [-Werror=unused-function]
atomisp/i2c/imx/imx.c:1087:12: error: 'imx_vcm_power_up' defined but not used [-Werror=unused-function]

All four of these can be removed. Since they call indirect functions,
I also looked at how those are used in turn:

- The power_up/power_down callbacks are called from other functions
  and are still needed.

- The t_focus_vcm callbacks pointers are completely unused and can
  be removed in both imx and ov8858. Some of the handlers are called
  directly and can now be marked static, the others are dummy
  implemntations that we can remove.

- vcm_init is unused in imx, but dw9718_vcm_init is used in ov8858,
  but is not used in imx, so that one needs to stay around. The callback
  pointers in imx can be removed.

Fixes: 9a5a6911 ("staging: imx: fix non-static declarations")

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent d726a0dc
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -136,7 +136,7 @@ int ad5816g_vcm_power_down(struct v4l2_subdev *sd)
}


int ad5816g_t_focus_vcm(struct v4l2_subdev *sd, u16 val)
static int ad5816g_t_focus_vcm(struct v4l2_subdev *sd, u16 val)
{
	struct i2c_client *client = v4l2_get_subdevdata(sd);
	u16 data = val & VCM_CODE_MASK;
@@ -214,12 +214,3 @@ int ad5816g_t_vcm_timing(struct v4l2_subdev *sd, s32 value)
{
	return 0;
}

int ad5816g_vcm_init(struct v4l2_subdev *sd)
{
	ad5816g_dev.platform_data = camera_get_af_platform_data();
	return (NULL == ad5816g_dev.platform_data) ? -ENODEV : 0;

}

+1 −10
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ int drv201_vcm_power_down(struct v4l2_subdev *sd)
}


int drv201_t_focus_vcm(struct v4l2_subdev *sd, u16 val)
static int drv201_t_focus_vcm(struct v4l2_subdev *sd, u16 val)
{
	struct i2c_client *client = v4l2_get_subdevdata(sd);
	u16 data = val & VCM_CODE_MASK;
@@ -207,12 +207,3 @@ int drv201_t_vcm_timing(struct v4l2_subdev *sd, s32 value)
{
	return 0;
}

int drv201_vcm_init(struct v4l2_subdev *sd)
{
	drv201_dev.platform_data = camera_get_af_platform_data();
	return (NULL == drv201_dev.platform_data) ? -ENODEV : 0;
}


+1 −13
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ int dw9714_vcm_power_down(struct v4l2_subdev *sd)
}


int dw9714_t_focus_vcm(struct v4l2_subdev *sd, u16 val)
static int dw9714_t_focus_vcm(struct v4l2_subdev *sd, u16 val)
{
	struct i2c_client *client = v4l2_get_subdevdata(sd);
	int ret = -EINVAL;
@@ -221,15 +221,3 @@ int dw9714_t_vcm_timing(struct v4l2_subdev *sd, s32 value)

	return 0;
}

int dw9714_vcm_init(struct v4l2_subdev *sd)
{

	/* set VCM to home position and vcm mode to direct*/
	dw9714_dev.vcm_mode = DW9714_DIRECT;
	dw9714_dev.vcm_settings.update = false;
	dw9714_dev.platform_data = camera_get_af_platform_data();
	return (NULL == dw9714_dev.platform_data) ? -ENODEV : 0;

}
+0 −5
Original line number Diff line number Diff line
@@ -204,11 +204,6 @@ int dw9718_q_focus_status(struct v4l2_subdev *sd, s32 *value)
	return 0;
}

int dw9718_t_focus_vcm(struct v4l2_subdev *sd, u16 val)
{
	return -EINVAL;
}

int dw9718_t_focus_rel(struct v4l2_subdev *sd, s32 value)
{
	return dw9718_t_focus_abs(sd, dw9718_dev.focus + value);
+0 −11
Original line number Diff line number Diff line
@@ -161,11 +161,6 @@ int dw9719_q_focus_status(struct v4l2_subdev *sd, s32 *value)
	return 0;
}

int dw9719_t_focus_vcm(struct v4l2_subdev *sd, u16 val)
{
	return -EINVAL;
}

int dw9719_t_focus_abs(struct v4l2_subdev *sd, s32 value)
{
	struct i2c_client *client = v4l2_get_subdevdata(sd);
@@ -201,9 +196,3 @@ int dw9719_t_vcm_timing(struct v4l2_subdev *sd, s32 value)
{
	return 0;
}

int dw9719_vcm_init(struct v4l2_subdev *sd)
{
	dw9719_dev.platform_data = camera_get_af_platform_data();
	return (NULL == dw9719_dev.platform_data) ? -ENODEV : 0;
}
Loading