Commit f3ca1f9d authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

media: ti-vpe: cal: Inline cal_data_get_num_csi2_phy() in its caller

The cal_data_get_num_csi2_phy() function simply returns
cal->data->num_csi2_phy, and is not consistently used across the driver,
as most accesses to cal->data->num_csi2_phy are open-coded. We could fix
those open-coded accesses to use cal_data_get_num_csi2_phy(), but that
wouldn't bring much in terms of readability, so inline
cal_data_get_num_csi2_phy() in its only caller instead, and drop the
function.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 825800dc
...@@ -494,11 +494,6 @@ static void cal_quickdump_regs(struct cal_dev *cal) ...@@ -494,11 +494,6 @@ static void cal_quickdump_regs(struct cal_dev *cal)
} }
} }
static u32 cal_data_get_num_csi2_phy(struct cal_dev *cal)
{
return cal->data->num_csi2_phy;
}
/* ------------------------------------------------------------------ /* ------------------------------------------------------------------
* CAMERARX Management * CAMERARX Management
* ------------------------------------------------------------------ * ------------------------------------------------------------------
...@@ -2328,7 +2323,7 @@ static int cal_probe(struct platform_device *pdev) ...@@ -2328,7 +2323,7 @@ static int cal_probe(struct platform_device *pdev)
if (IS_ERR(cal->phy[0])) if (IS_ERR(cal->phy[0]))
return PTR_ERR(cal->phy[0]); return PTR_ERR(cal->phy[0]);
if (cal_data_get_num_csi2_phy(cal) > 1) { if (cal->data->num_csi2_phy > 1) {
cal->phy[1] = cal_camerarx_create(cal, 1); cal->phy[1] = cal_camerarx_create(cal, 1);
if (IS_ERR(cal->phy[1])) if (IS_ERR(cal->phy[1]))
return PTR_ERR(cal->phy[1]); return PTR_ERR(cal->phy[1]);
...@@ -2340,7 +2335,7 @@ static int cal_probe(struct platform_device *pdev) ...@@ -2340,7 +2335,7 @@ static int cal_probe(struct platform_device *pdev)
cal->ctx[1] = NULL; cal->ctx[1] = NULL;
cal->ctx[0] = cal_create_instance(cal, 0); cal->ctx[0] = cal_create_instance(cal, 0);
if (cal_data_get_num_csi2_phy(cal) > 1) if (cal->data->num_csi2_phy > 1)
cal->ctx[1] = cal_create_instance(cal, 1); cal->ctx[1] = cal_create_instance(cal, 1);
if (!cal->ctx[0] && !cal->ctx[1]) { if (!cal->ctx[0] && !cal->ctx[1]) {
cal_err(cal, "Neither port is configured, no point in staying up\n"); cal_err(cal, "Neither port is configured, no point in staying up\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment