Skip to content

Commit b467d97

Browse files
committed
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: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
1 parent 245f6f4 commit b467d97

3 files changed

Lines changed: 1 addition & 19 deletions

File tree

‎drivers/staging/media/atomisp/pci/atomisp_cmd.c‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1931,22 +1931,6 @@ irqreturn_t atomisp_isr_thread(int irq, void *isp_ptr)
19311931
return IRQ_HANDLED;
19321932
}
19331933

1934-
/*
1935-
* utils for buffer allocation/free
1936-
*/
1937-
1938-
int atomisp_get_frame_pgnr(struct atomisp_device *isp,
1939-
const struct ia_css_frame *frame, u32 *p_pgnr)
1940-
{
1941-
if (!frame) {
1942-
dev_err(isp->dev, "%s: NULL frame pointer ERROR.\n", __func__);
1943-
return -EINVAL;
1944-
}
1945-
1946-
*p_pgnr = DIV_ROUND_UP(frame->data_bytes, PAGE_SIZE);
1947-
return 0;
1948-
}
1949-
19501934
/*
19511935
* Get internal fmt according to V4L2 fmt
19521936
*/

‎drivers/staging/media/atomisp/pci/atomisp_cmd.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ irqreturn_t atomisp_isr_thread(int irq, void *isp_ptr);
7474
const struct atomisp_format_bridge *get_atomisp_format_bridge_from_mbus(
7575
u32 mbus_code);
7676
bool atomisp_is_mbuscode_raw(uint32_t code);
77-
int atomisp_get_frame_pgnr(struct atomisp_device *isp,
78-
const struct ia_css_frame *frame, u32 *p_pgnr);
7977
void atomisp_delayed_init_work(struct work_struct *work);
8078

8179
/* Get internal fmt according to V4L2 fmt */

‎drivers/staging/media/atomisp/pci/atomisp_fops.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ static int frame_mmap(struct atomisp_device *isp,
10941094

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

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

0 commit comments

Comments
 (0)