Commit b467d97f authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

media: atomisp: get rid of atomisp_get_frame_pgnr() abstraction

Simplify the code by getting rid of this function, as it ends
being just a single line of code.

Link: https://lore.kernel.org/linux-media/80ea920d14379124ba92aab2e6a6d12a92d79b2b.1636544620.git.mchehab+huawei@kernel.org


Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 245f6f4a
Loading
Loading
Loading
Loading
+0 −16
Original line number Diff line number Diff line
@@ -1931,22 +1931,6 @@ irqreturn_t atomisp_isr_thread(int irq, void *isp_ptr)
	return IRQ_HANDLED;
}

/*
 * utils for buffer allocation/free
 */

int atomisp_get_frame_pgnr(struct atomisp_device *isp,
			   const struct ia_css_frame *frame, u32 *p_pgnr)
{
	if (!frame) {
		dev_err(isp->dev, "%s: NULL frame pointer ERROR.\n", __func__);
		return -EINVAL;
	}

	*p_pgnr = DIV_ROUND_UP(frame->data_bytes, PAGE_SIZE);
	return 0;
}

/*
 * Get internal fmt according to V4L2 fmt
 */
+0 −2
Original line number Diff line number Diff line
@@ -74,8 +74,6 @@ irqreturn_t atomisp_isr_thread(int irq, void *isp_ptr);
const struct atomisp_format_bridge *get_atomisp_format_bridge_from_mbus(
    u32 mbus_code);
bool atomisp_is_mbuscode_raw(uint32_t code);
int atomisp_get_frame_pgnr(struct atomisp_device *isp,
			   const struct ia_css_frame *frame, u32 *p_pgnr);
void atomisp_delayed_init_work(struct work_struct *work);

/* Get internal fmt according to V4L2 fmt */
+1 −1
Original line number Diff line number Diff line
@@ -1094,7 +1094,7 @@ static int frame_mmap(struct atomisp_device *isp,

	host_virt = vma->vm_start;
	isp_virt = frame->data;
	atomisp_get_frame_pgnr(isp, frame, &pgnr);
	pgnr = DIV_ROUND_UP(frame->data_bytes, PAGE_SIZE);

	if (do_isp_mm_remap(isp, vma, isp_virt, host_virt, pgnr))
		return -EAGAIN;